mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Fix yet another mac shutdown bug and some override rubbish
This commit is contained in:
parent
6f8c56074e
commit
5d4a051f55
@ -321,7 +321,7 @@ class gGraphView
|
|||||||
*/
|
*/
|
||||||
explicit gGraphView(QWidget *parent = 0, gGraphView *shared = 0);
|
explicit gGraphView(QWidget *parent = 0, gGraphView *shared = 0);
|
||||||
virtual ~gGraphView();
|
virtual ~gGraphView();
|
||||||
virtual void closeEvent(QCloseEvent * event);
|
void closeEvent(QCloseEvent * event) override;
|
||||||
|
|
||||||
//! \brief Add gGraph g to this gGraphView, in the requested graph-linkage group
|
//! \brief Add gGraph g to this gGraphView, in the requested graph-linkage group
|
||||||
void addGraph(gGraph *g, short group = 0);
|
void addGraph(gGraph *g, short group = 0);
|
||||||
@ -549,13 +549,13 @@ class gGraphView
|
|||||||
bool pinchTriggered(QPinchGesture * gesture);
|
bool pinchTriggered(QPinchGesture * gesture);
|
||||||
|
|
||||||
|
|
||||||
virtual void leaveEvent (QEvent * event);
|
void leaveEvent (QEvent * event) override;
|
||||||
|
|
||||||
//! \brief The heart of the drawing code
|
//! \brief The heart of the drawing code
|
||||||
#ifdef BROKEN_OPENGL_BUILD
|
#ifdef BROKEN_OPENGL_BUILD
|
||||||
virtual void paintEvent(QPaintEvent *);
|
void paintEvent(QPaintEvent *) override;
|
||||||
#else
|
#else
|
||||||
virtual void paintGL();
|
void paintGL() override;
|
||||||
#endif
|
#endif
|
||||||
//! \brief Calculates the sum of all graph heights
|
//! \brief Calculates the sum of all graph heights
|
||||||
float totalHeight();
|
float totalHeight();
|
||||||
@ -564,7 +564,7 @@ class gGraphView
|
|||||||
float scaleHeight();
|
float scaleHeight();
|
||||||
|
|
||||||
//! \brief Update the OpenGL area when the screen is resized
|
//! \brief Update the OpenGL area when the screen is resized
|
||||||
virtual void resizeEvent(QResizeEvent *);
|
void resizeEvent(QResizeEvent *) override;
|
||||||
|
|
||||||
//! \brief Set the Vertical offset (used in scrolling)
|
//! \brief Set the Vertical offset (used in scrolling)
|
||||||
void setOffsetY(int offsetY);
|
void setOffsetY(int offsetY);
|
||||||
@ -573,19 +573,19 @@ class gGraphView
|
|||||||
void setOffsetX(int offsetX);
|
void setOffsetX(int offsetX);
|
||||||
|
|
||||||
//! \brief Mouse Moved somewhere in main gGraphArea, propagates to the individual graphs
|
//! \brief Mouse Moved somewhere in main gGraphArea, propagates to the individual graphs
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event);
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
//! \brief Mouse Button Press Event somewhere in main gGraphArea, propagates to the individual graphs
|
//! \brief Mouse Button Press Event somewhere in main gGraphArea, propagates to the individual graphs
|
||||||
virtual void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
//! \brief Mouse Button Release Event somewhere in main gGraphArea, propagates to the individual graphs
|
//! \brief Mouse Button Release Event somewhere in main gGraphArea, propagates to the individual graphs
|
||||||
virtual void mouseReleaseEvent(QMouseEvent *event);
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||||
//! \brief Mouse Button Double Click Event somewhere in main gGraphArea, propagates to the individual graphs
|
//! \brief Mouse Button Double Click Event somewhere in main gGraphArea, propagates to the individual graphs
|
||||||
virtual void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||||
//! \brief Mouse Wheel Event somewhere in main gGraphArea, propagates to the individual graphs
|
//! \brief Mouse Wheel Event somewhere in main gGraphArea, propagates to the individual graphs
|
||||||
virtual void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
//! \brief Keyboard event while main gGraphArea has focus.
|
//! \brief Keyboard event while main gGraphArea has focus.
|
||||||
virtual void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event) override;
|
||||||
//! \brief Keyboard event while main gGraphArea has focus.
|
//! \brief Keyboard event while main gGraphArea has focus.
|
||||||
virtual void keyReleaseEvent(QKeyEvent *event);
|
void keyReleaseEvent(QKeyEvent *event) override;
|
||||||
|
|
||||||
//! \brief Add Graph to drawing queue, mainly for the benefit of multithreaded drawing code
|
//! \brief Add Graph to drawing queue, mainly for the benefit of multithreaded drawing code
|
||||||
void queGraph(gGraph *, int originX, int originY, int width, int height);
|
void queGraph(gGraph *, int originX, int originY, int width, int height);
|
||||||
|
@ -249,12 +249,23 @@ void MainWindow::logMessage(QString msg)
|
|||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent * event)
|
void MainWindow::closeEvent(QCloseEvent * event)
|
||||||
{
|
{
|
||||||
if (AppSetting->removeCardReminder()) {
|
static bool runonce = false;
|
||||||
Notify(QObject::tr("Don't forget to place your datacard back in your CPAP machine"), QObject::tr("SleepyHead Reminder"));
|
if (!runonce) {
|
||||||
|
if (AppSetting->removeCardReminder()) {
|
||||||
|
Notify(QObject::tr("Don't forget to place your datacard back in your CPAP machine"), QObject::tr("SleepyHead Reminder"));
|
||||||
|
QThread::msleep(1000);
|
||||||
|
QApplication::processEvents();
|
||||||
|
}
|
||||||
|
runonce = true;
|
||||||
|
} else {
|
||||||
|
qDebug() << "Qt is still calling closevent multiple times";
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QThread::msleep(1000);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern MainWindow *mainwin;
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
schema::channel.Save();
|
schema::channel.Save();
|
||||||
if (p_profile) {
|
if (p_profile) {
|
||||||
CloseProfile();
|
CloseProfile();
|
||||||
@ -267,12 +278,6 @@ void MainWindow::closeEvent(QCloseEvent * event)
|
|||||||
QSettings settings(getDeveloperName(), getAppName());
|
QSettings settings(getDeveloperName(), getAppName());
|
||||||
settings.setValue("MainWindow/geometry", saveGeometry());
|
settings.setValue("MainWindow/geometry", saveGeometry());
|
||||||
|
|
||||||
QMainWindow::closeEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
|
||||||
MainWindow::~MainWindow()
|
|
||||||
{
|
|
||||||
// Trash anything allocated by the Graph objects
|
// Trash anything allocated by the Graph objects
|
||||||
DestroyGraphGlobals();
|
DestroyGraphGlobals();
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *);
|
void closeEvent(QCloseEvent *) override;
|
||||||
virtual void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*! \fn void on_action_Import_Data_triggered();
|
/*! \fn void on_action_Import_Data_triggered();
|
||||||
|
Loading…
Reference in New Issue
Block a user