summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp24
-rw-r--r--src/widgets/dialogs/qmessagebox.h4
2 files changed, 15 insertions, 13 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 6a55f62e53..708b6a86c1 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -54,7 +54,9 @@
#include <QtGui/qicon.h>
#include <QtGui/qtextdocument.h>
#include <QtWidgets/qapplication.h>
+#if QT_CONFIG(textedit)
#include <QtWidgets/qtextedit.h>
+#endif
#include <QtWidgets/qmenu.h>
#include "qdialog_p.h"
#include <QtGui/qfont.h>
@@ -83,7 +85,7 @@ enum Button { Old_Ok = 1, Old_Cancel = 2, Old_Yes = 3, Old_No = 4, Old_Abort = 5
NewButtonMask = 0xFFFFFC00 };
enum DetailButtonLabel { ShowLabel = 0, HideLabel = 1 };
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
class QMessageBoxDetailsText : public QWidget
{
Q_OBJECT
@@ -152,7 +154,7 @@ private:
bool copyAvailable;
TextEdit *textEdit;
};
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
class DetailButton : public QPushButton
{
@@ -192,7 +194,7 @@ class QMessageBoxPrivate : public QDialogPrivate
public:
QMessageBoxPrivate() : escapeButton(0), defaultButton(0), checkbox(0), clickedButton(0), detailsButton(0),
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
detailsText(0),
#endif
compatMode(false), autoAddOkButton(true),
@@ -242,7 +244,7 @@ public:
QCheckBox *checkbox;
QAbstractButton *clickedButton;
DetailButton *detailsButton;
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
QMessageBoxDetailsText *detailsText;
#endif
bool compatMode;
@@ -463,7 +465,7 @@ int QMessageBoxPrivate::execReturnCode(QAbstractButton *button)
void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
{
Q_Q(QMessageBox);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (detailsButton && detailsText && button == detailsButton) {
detailsButton->setLabel(detailsText->isHidden() ? HideLabel : ShowLabel);
detailsText->setHidden(!detailsText->isHidden());
@@ -1417,7 +1419,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
#if !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
-#if !defined(QT_NO_TEXTEDIT)
+#if QT_CONFIG(textedit)
if (e == QKeySequence::Copy) {
if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) {
e->setAccepted(true);
@@ -1428,7 +1430,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
e->setAccepted(true);
return;
}
-#endif // !QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
#if defined(Q_OS_WIN)
if (e == QKeySequence::Copy) {
@@ -1444,7 +1446,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
for (const auto *button : buttons)
textToCopy += button->text() + QLatin1String(" ");
textToCopy += QLatin1Char('\n') + separator;
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (d->detailsText)
textToCopy += d->detailsText->text() + QLatin1Char('\n') + separator;
#endif
@@ -1982,7 +1984,7 @@ int QMessageBoxPrivate::showOldMessageBox(QWidget *parent, QMessageBox::Icon ico
void QMessageBoxPrivate::retranslateStrings()
{
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (detailsButton)
detailsButton->setLabel(detailsText->isHidden() ? ShowLabel : HideLabel);
#endif
@@ -2437,7 +2439,7 @@ void QMessageBox::setButtonText(int button, const QString &text)
}
}
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
/*!
\property QMessageBox::detailedText
\brief the text to be displayed in the details area.
@@ -2485,7 +2487,7 @@ void QMessageBox::setDetailedText(const QString &text)
}
d->setupLayout();
}
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
/*!
\property QMessageBox::informativeText
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index 6d5179602b..fd7d7936b6 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QMessageBox : public QDialog
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat)
Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons)
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText)
#endif
Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText)
@@ -270,7 +270,7 @@ public:
QString informativeText() const;
void setInformativeText(const QString &text);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
QString detailedText() const;
void setDetailedText(const QString &text);
#endif