Stop crazy timerEvent for normal operation getOpenFileName
This commit is contained in:
parent
edb1363893
commit
6e6ae904a6
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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__
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user