diff options
author | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2009-04-28 09:59:36 (GMT) |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@nokia.com> | 2009-04-29 06:33:55 (GMT) |
commit | 75868b9e64d541ec0ffcfa04fdcc5e36354f47e4 (patch) | |
tree | a33d8fc07e7911278070f37c1a00e42d53c7688a /src/gui/dialogs | |
parent | 68999af7823e80aa049c19f332045b1fb074fb96 (diff) | |
download | Qt-75868b9e64d541ec0ffcfa04fdcc5e36354f47e4.zip Qt-75868b9e64d541ec0ffcfa04fdcc5e36354f47e4.tar.gz Qt-75868b9e64d541ec0ffcfa04fdcc5e36354f47e4.tar.bz2 |
introduce Q_WS_WINCE
Task-number: 246130
Reviewed-by: joerg
Introduce Q_WS_WINCE for Windows CE only windowing parts. So far we
decided to stick with Q_WS_WIN32, but having a separate define
makes the code more readable. In addition Q_WS_WINCE_WM is available
for Windows Mobile only parts, where we do not check for the OS on
runtime.
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r-- | src/gui/dialogs/qcolordialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 18 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog.h | 4 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog_p.h | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qerrormessage.cpp | 8 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog_win.cpp | 10 | ||||
-rw-r--r-- | src/gui/dialogs/qfontdialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/dialogs/qmessagebox.cpp | 23 | ||||
-rw-r--r-- | src/gui/dialogs/qmessagebox.h | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qwizard.cpp | 4 |
11 files changed, 42 insertions, 45 deletions
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index 3aa04f6..e06d14a 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1066,7 +1066,7 @@ QColorShower::QColorShower(QColorDialog *parent) QGridLayout *gl = new QGridLayout(this); gl->setMargin(gl->spacing()); lab = new QColorShowLabel(this); -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE lab->setMinimumWidth(60); #else lab->setMinimumWidth(20); @@ -1369,7 +1369,7 @@ void QColorDialogPrivate::init(const QColor &initial) leftLay = 0; -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) smallDisplay = true; const int lumSpace = 20; #else @@ -1409,7 +1409,7 @@ void QColorDialogPrivate::init(const QColor &initial) leftLay->addWidget(lblBasicColors); leftLay->addWidget(standard); -#if !defined(Q_OS_WINCE) +#if !defined(Q_WS_WINCE) leftLay->addStretch(); #endif diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 14d8162..b3f3c5b 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -55,7 +55,7 @@ #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) #include "qt_windows.h" #include "qmenubar.h" #include "qpointer.h" @@ -251,7 +251,7 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f) : QWidget(*new QDialogPrivate, parent, f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0)) { -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (!qt_wince_is_smartphone()) setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint)); #endif @@ -280,7 +280,7 @@ QDialog::QDialog(QWidget *parent, const char *name, bool modal, Qt::WindowFlags QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) : QWidget(dd, parent, f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0)) { -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (!qt_wince_is_smartphone()) setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint)); #endif @@ -364,8 +364,8 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } -#ifdef Q_OS_WINCE -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE +#ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { //Done... @@ -473,7 +473,7 @@ int QDialog::exec() setResult(0); //On Windows Mobile we create an empty menu to hide the current menu -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE_WM #ifndef QT_NO_MENUBAR QMenuBar *menuBar = 0; if (!findChild<QMenuBar *>()) @@ -484,7 +484,7 @@ int QDialog::exec() connect(doneAction, SIGNAL(triggered()), this, SLOT(_q_doneAction())); } #endif //QT_NO_MENUBAR -#endif //Q_OS_WINCE_WM +#endif //Q_WS_WINCE_WM show(); @@ -505,12 +505,12 @@ int QDialog::exec() int res = result(); if (deleteOnClose) delete this; -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE_WM #ifndef QT_NO_MENUBAR else if (menuBar) delete menuBar; #endif //QT_NO_MENUBAR -#endif //Q_OS_WINCE_WM +#endif //Q_WS_WINCE_WM return res; } diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h index ee1997a..bd86251 100644 --- a/src/gui/dialogs/qdialog.h +++ b/src/gui/dialogs/qdialog.h @@ -107,7 +107,7 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE bool event(QEvent *e); #endif void keyPressEvent(QKeyEvent *); @@ -124,7 +124,7 @@ private: Q_DECLARE_PRIVATE(QDialog) Q_DISABLE_COPY(QDialog) -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE_WM Q_PRIVATE_SLOT(d_func(), void _q_doneAction()) #endif }; diff --git a/src/gui/dialogs/qdialog_p.h b/src/gui/dialogs/qdialog_p.h index 81a7b19..e4f551a 100644 --- a/src/gui/dialogs/qdialog_p.h +++ b/src/gui/dialogs/qdialog_p.h @@ -93,7 +93,7 @@ public: void hideDefault(); void resetModalitySetByOpen(); -#ifdef Q_OS_WINCE_WM +#ifdef Q_WS_WINCE_WM void _q_doneAction(); #endif diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp index f79c6b2..ca39d31 100644 --- a/src/gui/dialogs/qerrormessage.cpp +++ b/src/gui/dialogs/qerrormessage.cpp @@ -61,7 +61,7 @@ #include <stdio.h> #include <stdlib.h> -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp @@ -100,7 +100,7 @@ public: QSize QErrorMessageTextView::minimumSizeHint() const { -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (qt_wince_is_mobile()) if (qt_wince_is_high_dpi()) return QSize(200, 200); @@ -115,7 +115,7 @@ QSize QErrorMessageTextView::minimumSizeHint() const QSize QErrorMessageTextView::sizeHint() const { -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (qt_wince_is_mobile()) if (qt_wince_is_high_dpi()) return QSize(400, 200); @@ -240,7 +240,7 @@ QErrorMessage::QErrorMessage(QWidget * parent) d->again->setChecked(true); grid->addWidget(d->again, 1, 1, Qt::AlignTop); d->ok = new QPushButton(this); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE d->ok->setFixedSize(0,0); #endif connect(d->ok, SIGNAL(clicked()), this, SLOT(accept())); diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 2f524cb..044aa43 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -58,7 +58,7 @@ #include <qdebug.h> #include <qapplication.h> #include <qstylepainter.h> -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE #include "ui_qfiledialog.h" #else #include "ui_qfiledialog_wince.h" @@ -1861,7 +1861,7 @@ QString QFileDialog::getExistingDirectory(QWidget *parent, #if defined(Q_WS_WIN) if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog) && (options & ShowDirsOnly) -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) && qt_priv_ptr_valid #endif ) { @@ -2075,7 +2075,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte q->restoreState(settings.value(QLatin1String("filedialog")).toByteArray()); #endif -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE qFileDialogUi->lookInLabel->setVisible(false); qFileDialogUi->fileNameLabel->setVisible(false); qFileDialogUi->fileTypeLabel->setVisible(false); diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 8431488..6962674 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -60,7 +60,7 @@ #include <shlobj.h> -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE #include <commdlg.h> # ifndef BFFM_SETSELECTION # define BFFM_SETSELECTION (WM_USER + 102) @@ -112,7 +112,7 @@ static void qt_win_resolve_libs() triedResolve = true; if (!(QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based)) { -#if !defined(Q_OS_WINCE) +#if !defined(Q_WS_WINCE) QLibrary lib(QLatin1String("shell32")); ptrSHBrowseForFolder = (PtrSHBrowseForFolder) lib.resolve("SHBrowseForFolderW"); ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList) lib.resolve("SHGetPathFromIDListW"); @@ -186,7 +186,7 @@ static QString qt_win_selected_filter(const QString &filter, DWORD idx) return qt_win_make_filters_list(filter).at((int)idx - 1); } -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE // Static vars for OFNA funcs: static QByteArray aInitDir; static QByteArray aInitSel; @@ -505,7 +505,7 @@ QString qt_win_get_save_file_name(const QFileDialogArgs &args, } qt_win_clean_up_OFNA(&ofn); }); -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) int semIndex = result.indexOf(QLatin1Char(';')); if (semIndex >= 0) result = result.left(semIndex); @@ -700,7 +700,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) modal_widget.setAttribute(Qt::WA_NoChildEventsForParent, true); modal_widget.setParent(parent, Qt::Window); QApplicationPrivate::enterModal(&modal_widget); -#if !defined(Q_OS_WINCE) +#if !defined(Q_WS_WINCE) QT_WA({ qt_win_resolve_libs(); QString initDir = QDir::toNativeSeparators(args.directory); diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index 4c5bf4f..d8a2c7c 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -311,11 +311,11 @@ void QFontDialogPrivate::init() buttonBox->addButton(QDialogButtonBox::Cancel); QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject())); -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) q->resize(180, 120); #else q->resize(500, 360); -#endif // Q_OS_WINCE +#endif // Q_WS_WINCE sizeEdit->installEventFilter(q); familyList->installEventFilter(q); diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 5e59501..3b622b7 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -63,7 +63,7 @@ #include <QtGui/qfontmetrics.h> #include <QtGui/qclipboard.h> -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp extern bool qt_wince_is_smartphone();//defined in qguifunctions_wince.cpp extern bool qt_wince_is_pocket_pc(); //defined in qguifunctions_wince.cpp @@ -152,7 +152,7 @@ public: int layoutMinimumWidth(); void retranslateStrings(); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE void hideSpecial(); #endif @@ -272,10 +272,7 @@ void QMessageBoxPrivate::updateSize() return; QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); -#ifdef Q_WS_QWS - // the width of the screen, less the window border. - int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width()); -#elif defined(Q_OS_WINCE) +#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) // the width of the screen, less the window border. int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width()); #else @@ -290,11 +287,11 @@ void QMessageBoxPrivate::updateSize() int softLimit = qMin(hardLimit, 500); #else // note: ideally on windows, hard and soft limits but it breaks compat -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE int softLimit = qMin(screenSize.width()/2, 500); #else int softLimit = qMin(screenSize.width() * 3 / 4, 500); -#endif //Q_OS_WINCE +#endif //Q_WS_WINCE #endif if (informativeLabel) @@ -351,7 +348,7 @@ void QMessageBoxPrivate::updateSize() } -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE /*! \internal Hides special buttons which are rather shown in the title bar @@ -1213,7 +1210,7 @@ bool QMessageBox::event(QEvent *e) case QEvent::LanguageChange: d_func()->retranslateStrings(); break; -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE case QEvent::OkRequest: case QEvent::HelpRequest: { QString bName = @@ -1356,7 +1353,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) QDialog::keyPressEvent(e); } -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE /*! \reimp */ @@ -1425,7 +1422,7 @@ void QMessageBox::showEvent(QShowEvent *e) Q_D(QMessageBox); if (d->autoAddOkButton) { addButton(Ok); -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) d->hideSpecial(); #endif } @@ -1733,7 +1730,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title) QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png")); if (!pm.isNull()) msgBox->setIconPixmap(pm); -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) msgBox->setDefaultButton(msgBox->addButton(QMessageBox::Ok)); #endif diff --git a/src/gui/dialogs/qmessagebox.h b/src/gui/dialogs/qmessagebox.h index e1667d6..8d9b9fa 100644 --- a/src/gui/dialogs/qmessagebox.h +++ b/src/gui/dialogs/qmessagebox.h @@ -145,7 +145,7 @@ public: QPushButton *addButton(StandardButton button); void removeButton(QAbstractButton *button); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE void setVisible(bool visible); #endif diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 32395c4..6f2ab0a 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -69,7 +69,7 @@ #include "private/qdialog_p.h" #include <qdebug.h> -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp #endif @@ -2120,7 +2120,7 @@ QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags) { Q_D(QWizard); d->init(); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (!qt_wince_is_mobile()) setWindowFlags(windowFlags() & ~Qt::WindowOkButtonHint); #endif |