mirror of
https://github.com/vicr123/the-libs.git
synced 2025-01-22 18:32:10 -05:00
Add tMessageBox class
This commit is contained in:
parent
b910575d7f
commit
8a4640a85f
3 changed files with 46 additions and 2 deletions
|
@ -33,7 +33,8 @@ SOURCES += tvariantanimation.cpp \
|
|||
tapplication.cpp \
|
||||
tshortcuthud.cpp \
|
||||
tstackedwidget.cpp \
|
||||
tpopover.cpp
|
||||
tpopover.cpp \
|
||||
tmessagebox.cpp
|
||||
|
||||
HEADERS += tvariantanimation.h\
|
||||
the-libs_global.h \
|
||||
|
@ -46,7 +47,8 @@ HEADERS += tvariantanimation.h\
|
|||
tpromise.h \
|
||||
tshortcuthud.h \
|
||||
tstackedwidget.h \
|
||||
tpopover.h
|
||||
tpopover.h \
|
||||
tmessagebox.h
|
||||
|
||||
TRANSLATIONS += \
|
||||
translations/au_AU.ts \
|
||||
|
|
22
lib/tmessagebox.cpp
Normal file
22
lib/tmessagebox.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "tmessagebox.h"
|
||||
|
||||
tMessageBox::tMessageBox(QWidget *parent) : QMessageBox(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tMessageBox::setWindowTitle(QString windowTitle) {
|
||||
#ifdef Q_OS_MAC
|
||||
QMessageBox::setText(windowTitle);
|
||||
#else
|
||||
QMessageBox::setWindowTitle(windowTitle);
|
||||
#endif
|
||||
}
|
||||
|
||||
void tMessageBox::setText(QString text) {
|
||||
#ifdef Q_OS_MAC
|
||||
QMessageBox::setInformativeText(text);
|
||||
#else
|
||||
QMessageBox::setText(text);
|
||||
#endif
|
||||
}
|
20
lib/tmessagebox.h
Normal file
20
lib/tmessagebox.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef TMESSAGEBOX_H
|
||||
#define TMESSAGEBOX_H
|
||||
|
||||
#include "the-libs_global.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
class THELIBSSHARED_EXPORT tMessageBox : public QMessageBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit tMessageBox(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void setWindowTitle(QString windowTitle);
|
||||
void setText(QString text);
|
||||
};
|
||||
|
||||
#endif // TMESSAGEBOX_H
|
Loading…
Reference in a new issue