summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp16
-rw-r--r--src/widgets/dialogs/qcolordialog.h1
-rw-r--r--src/widgets/dialogs/qdialog.cpp25
-rw-r--r--src/widgets/dialogs/qdialog.h8
-rw-r--r--src/widgets/dialogs/qdialog_p.h5
-rw-r--r--src/widgets/dialogs/qerrormessage.cpp28
-rw-r--r--src/widgets/dialogs/qerrormessage.h1
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp14
-rw-r--r--src/widgets/dialogs/qfiledialog.h1
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h6
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp13
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h1
-rw-r--r--src/widgets/dialogs/qfilesystemmodel_p.h3
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp10
-rw-r--r--src/widgets/dialogs/qfontdialog.h1
-rw-r--r--src/widgets/dialogs/qfontdialog_p.h1
-rw-r--r--src/widgets/dialogs/qfscompleter_p.h6
-rw-r--r--src/widgets/dialogs/qinputdialog.h1
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp74
-rw-r--r--src/widgets/dialogs/qmessagebox.h5
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp19
-rw-r--r--src/widgets/dialogs/qprogressdialog.h1
-rw-r--r--src/widgets/dialogs/qsidebar_p.h1
-rw-r--r--src/widgets/dialogs/qwizard.cpp8
-rw-r--r--src/widgets/dialogs/qwizard.h1
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp252
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h4
29 files changed, 96 insertions, 414 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 04ef82f49d..f3652c09da 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -92,7 +92,7 @@ public:
SetColorAll = ShowColor | SelectColor
};
- QColorDialogPrivate() : options(new QColorDialogOptions)
+ QColorDialogPrivate() : options(QColorDialogOptions::create())
#ifdef Q_OS_WIN32
, updateTimer(0)
#endif
@@ -1180,14 +1180,10 @@ QColorShower::QColorShower(QColorDialog *parent)
gl->setMargin(gl->spacing());
lab = new QColorShowLabel(this);
-#ifndef Q_OS_WINCE
#ifdef QT_SMALL_COLORDIALOG
lab->setMinimumHeight(60);
#endif
lab->setMinimumWidth(60);
-#else
- lab->setMinimumWidth(20);
-#endif
// For QVGA screens only the comboboxes and color label are visible.
// For nHD screens only color and luminence pickers and color label are visible.
@@ -1702,7 +1698,7 @@ void QColorDialogPrivate::initWidgets()
leftLay = 0;
-#if defined(Q_OS_WINCE) || defined(QT_SMALL_COLORDIALOG)
+#if defined(QT_SMALL_COLORDIALOG)
smallDisplay = true;
const int lumSpace = 20;
#else
@@ -1725,7 +1721,7 @@ void QColorDialogPrivate::initWidgets()
leftLay->addWidget(lblBasicColors);
leftLay->addWidget(standard);
-#if !defined(Q_OS_WINCE) && !defined(QT_SMALL_COLORDIALOG)
+#if !defined(QT_SMALL_COLORDIALOG)
// The screen color picker button
screenColorPickerButton = new QPushButton();
leftLay->addWidget(screenColorPickerButton);
@@ -1734,9 +1730,7 @@ void QColorDialogPrivate::initWidgets()
q->connect(screenColorPickerButton, SIGNAL(clicked()), SLOT(_q_pickScreenColor()));
#endif
-#if !defined(Q_OS_WINCE)
leftLay->addStretch();
-#endif
custom = new QColorWell(q, customColorRows, colorColumns, QColorDialogOptions::customColors());
custom->setAcceptDrops(true);
@@ -1931,10 +1925,8 @@ static const Qt::WindowFlags DefaultWindowFlags =
Constructs a color dialog with the given \a parent.
*/
QColorDialog::QColorDialog(QWidget *parent)
- : QDialog(*new QColorDialogPrivate, parent, DefaultWindowFlags)
+ : QColorDialog(QColor(Qt::white), parent)
{
- Q_D(QColorDialog);
- d->init(Qt::white);
}
/*!
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index b036570427..3b56f0b5d1 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -40,6 +40,7 @@
#ifndef QCOLORDIALOG_H
#define QCOLORDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index bfc943966f..8dfcf2c6d6 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -427,31 +427,6 @@ void QDialogPrivate::resetModalitySetByOpen()
resetModalityTo = -1;
}
-#if defined(Q_OS_WINCE)
-#ifdef Q_OS_WINCE_WM
-void QDialogPrivate::_q_doneAction()
-{
- //Done...
- QApplication::postEvent(q_func(), new QEvent(QEvent::OkRequest));
-}
-#endif
-
-/*!
- \reimp
-*/
-bool QDialog::event(QEvent *e)
-{
- bool result = QWidget::event(e);
-#ifdef Q_OS_WINCE
- if (e->type() == QEvent::OkRequest) {
- accept();
- result = true;
- }
-#endif
- return result;
-}
-#endif
-
/*!
In general returns the modal dialog's result code, \c Accepted or
\c Rejected.
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index db5baf24f9..265790b0e5 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -40,6 +40,7 @@
#ifndef QDIALOG_H
#define QDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
@@ -98,9 +99,6 @@ public Q_SLOTS:
protected:
QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
-#if defined(Q_OS_WINCE)
- bool event(QEvent *e);
-#endif
void keyPressEvent(QKeyEvent *);
void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *);
@@ -113,10 +111,6 @@ protected:
private:
Q_DECLARE_PRIVATE(QDialog)
Q_DISABLE_COPY(QDialog)
-
-#ifdef Q_OS_WINCE_WM
- Q_PRIVATE_SLOT(d_func(), void _q_doneAction())
-#endif
};
QT_END_NAMESPACE
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 6a9b5bae57..1c7c5f3c2a 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qwidget_p.h"
#include "QtCore/qeventloop.h"
#include "QtCore/qpointer.h"
@@ -99,10 +100,6 @@ public:
void hideDefault();
void resetModalitySetByOpen();
-#ifdef Q_OS_WINCE_WM
- void _q_doneAction();
-#endif
-
int rescode;
int resetModalityTo;
bool wasModalitySet;
diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp
index 77d9eb29ac..5fcbe3fe9d 100644
--- a/src/widgets/dialogs/qerrormessage.cpp
+++ b/src/widgets/dialogs/qerrormessage.cpp
@@ -60,11 +60,6 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef Q_OS_WINCE
-extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp
-extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp
-#endif
-
QT_BEGIN_NAMESPACE
class QErrorMessagePrivate : public QDialogPrivate
@@ -100,32 +95,12 @@ public:
QSize QErrorMessageTextView::minimumSizeHint() const
{
-#ifdef Q_OS_WINCE
- if (qt_wince_is_mobile())
- if (qt_wince_is_high_dpi())
- return QSize(200, 200);
- else
- return QSize(100, 100);
- else
- return QSize(70, 70);
-#else
return QSize(50, 50);
-#endif
}
QSize QErrorMessageTextView::sizeHint() const
{
-#ifdef Q_OS_WINCE
- if (qt_wince_is_mobile())
- if (qt_wince_is_high_dpi())
- return QSize(400, 200);
- else
- return QSize(320, 120);
- else
- return QSize(300, 100);
-#else
return QSize(250, 75);
-#endif //Q_OS_WINCE
}
/*!
@@ -248,9 +223,6 @@ QErrorMessage::QErrorMessage(QWidget * parent)
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
#endif
d->again->setChecked(true);
-#if defined(Q_OS_WINCE)
- d->ok->setFixedSize(0,0);
-#endif
d->ok->setFocus();
d->retranslateStrings();
diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h
index 03d0dbf5c5..5ffa568c10 100644
--- a/src/widgets/dialogs/qerrormessage.h
+++ b/src/widgets/dialogs/qerrormessage.h
@@ -40,6 +40,7 @@
#ifndef QERRORMESSAGE_H
#define QERRORMESSAGE_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 1cf2d2b05e..e5f11e78da 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -60,15 +60,7 @@
#include <qmimedatabase.h>
#include <qapplication.h>
#include <qstylepainter.h>
-#if !defined(Q_OS_WINCE)
#include "ui_qfiledialog.h"
-#else
-#define Q_EMBEDDED_SMALLSCREEN
-#include "ui_qfiledialog_embedded.h"
-#if defined(Q_OS_WINCE)
-extern bool qt_priv_ptr_valid;
-#endif
-#endif
#if defined(Q_OS_UNIX)
#include <pwd.h>
#include <unistd.h> // for pathconf() on OS X
@@ -533,7 +525,7 @@ QFileDialogPrivate::QFileDialogPrivate()
showHiddenAction(0),
useDefaultCaption(true),
qFileDialogUi(0),
- options(new QFileDialogOptions)
+ options(QFileDialogOptions::create())
{
}
@@ -1750,7 +1742,7 @@ int QFileDialogPrivate::maxNameLength(const QString &path)
{
#if defined(Q_OS_UNIX)
return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
-#elif defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
+#elif defined(Q_OS_WINRT)
Q_UNUSED(path);
return MAX_PATH;
#elif defined(Q_OS_WIN)
@@ -4015,7 +4007,7 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
QString currentLocation = dirModel->rootPath();
QString path = index.data(QFileSystemModel::FilePathRole).toString();
if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) {
-#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE)
+#if defined(Q_OS_UNIX)
if (currentLocation == QDir::separator())
return path.mid(currentLocation.length());
#endif
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index f13cb98e96..4ade50793d 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -40,6 +40,7 @@
#ifndef QFILEDIALOG_H
#define QFILEDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qdir.h>
#include <QtCore/qstring.h>
#include <QtCore/qurl.h>
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index f273a4fb37..afebad4457 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include <QtCore/qglobal.h>
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#ifndef QT_NO_FILEDIALOG
@@ -177,10 +177,6 @@ public:
#if defined(Q_OS_WIN)
QString n(path);
n.replace(QLatin1Char('\\'), QLatin1Char('/'));
-#if defined(Q_OS_WINCE)
- if ((n.size() > 1) && (n.startsWith(QLatin1String("//"))))
- n = n.mid(1);
-#endif
return n;
#else // the compile should optimize away this
return path;
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 014792ea93..6df020dd58 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -263,7 +263,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
static QString translateDriveName(const QFileInfo &drive)
{
QString driveName = drive.absoluteFilePath();
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
if (driveName.startsWith(QLatin1Char('/'))) // UNC host
return drive.fileName();
if (driveName.endsWith(QLatin1Char('/')))
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index a6ae136c21..3186e9d015 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
+
#include <qthread.h>
#include <qmutex.h>
#include <qwaitcondition.h>
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 7fc51f4262..11b3659990 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -366,7 +366,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
if ((pathElements.isEmpty())
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if !defined(Q_OS_WIN)
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
#endif
)
@@ -375,7 +375,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
QString elementPath;
QChar separator = QLatin1Char('/');
QString trailingSeparator;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
if (absolutePath.startsWith(QLatin1String("//"))) { // UNC path
QString host = QLatin1String("\\\\") + pathElements.constFirst();
if (absolutePath == QDir::fromNativeSeparators(host))
@@ -840,7 +840,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
*/
QString QFileSystemModelPrivate::displayName(const QModelIndex &index) const
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
QFileSystemNode *dirNode = node(index);
if (!dirNode->volumeName.isNull())
return dirNode->volumeName + QLatin1String(" (") + name(index) + QLatin1Char(')');
@@ -1292,11 +1292,10 @@ QString QFileSystemModelPrivate::filePath(const QModelIndex &index) const
idx = idx.parent();
}
QString fullPath = QDir::fromNativeSeparators(path.join(QDir::separator()));
-#if !defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#if !defined(Q_OS_WIN)
if ((fullPath.length() > 2) && fullPath[0] == QLatin1Char('/') && fullPath[1] == QLatin1Char('/'))
fullPath = fullPath.mid(1);
-#endif
-#if defined(Q_OS_WIN)
+#else
if (fullPath.length() == 2 && fullPath.endsWith(QLatin1Char(':')))
fullPath.append(QLatin1Char('/'));
#endif
@@ -1687,7 +1686,7 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile
#else
Q_UNUSED(info)
#endif
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
//The parentNode is "" so we are listing the drives
if (parentNode->fileName.isEmpty()) {
wchar_t name[MAX_PATH + 1];
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index 6d50d0b606..7d790124c8 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -40,6 +40,7 @@
#ifndef QFILESYSTEMMODEL_H
#define QFILESYSTEMMODEL_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qpair.h>
#include <QtCore/qdir.h>
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h
index af3406b699..92398d981f 100644
--- a/src/widgets/dialogs/qfilesystemmodel_p.h
+++ b/src/widgets/dialogs/qfilesystemmodel_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qfilesystemmodel.h"
#ifndef QT_NO_FILESYSTEMMODEL
@@ -95,7 +96,7 @@ public:
}
QString fileName;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN)
QString volumeName;
#endif
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 2a500d3a08..1c4166c567 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -110,7 +110,7 @@ static const Qt::WindowFlags DefaultWindowFlags =
QFontDialogPrivate::QFontDialogPrivate()
: writingSystem(QFontDatabase::Any),
- options(QSharedPointer<QFontDialogOptions>::create())
+ options(QFontDialogOptions::create())
{
}
@@ -168,10 +168,8 @@ QFontDialog::QFontDialog(QWidget *parent)
\a initial color.
*/
QFontDialog::QFontDialog(const QFont &initial, QWidget *parent)
- : QDialog(*new QFontDialogPrivate, parent, DefaultWindowFlags)
+ : QFontDialog(parent)
{
- Q_D(QFontDialog);
- d->init();
setCurrentFont(initial);
}
@@ -321,11 +319,7 @@ void QFontDialogPrivate::init()
buttonBox->addButton(QDialogButtonBox::Cancel);
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
-#if defined(Q_OS_WINCE)
- q->resize(180, 120);
-#else
q->resize(500, 360);
-#endif // Q_OS_WINCE
sizeEdit->installEventFilter(q);
familyList->installEventFilter(q);
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index f76ce1b7f3..276f8f5e83 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -40,6 +40,7 @@
#ifndef QFONTDIALOG_H
#define QFONTDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtGui/qwindowdefs.h>
#include <QtWidgets/qdialog.h>
#include <QtGui/qfont.h>
diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h
index d6a6e87ee2..033f5a2be8 100644
--- a/src/widgets/dialogs/qfontdialog_p.h
+++ b/src/widgets/dialogs/qfontdialog_p.h
@@ -52,6 +52,7 @@
//
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qdialog_p.h"
#include "qfontdatabase.h"
#include "qfontdialog.h"
diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h
index a3341999f7..c073fa1521 100644
--- a/src/widgets/dialogs/qfscompleter_p.h
+++ b/src/widgets/dialogs/qfscompleter_p.h
@@ -51,9 +51,12 @@
// We mean it.
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qcompleter.h"
#include <QtWidgets/qfilesystemmodel.h>
+
QT_BEGIN_NAMESPACE
+
#ifndef QT_NO_FSCOMPLETER
/*!
@@ -74,7 +77,10 @@ public:
QAbstractProxyModel *proxyModel;
QFileSystemModel *sourceModel;
};
+
#endif // QT_NO_FSCOMPLETER
+
QT_END_NAMESPACE
+
#endif // QFSCOMPLETOR_P_H
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index 8adaf5a430..2fbea908cb 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -40,6 +40,7 @@
#ifndef QINPUTDIALOG_H
#define QINPUTDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
#include <QtCore/qstring.h>
#include <QtWidgets/qlineedit.h>
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 88af70fa36..689704884f 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -200,7 +200,7 @@ public:
#endif
compatMode(false), autoAddOkButton(true),
detectedEscapeButton(0), informativeLabel(0),
- options(new QMessageDialogOptions) { }
+ options(QMessageDialogOptions::create()) { }
void init(const QString &title = QString(), const QString &text = QString());
void setupLayout();
@@ -218,9 +218,6 @@ public:
int layoutMinimumWidth();
void retranslateStrings();
-#ifdef Q_OS_WINCE
- void hideSpecial();
-#endif
static int showOldMessageBox(QWidget *parent, QMessageBox::Icon icon,
const QString &title, const QString &text,
int button0, int button1, int button2);
@@ -362,24 +359,15 @@ void QMessageBoxPrivate::updateSize()
return;
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
-#if defined(Q_OS_WINCE)
- // the width of the screen, less the window border.
- int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
-#else
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)
hardLimit = screenSize.width();
-#endif
#ifdef Q_OS_MAC
int softLimit = qMin(screenSize.width()/2, 420);
#else
// note: ideally on windows, hard and soft limits but it breaks compat
-#ifndef Q_OS_WINCE
int softLimit = qMin(screenSize.width()/2, 500);
-#else
- int softLimit = qMin(screenSize.width() * 3 / 4, 500);
-#endif //Q_OS_WINCE
#endif
if (informativeLabel)
@@ -436,28 +424,6 @@ void QMessageBoxPrivate::updateSize()
QCoreApplication::removePostedEvents(q, QEvent::LayoutRequest);
}
-
-#ifdef Q_OS_WINCE
-/*!
- \internal
- Hides special buttons which are rather shown in the title bar
- on WinCE, to conserve screen space.
-*/
-
-void QMessageBoxPrivate::hideSpecial()
-{
- Q_Q(QMessageBox);
- QList<QPushButton*> list = q->findChildren<QPushButton*>();
- for (int i=0; i<list.size(); ++i) {
- QPushButton *pb = list.at(i);
- QString text = pb->text();
- text.remove(QChar::fromLatin1('&'));
- if (text == QApplication::translate("QMessageBox", "OK" ))
- pb->setFixedSize(0,0);
- }
-}
-#endif
-
static int oldButton(int button)
{
switch (button & QMessageBox::ButtonMask) {
@@ -1368,24 +1334,6 @@ bool QMessageBox::event(QEvent *e)
case QEvent::LanguageChange:
d_func()->retranslateStrings();
break;
-#ifdef Q_OS_WINCE
- case QEvent::OkRequest:
- case QEvent::HelpRequest: {
- QString bName =
- (e->type() == QEvent::OkRequest)
- ? QApplication::translate("QMessageBox", "OK")
- : QApplication::translate("QMessageBox", "Help");
- QList<QPushButton*> list = findChildren<QPushButton*>();
- for (int i=0; i<list.size(); ++i) {
- QPushButton *pb = list.at(i);
- if (pb->text() == bName) {
- if (pb->isEnabled())
- pb->click();
- return pb->isEnabled();
- }
- }
- }
-#endif
default:
break;
}
@@ -1525,20 +1473,6 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
QDialog::keyPressEvent(e);
}
-#ifdef Q_OS_WINCE
-/*!
- \reimp
-*/
-void QMessageBox::setVisible(bool visible)
-{
- Q_D(QMessageBox);
- if (visible)
- d->hideSpecial();
- QDialog::setVisible(visible);
-}
-#endif
-
-
/*!
\overload
@@ -1596,9 +1530,6 @@ void QMessageBox::showEvent(QShowEvent *e)
Q_D(QMessageBox);
if (d->autoAddOkButton) {
addButton(Ok);
-#if defined(Q_OS_WINCE)
- d->hideSpecial();
-#endif
}
if (d->detailsButton)
addButton(d->detailsButton, QMessageBox::ActionRole);
@@ -1912,9 +1843,6 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
QPixmap pm(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
if (!pm.isNull())
msgBox->setIconPixmap(pm);
-#if defined(Q_OS_WINCE)
- msgBox->setDefaultButton(msgBox->addButton(QMessageBox::Ok));
-#endif
// should perhaps be a style hint
#ifdef Q_OS_MAC
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index c958e4c352..c6a55964fe 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -40,6 +40,7 @@
#ifndef QMESSAGEBOX_H
#define QMESSAGEBOX_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
@@ -142,10 +143,6 @@ public:
QPushButton *addButton(StandardButton button);
void removeButton(QAbstractButton *button);
-#ifdef Q_OS_WINCE
- void setVisible(bool visible);
-#endif
-
using QDialog::open;
void open(QObject *receiver, const char *member);
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index f3fe500d26..26a8fcc92d 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -138,9 +138,10 @@ void QProgressDialogPrivate::init(const QString &labelText, const QString &cance
void QProgressDialogPrivate::layout()
{
Q_Q(QProgressDialog);
- int sp = q->style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
- int mtb = q->style()->pixelMetric(QStyle::PM_DefaultTopLevelMargin);
- int mlr = qMin(q->width() / 10, mtb);
+ int sp = q->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing, 0, q);
+ int mb = q->style()->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, q);
+ int ml = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, q));
+ int mr = qMin(q->width() / 10, q->style()->pixelMetric(QStyle::PM_LayoutRightMargin, 0, q));
const bool centered =
bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q));
@@ -154,12 +155,12 @@ void QProgressDialogPrivate::layout()
// dialog can be made very small if the user demands it so.
for (int attempt=5; attempt--;) {
cspc = cancel ? cs.height() + sp : 0;
- lh = qMax(0, q->height() - mtb - bh.height() - sp - cspc);
+ lh = qMax(0, q->height() - mb - bh.height() - sp - cspc);
if (lh < q->height()/4) {
// Getting cramped
sp /= 2;
- mtb /= 2;
+ mb /= 2;
if (cancel) {
cs.setHeight(qMax(4,cs.height()-sp-2));
}
@@ -171,14 +172,14 @@ void QProgressDialogPrivate::layout()
if (cancel) {
cancel->setGeometry(
- centered ? q->width()/2 - cs.width()/2 : q->width() - mlr - cs.width(),
- q->height() - mtb - cs.height(),
+ centered ? q->width()/2 - cs.width()/2 : q->width() - mr - cs.width(),
+ q->height() - mb - cs.height(),
cs.width(), cs.height());
}
if (label)
- label->setGeometry(mlr, additionalSpacing, q->width() - mlr * 2, lh);
- bar->setGeometry(mlr, lh + sp + additionalSpacing, q->width() - mlr * 2, bh.height());
+ label->setGeometry(ml, additionalSpacing, q->width() - ml - mr, lh);
+ bar->setGeometry(ml, lh + sp + additionalSpacing, q->width() - ml - mr, bh.height());
}
void QProgressDialogPrivate::retranslateStrings()
diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h
index 888deac046..a5e333259f 100644
--- a/src/widgets/dialogs/qprogressdialog.h
+++ b/src/widgets/dialogs/qprogressdialog.h
@@ -40,6 +40,7 @@
#ifndef QPROGRESSDIALOG_H
#define QPROGRESSDIALOG_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index 210c86be01..3e177e7e68 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <qlistwidget.h>
#include <qstandarditemmodel.h>
#include <qstyleditemdelegate.h>
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 53f947354c..f3d27ff77f 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -69,10 +69,6 @@
#include "private/qdialog_p.h"
#include <qdebug.h>
-#ifdef Q_OS_WINCE
-extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
-#endif
-
#include <string.h> // for memset()
#include <algorithm>
@@ -2215,10 +2211,6 @@ QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
{
Q_D(QWizard);
d->init();
-#ifdef Q_OS_WINCE
- if (!qt_wince_is_mobile())
- setWindowFlags(windowFlags() & ~Qt::WindowOkButtonHint);
-#endif
}
/*!
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index a188833ef3..9ce68b6566 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -40,6 +40,7 @@
#ifndef QWIZARD_H
#define QWIZARD_H
+#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 8bc5ba7f56..9d8e7c4b66 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -41,7 +41,6 @@
#ifndef QT_NO_STYLE_WINDOWSVISTA
#include "qwizard_win_p.h"
-#include <private/qsystemlibrary_p.h>
#include <private/qapplication_p.h>
#include <qpa/qplatformnativeinterface.h>
#include "qwizard.h"
@@ -54,112 +53,19 @@
#include <QtWidgets/QDesktopWidget>
#include <uxtheme.h>
+#include <vssym32.h>
+#include <dwmapi.h>
Q_DECLARE_METATYPE(QMargins)
-QT_BEGIN_NAMESPACE
+#ifndef WM_DWMCOMPOSITIONCHANGED
+# define WM_DWMCOMPOSITIONCHANGED 0x031E
+#endif
-//DWM related
-typedef struct { //MARGINS
- int cxLeftWidth; // width of left border that retains its size
- int cxRightWidth; // width of right border that retains its size
- int cyTopHeight; // height of top border that retains its size
- int cyBottomHeight; // height of bottom border that retains its size
-} WIZ_MARGINS;
-typedef struct { //DTTOPTS
- DWORD dwSize;
- DWORD dwFlags;
- COLORREF crText;
- COLORREF crBorder;
- COLORREF crShadow;
- int eTextShadowType;
- POINT ptShadowOffset;
- int iBorderSize;
- int iFontPropId;
- int iColorPropId;
- int iStateId;
- BOOL fApplyOverlay;
- int iGlowSize;
-} WIZ_DTTOPTS;
-
-typedef struct {
- DWORD dwFlags;
- DWORD dwMask;
-} WIZ_WTA_OPTIONS;
-
-#define WIZ_WM_THEMECHANGED 0x031A
-#define WIZ_WM_DWMCOMPOSITIONCHANGED 0x031E
-
-enum WIZ_WINDOWTHEMEATTRIBUTETYPE {
- WIZ_WTA_NONCLIENT = 1
-};
-
-#define WIZ_WTNCA_NODRAWCAPTION 0x00000001
-#define WIZ_WTNCA_NODRAWICON 0x00000002
-
-#define WIZ_DT_CENTER 0x00000001 //DT_CENTER
-#define WIZ_DT_VCENTER 0x00000004
-#define WIZ_DT_SINGLELINE 0x00000020
-#define WIZ_DT_NOPREFIX 0x00000800
-
-enum WIZ_NAVIGATIONPARTS { //NAVIGATIONPARTS
- WIZ_NAV_BACKBUTTON = 1,
- WIZ_NAV_FORWARDBUTTON = 2,
- WIZ_NAV_MENUBUTTON = 3,
-};
-
-enum WIZ_NAV_BACKBUTTONSTATES { //NAV_BACKBUTTONSTATES
- WIZ_NAV_BB_NORMAL = 1,
- WIZ_NAV_BB_HOT = 2,
- WIZ_NAV_BB_PRESSED = 3,
- WIZ_NAV_BB_DISABLED = 4,
-};
-
-#define WIZ_TMT_CAPTIONFONT (801) //TMT_CAPTIONFONT
-#define WIZ_DTT_COMPOSITED (1UL << 13) //DTT_COMPOSITED
-#define WIZ_DTT_GLOWSIZE (1UL << 11) //DTT_GLOWSIZE
-
-#define WIZ_WM_NCMOUSELEAVE 674 //WM_NCMOUSELEAVE
-
-#define WIZ_WP_CAPTION 1 //WP_CAPTION
-#define WIZ_CS_ACTIVE 1 //CS_ACTIVE
-#define WIZ_TMT_FILLCOLORHINT 3821 //TMT_FILLCOLORHINT
-#define WIZ_TMT_BORDERCOLORHINT 3822 //TMT_BORDERCOLORHINT
-
-typedef BOOL (WINAPI *PtrDwmDefWindowProc)(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult);
-typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL* pfEnabled);
-typedef HRESULT (WINAPI *PtrDwmExtendFrameIntoClientArea)(HWND hWnd, const WIZ_MARGINS* pMarInset);
-typedef HRESULT (WINAPI *PtrSetWindowThemeAttribute)(HWND hwnd, enum WIZ_WINDOWTHEMEATTRIBUTETYPE eAttribute, PVOID pvAttribute, DWORD cbAttribute);
-
-static PtrDwmDefWindowProc pDwmDefWindowProc = 0;
-static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled = 0;
-static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0;
-static PtrSetWindowThemeAttribute pSetWindowThemeAttribute = 0;
-
-//Theme related
-typedef bool (WINAPI *PtrIsAppThemed)();
-typedef bool (WINAPI *PtrIsThemeActive)();
-typedef HANDLE (WINAPI *PtrOpenThemeData)(HWND hwnd, LPCWSTR pszClassList);
-typedef HRESULT (WINAPI *PtrCloseThemeData)(HANDLE hTheme);
-typedef HRESULT (WINAPI *PtrGetThemeSysFont)(HANDLE hTheme, int iFontId, LOGFONTW *plf);
-typedef HRESULT (WINAPI *PtrDrawThemeTextEx)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const WIZ_DTTOPTS *pOptions);
-typedef HRESULT (WINAPI *PtrDrawThemeBackground)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect);
-typedef HRESULT (WINAPI *PtrGetThemePartSize)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz);
-typedef HRESULT (WINAPI *PtrGetThemeColor)(HANDLE hTheme, int iPartId, int iStateId, int iPropId, OUT COLORREF *pColor);
-
-static PtrIsAppThemed pIsAppThemed = 0;
-static PtrIsThemeActive pIsThemeActive = 0;
-static PtrOpenThemeData pOpenThemeData = 0;
-static PtrCloseThemeData pCloseThemeData = 0;
-static PtrGetThemeSysFont pGetThemeSysFont = 0;
-static PtrDrawThemeTextEx pDrawThemeTextEx = 0;
-static PtrDrawThemeBackground pDrawThemeBackground = 0;
-static PtrGetThemePartSize pGetThemePartSize = 0;
-static PtrGetThemeColor pGetThemeColor = 0;
+QT_BEGIN_NAMESPACE
int QVistaHelper::instanceCount = 0;
int QVistaHelper::m_devicePixelRatio = 1;
-bool QVistaHelper::is_vista = false;
QVistaHelper::VistaState QVistaHelper::cachedVistaState = QVistaHelper::Dirty;
/******************************************************************************
@@ -179,14 +85,6 @@ QSize QVistaBackButton::sizeHint() const
ensurePolished();
int size = int(QStyleHelper::dpiScaled(32));
int width = size, height = size;
-/*
- HANDLE theme = pOpenThemeData(0, L"Navigation");
- SIZE size;
- if (pGetThemePartSize(theme, 0, WIZ_NAV_BACKBUTTON, WIZ_NAV_BB_NORMAL, 0, TS_TRUE, &size) == S_OK) {
- width = size.cx;
- height = size.cy;
- }
-*/
return QSize(width, height);
}
@@ -208,7 +106,7 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
{
QPainter p(this);
QRect r = rect();
- HANDLE theme = pOpenThemeData(0, L"Navigation");
+ const HANDLE theme = OpenThemeData(0, L"Navigation");
//RECT rect;
QPoint origin;
const HDC hdc = QVistaHelper::backingStoreDC(parentWidget(), &origin);
@@ -225,19 +123,17 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
clipRect.left = rDp.left() + xoffsetDp;
clipRect.right = rDp.right() + xoffsetDp;
- int state = WIZ_NAV_BB_NORMAL;
+ int state = NAV_BB_NORMAL;
if (!isEnabled())
- state = WIZ_NAV_BB_DISABLED;
+ state = NAV_BB_DISABLED;
else if (isDown())
- state = WIZ_NAV_BB_PRESSED;
+ state = NAV_BB_PRESSED;
else if (underMouse())
- state = WIZ_NAV_BB_HOT;
-
- WIZ_NAVIGATIONPARTS buttonType = (layoutDirection() == Qt::LeftToRight
- ? WIZ_NAV_BACKBUTTON
- : WIZ_NAV_FORWARDBUTTON);
+ state = NAV_BB_HOT;
- pDrawThemeBackground(theme, hdc, buttonType, state, &clipRect, &clipRect);
+ DrawThemeBackground(theme, hdc,
+ layoutDirection() == Qt::LeftToRight ? NAV_BACKBUTTON : NAV_FORWARDBUTTON,
+ state, &clipRect, &clipRect);
}
/******************************************************************************
@@ -251,13 +147,10 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
, backButton_(0)
{
QVistaHelper::m_devicePixelRatio = wizard->devicePixelRatio();
- is_vista = resolveSymbols();
if (instanceCount++ == 0)
cachedVistaState = Dirty;
- if (is_vista) {
- backButton_ = new QVistaBackButton(wizard);
- backButton_->hide();
- }
+ backButton_ = new QVistaBackButton(wizard);
+ backButton_->hide();
// Handle diff between Windows 7 and Vista
iconSpacing = QStyleHelper::dpiScaled(7);
@@ -292,20 +185,13 @@ void QVistaHelper::updateCustomMargins(bool vistaMargins)
bool QVistaHelper::isCompositionEnabled()
{
- bool value = is_vista;
- if (is_vista) {
- HRESULT hr;
- BOOL bEnabled;
-
- hr = pDwmIsCompositionEnabled(&bEnabled);
- value = (SUCCEEDED(hr) && bEnabled);
- }
- return value;
+ BOOL bEnabled;
+ return SUCCEEDED(DwmIsCompositionEnabled(&bEnabled)) && bEnabled;
}
bool QVistaHelper::isThemeActive()
{
- return is_vista && pIsThemeActive();
+ return IsThemeActive();
}
QVistaHelper::VistaState QVistaHelper::vistaState()
@@ -326,11 +212,9 @@ QColor QVistaHelper::basicWindowFrameColor()
{
DWORD rgb;
HWND handle = QApplicationPrivate::getHWNDForWidget(QApplication::desktop());
- HANDLE hTheme = pOpenThemeData(handle, L"WINDOW");
- pGetThemeColor(
- hTheme, WIZ_WP_CAPTION, WIZ_CS_ACTIVE,
- wizard->isActiveWindow() ? WIZ_TMT_FILLCOLORHINT : WIZ_TMT_BORDERCOLORHINT,
- &rgb);
+ const HANDLE hTheme = OpenThemeData(handle, L"WINDOW");
+ GetThemeColor(hTheme, WP_CAPTION, CS_ACTIVE,
+ wizard->isActiveWindow() ? TMT_FILLCOLORHINT : TMT_BORDERCOLORHINT, &rgb);
BYTE r = GetRValue(rgb);
BYTE g = GetGValue(rgb);
BYTE b = GetBValue(rgb);
@@ -341,13 +225,13 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
{
bool value = false;
if (vistaState() == VistaAero) {
- WIZ_MARGINS mar = {0, 0, 0, 0};
+ MARGINS mar = {0, 0, 0, 0};
if (type == NormalTitleBar)
mar.cyTopHeight = 0;
else
mar.cyTopHeight = (titleBarSize() + topOffset()) * QVistaHelper::m_devicePixelRatio;
if (const HWND wizardHandle = wizardHWND())
- if (SUCCEEDED(pDwmExtendFrameIntoClientArea(wizardHandle, &mar)))
+ if (SUCCEEDED(DwmExtendFrameIntoClientArea(wizardHandle, &mar)))
value = true;
}
return value;
@@ -359,7 +243,7 @@ static LOGFONT getCaptionLogFont(HANDLE hTheme)
{
LOGFONT result = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } };
- if (!hTheme || FAILED(pGetThemeSysFont(hTheme, WIZ_TMT_CAPTIONFONT, &result))) {
+ if (!hTheme || FAILED(GetThemeSysFont(hTheme, TMT_CAPTIONFONT, &result))) {
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false);
@@ -370,10 +254,8 @@ static LOGFONT getCaptionLogFont(HANDLE hTheme)
static bool getCaptionQFont(int dpi, QFont *result)
{
- if (!pOpenThemeData)
- return false;
const HANDLE hTheme =
- pOpenThemeData(QApplicationPrivate::getHWNDForWidget(QApplication::desktop()), L"WINDOW");
+ OpenThemeData(QApplicationPrivate::getHWNDForWidget(QApplication::desktop()), L"WINDOW");
if (!hTheme)
return false;
// Call into QWindowsNativeInterface to convert the LOGFONT into a QFont.
@@ -448,16 +330,14 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible)
{
- if (is_vista) {
- WIZ_WTA_OPTIONS opt;
- opt.dwFlags = WIZ_WTNCA_NODRAWICON | WIZ_WTNCA_NODRAWCAPTION;
- if (visible)
- opt.dwMask = 0;
- else
- opt.dwMask = WIZ_WTNCA_NODRAWICON | WIZ_WTNCA_NODRAWCAPTION;
- if (const HWND handle = wizardHWND())
- pSetWindowThemeAttribute(handle, WIZ_WTA_NONCLIENT, &opt, sizeof(WIZ_WTA_OPTIONS));
- }
+ WTA_OPTIONS opt;
+ opt.dwFlags = WTNCA_NODRAWICON | WTNCA_NODRAWCAPTION;
+ if (visible)
+ opt.dwMask = 0;
+ else
+ opt.dwMask = WTNCA_NODRAWICON | WTNCA_NODRAWCAPTION;
+ if (const HWND handle = wizardHWND())
+ SetWindowThemeAttribute(handle, WTA_NONCLIENT, &opt, sizeof(WTA_OPTIONS));
}
bool QVistaHelper::winEvent(MSG* msg, long* result)
@@ -466,7 +346,7 @@ bool QVistaHelper::winEvent(MSG* msg, long* result)
case WM_NCHITTEST: {
LRESULT lResult;
// Perform hit testing using DWM
- if (pDwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult)) {
+ if (DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult)) {
// DWM returned a hit, no further processing necessary
*result = lResult;
} else {
@@ -485,7 +365,7 @@ bool QVistaHelper::winEvent(MSG* msg, long* result)
default:
LRESULT lResult;
// Pass to DWM to handle
- if (pDwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult))
+ if (DwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult))
*result = lResult;
// If the message wasn't handled by DWM, continue processing it as normal
else
@@ -524,7 +404,7 @@ void QVistaHelper::mouseEvent(QEvent *event)
bool QVistaHelper::handleWinEvent(MSG *message, long *result)
{
- if (message->message == WIZ_WM_THEMECHANGED || message->message == WIZ_WM_DWMCOMPOSITIONCHANGED)
+ if (message->message == WM_THEMECHANGED || message->message == WM_DWMCOMPOSITIONCHANGED)
cachedVistaState = Dirty;
bool status = false;
@@ -707,7 +587,7 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
const QRect rectDp = QRect(rect.topLeft() * QVistaHelper::m_devicePixelRatio,
rect.size() * QVistaHelper::m_devicePixelRatio);
HWND handle = QApplicationPrivate::getHWNDForWidget(QApplication::desktop());
- HANDLE hTheme = pOpenThemeData(handle, L"WINDOW");
+ const HANDLE hTheme = OpenThemeData(handle, L"WINDOW");
if (!hTheme) return false;
// Set up a memory DC and bitmap that we'll draw into
HDC dcMem;
@@ -732,15 +612,16 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont);
// Draw the text!
- WIZ_DTTOPTS dto;
- dto.dwSize = sizeof(WIZ_DTTOPTS);
- const UINT uFormat = WIZ_DT_SINGLELINE|WIZ_DT_CENTER|WIZ_DT_VCENTER|WIZ_DT_NOPREFIX;
+ DTTOPTS dto;
+ memset(&dto, 0, sizeof(dto));
+ dto.dwSize = sizeof(dto);
+ const UINT uFormat = DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX;
RECT rctext ={0,0, rectDp.width(), rectDp.height()};
- dto.dwFlags = WIZ_DTT_COMPOSITED|WIZ_DTT_GLOWSIZE;
+ dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = glowSize();
- pDrawThemeTextEx(hTheme, dcMem, 0, 0, (LPCWSTR)text.utf16(), -1, uFormat, &rctext, &dto );
+ DrawThemeTextEx(hTheme, dcMem, 0, 0, reinterpret_cast<LPCWSTR>(text.utf16()), -1, uFormat, &rctext, &dto );
BitBlt(hdc, rectDp.left(), rectDp.top(), rectDp.width(), rectDp.height(), dcMem, 0, 0, SRCCOPY);
SelectObject(dcMem, (HGDIOBJ) hOldBmp);
SelectObject(dcMem, (HGDIOBJ) hOldFont);
@@ -813,51 +694,6 @@ int QVistaHelper::captionSizeDp()
return GetSystemMetrics(SM_CYCAPTION);
}
-bool QVistaHelper::resolveSymbols()
-{
- static bool tried = false;
- if (!tried) {
- tried = true;
- QSystemLibrary dwmLib(L"dwmapi");
- pDwmIsCompositionEnabled =
- (PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
- if (pDwmIsCompositionEnabled) {
- pDwmDefWindowProc = (PtrDwmDefWindowProc)dwmLib.resolve("DwmDefWindowProc");
- pDwmExtendFrameIntoClientArea =
- (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea");
- }
- QSystemLibrary themeLib(L"uxtheme");
- pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed");
- if (pIsAppThemed) {
- pDrawThemeBackground = (PtrDrawThemeBackground)themeLib.resolve("DrawThemeBackground");
- pGetThemePartSize = (PtrGetThemePartSize)themeLib.resolve("GetThemePartSize");
- pGetThemeColor = (PtrGetThemeColor)themeLib.resolve("GetThemeColor");
- pIsThemeActive = (PtrIsThemeActive)themeLib.resolve("IsThemeActive");
- pOpenThemeData = (PtrOpenThemeData)themeLib.resolve("OpenThemeData");
- pCloseThemeData = (PtrCloseThemeData)themeLib.resolve("CloseThemeData");
- pGetThemeSysFont = (PtrGetThemeSysFont)themeLib.resolve("GetThemeSysFont");
- pDrawThemeTextEx = (PtrDrawThemeTextEx)themeLib.resolve("DrawThemeTextEx");
- pSetWindowThemeAttribute = (PtrSetWindowThemeAttribute)themeLib.resolve("SetWindowThemeAttribute");
- }
- }
-
- return (
- pDwmIsCompositionEnabled != 0
- && pDwmDefWindowProc != 0
- && pDwmExtendFrameIntoClientArea != 0
- && pIsAppThemed != 0
- && pDrawThemeBackground != 0
- && pGetThemePartSize != 0
- && pGetThemeColor != 0
- && pIsThemeActive != 0
- && pOpenThemeData != 0
- && pCloseThemeData != 0
- && pGetThemeSysFont != 0
- && pDrawThemeTextEx != 0
- && pSetWindowThemeAttribute != 0
- );
-}
-
int QVistaHelper::titleOffset()
{
int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing;
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index 42b4dee784..288e7adaf5 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include <QtCore/qglobal.h>
+#include <QtWidgets/private/qtwidgetsglobal_p.h>
#ifndef QT_NO_WIZARD
#ifndef QT_NO_STYLE_WINDOWSVISTA
@@ -126,7 +126,6 @@ private:
int leftMargin() { return backButton_->isVisible() ? backButtonSize() + iconSpacing : 0; }
int titleOffset();
- bool resolveSymbols();
void drawTitleBar(QPainter *painter);
void setMouseCursor(QPoint pos);
void collapseTopFrameStrut();
@@ -137,7 +136,6 @@ private:
bool eventFilter(QObject *obj, QEvent *event);
static int instanceCount;
- static bool is_vista;
static VistaState cachedVistaState;
static bool isCompositionEnabled();
static bool isThemeActive();