QElectroTech  0.70
qetmessagebox.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "qetmessagebox.h"
19 
23 QMessageBox::StandardButton QET::QetMessageBox::critical (QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
24 #ifdef Q_OS_MAC
25  QMessageBox message_box(QMessageBox::Critical, title, text, buttons, parent, Qt::Sheet);
26  message_box.setWindowModality(Qt::WindowModal);
27 #else
28  QMessageBox message_box(QMessageBox::Critical, title, text, buttons, parent);
29 #endif
30  message_box.setDefaultButton(defaultButton);
31 
32  return(static_cast<QMessageBox::StandardButton>(message_box.exec()));
33 }
34 
38 QMessageBox::StandardButton QET::QetMessageBox::information(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
39 #ifdef Q_OS_MAC
40  QMessageBox message_box(QMessageBox::Information, title, text, buttons, parent, Qt::Sheet);
41  message_box.setWindowModality(Qt::WindowModal);
42 #else
43  QMessageBox message_box(QMessageBox::Information, title, text, buttons, parent);
44 #endif
45  message_box.setDefaultButton(defaultButton);
46 
47  return(static_cast<QMessageBox::StandardButton>(message_box.exec()));
48 }
49 
53 QMessageBox::StandardButton QET::QetMessageBox::question (QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
54 #ifdef Q_OS_MAC
55  QMessageBox message_box(QMessageBox::Question, title, text, buttons, parent, Qt::Sheet);
56  message_box.setWindowModality(Qt::WindowModal);
57 #else
58  QMessageBox message_box(QMessageBox::Question, title, text, buttons, parent);
59 #endif
60  message_box.setDefaultButton(defaultButton);
61 
62  return(static_cast<QMessageBox::StandardButton>(message_box.exec()));
63 }
64 
68 QMessageBox::StandardButton QET::QetMessageBox::warning (QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
69 #ifdef Q_OS_MAC
70  QMessageBox message_box(QMessageBox::Warning, title, text, buttons, parent, Qt::Sheet);
71  message_box.setWindowModality(Qt::WindowModal);
72 #else
73  QMessageBox message_box(QMessageBox::Warning, title, text, buttons, parent);
74 #endif
75  message_box.setDefaultButton(defaultButton);
76 
77  return(static_cast<QMessageBox::StandardButton>(message_box.exec()));
78 }
QMessageBox::StandardButton question(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QMessageBox::StandardButton information(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QMessageBox::StandardButton warning(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)