Merge pull request #144 from admsasha/master

Stop crazy timerEvent for normal operation getOpenFileName
This commit is contained in:
glixx 2019-06-28 09:03:20 +03:00 committed by GitHub
commit 84387b9bc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -53,6 +53,7 @@ CGLView::CGLView(QtWindow* parent, CSettings* settings)
m_forcefullRedraw = 0;
m_forceRatingRedraw = 0;
m_forceBarRedraw = 0;
m_allowedTimerEvent = true;
m_backgroundColour = QColor(0, 0, 0);
@ -83,6 +84,16 @@ QSize CGLView::sizeHint() const
return QSize(200, 800); //fixme this does not work
}
void CGLView::stopTimerEvent()
{
m_allowedTimerEvent=false;
}
void CGLView::startTimerEvent()
{
m_allowedTimerEvent=true;
}
void CGLView::paintGL()
{
BENCHMARK(2, "enter");
@ -373,6 +384,8 @@ void CGLView::updateMidiTask()
void CGLView::timerEvent(QTimerEvent *event)
{
if (!m_allowedTimerEvent) return;
BENCHMARK(0, "timer enter");
if (event->timerId() != m_timer.timerId())
{

View File

@ -51,6 +51,9 @@ public:
CScore* getScoreObject() {return m_score;}
int m_cfg_openGlOptimise;
void stopTimerEvent();
void startTimerEvent();
protected:
void timerEvent(QTimerEvent *event);
void mediaTimerEvent(int ticks);
@ -86,6 +89,7 @@ private:
int m_forceBarRedraw;
int m_titleHeight;
eventBits_t m_eventBits;
bool m_allowedTimerEvent;
};
#endif // __GLVIEW_H__

View File

@ -676,6 +676,8 @@ void QtWindow::keyboardShortcuts()
void QtWindow::open()
{
m_glWidget->stopTimerEvent();
QFileInfo currentSong = m_settings->getCurrentSongLongFileName();
QString dir;
@ -691,6 +693,7 @@ void QtWindow::open()
m_settings->openSongFile(fileName);
setCurrentFile(fileName);
}
m_glWidget->startTimerEvent();
}
void QtWindow::readSettings()