Engauge Digitizer 2
Loading...
Searching...
No Matches
MainWindowMsg.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2020 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "MainWindowMsg.h"
8#include <QApplication>
9#include <QMessageBox>
10
11MainWindowMsg::MainWindowMsg (const QString &msg) :
12 QMainWindow(),
13 m_msg (msg)
14{
15}
16
20
21void MainWindowMsg::showEvent (QShowEvent * /* event */)
22{
23 // Show message in gui instead of cout or cerr since console output is disabled in at least Microsoft Windows
24 QMessageBox msgBox (QMessageBox::Information,
25 QObject::tr ("Engauge Digitizer"),
26 m_msg);
27
28 // Connect so closing dialog also closes this class
29 connect (&msgBox, SIGNAL (buttonClicked (QAbstractButton *)), this, SLOT (slotClose (QAbstractButton *)));
30
31 msgBox.exec();
32}
33
34void MainWindowMsg::slotClose (QAbstractButton *)
35{
36 close ();
37 qApp->quit();
38
39 exit (0);
40}
MainWindowMsg(const QString &msg)
Single constructor.
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.