summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qmessagebox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qmessagebox.cpp')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 9421ea2953..cb8ac1ccbf 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -64,6 +64,7 @@
#include <QtGui/qfont.h>
#include <QtGui/qfontmetrics.h>
#include <QtGui/qclipboard.h>
+#include <private/qdesktopwidget_p.h>
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
@@ -97,7 +98,7 @@ public:
public:
TextEdit(QWidget *parent=0) : QTextEdit(parent) { }
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent * e) Q_DECL_OVERRIDE
+ void contextMenuEvent(QContextMenuEvent * e) override
{
QMenu *menu = createStandardContextMenu();
menu->setAttribute(Qt::WA_DeleteOnClose);
@@ -172,7 +173,7 @@ public:
void setLabel(DetailButtonLabel lbl)
{ setText(label(lbl)); }
- QSize sizeHint() const Q_DECL_OVERRIDE
+ QSize sizeHint() const override
{
ensurePolished();
QStyleOptionButton opt;
@@ -258,9 +259,9 @@ public:
QByteArray signalToDisconnectOnClose;
QSharedPointer<QMessageDialogOptions> options;
private:
- void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) Q_DECL_OVERRIDE;
+ void initHelper(QPlatformDialogHelper *) override;
+ void helperPrepareShow(QPlatformDialogHelper *) override;
+ void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) override;
};
void QMessageBoxPrivate::init(const QString &title, const QString &text)
@@ -361,7 +362,7 @@ void QMessageBoxPrivate::updateSize()
if (!q->isVisible())
return;
- QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
+ QSize screenSize = QDesktopWidgetPrivate::availableGeometry(QCursor::pos()).size();
int hardLimit = qMin(screenSize.width() - 480, 1000); // can never get bigger than this
// on small screens allows the messagebox be the same size as the screen
if (screenSize.width() <= 1024)
@@ -414,7 +415,7 @@ void QMessageBoxPrivate::updateSize()
}
QFontMetrics fm(QApplication::font("QMdiSubWindowTitleBar"));
- int windowTitleWidth = qMin(fm.width(q->windowTitle()) + 50, hardLimit);
+ int windowTitleWidth = qMin(fm.horizontalAdvance(q->windowTitle()) + 50, hardLimit);
if (windowTitleWidth > width)
width = windowTitleWidth;
@@ -2607,7 +2608,7 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
break;
}
if (!tmpIcon.isNull()) {
- QWindow *window = Q_NULLPTR;
+ QWindow *window = nullptr;
if (mb) {
window = mb->windowHandle();
if (!window) {