OSDN Git Service

mostly wince leftovers removal
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 18 Sep 2016 23:41:08 +0000 (23:41 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 18 Sep 2016 23:41:08 +0000 (23:41 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
34 files changed:
.travis.yml
src/gui/dialogs/qcolordialog.h
src/gui/dialogs/qdialog.cpp
src/gui/dialogs/qdialog.h
src/gui/dialogs/qdialog_p.h
src/gui/dialogs/qerrormessage.cpp
src/gui/dialogs/qfiledialog.cpp
src/gui/dialogs/qfiledialog_p.h
src/gui/dialogs/qfilesystemmodel_p.h
src/gui/dialogs/qmessagebox.cpp
src/gui/dialogs/qmessagebox.h
src/gui/dialogs/qpagesetupdialog.h
src/gui/dialogs/qprintdialog.h
src/gui/graphicsview/qgraphicsitem.h
src/gui/graphicsview/qgraphicswidget.cpp
src/gui/graphicsview/qgraphicswidget.h
src/gui/image/qpixmap.cpp
src/gui/image/qpnghandler.cpp
src/gui/itemviews/qdirmodel.h
src/gui/itemviews/qfileiconprovider.cpp
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget.h
src/gui/painting/qpaintengine_raster.cpp
src/gui/painting/qpaintengine_raster_p.h
src/gui/painting/qpainterpath.cpp
src/gui/text/qtextengine_p.h
src/gui/widgets/qeffects.cpp
src/gui/widgets/qmenu.cpp
src/gui/widgets/qmenu.h
src/gui/widgets/qmenu_p.h
src/gui/widgets/qmenubar.cpp
src/gui/widgets/qmenubar.h
src/gui/widgets/qmenubar_p.h
src/gui/widgets/qtoolbar.cpp

index 8468179..f076ed5 100644 (file)
@@ -17,8 +17,8 @@ before_script:
     - sh -e /etc/init.d/xvfb start
     - sleep 3
 script:
-    - if [ "$CXX" = "clang++" ];then cmake -DENABLE_TESTING=TRUE -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
-    - if [ "$CXX" = "g++" ];then cmake -DENABLE_TESTING=TRUE -DKATIE_ALLINONE=ON -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
+    - if [ "$CXX" == "clang++" ];then cmake -DENABLE_TESTING=TRUE -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
+    - if [ "$CXX" == "g++" ];then cmake -DENABLE_TESTING=TRUE -DKATIE_ALLINONE=ON -Wno-dev -DMYSQL_LIBRARIES:STRING="-lmysqld -lcrypt -laio" ;fi
     - make
 # the tests/benchmarks take more then 1-hour and Travis times out
 #    - ctest -V
index 4eecfbd..0b9308f 100644 (file)
@@ -123,9 +123,6 @@ private:
     Q_PRIVATE_SLOT(d_func(), void _q_newColorTypedIn(QRgb rgb))
     Q_PRIVATE_SLOT(d_func(), void _q_newCustom(int, int))
     Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int))
-#if defined(Q_WS_MAC)
-    Q_PRIVATE_SLOT(d_func(), void _q_macRunNativeAppModalPanel())
-#endif
 
     friend class QColorShower;
 };
index 9957954..0f265b7 100644 (file)
 #ifndef QT_NO_ACCESSIBILITY
 #include "qaccessible.h"
 #endif
-#if defined(Q_WS_WINCE)
-#include "qt_windows.h"
-#include "qmenubar.h"
-#include "qpointer.h"
-#include "qguifunctions_wince.h"
-extern bool qt_wince_is_mobile();     //defined in qguifunctions_wce.cpp
-extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
-#elif defined(Q_WS_X11)
+#if defined(Q_WS_X11)
 #  include "../kernel/qt_x11_p.h"
-#elif defined(Q_OS_BLACKBERRY)
-#   include "qmessagebox.h"
 #endif
 
 
@@ -254,11 +245,6 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f)
     : QWidget(*new QDialogPrivate, parent,
               f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0)))
 {
-#ifdef Q_WS_WINCE
-    if (!qt_wince_is_smartphone())
-        setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
-#endif
-
 }
 
 
@@ -269,11 +255,6 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f)
 QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
     : QWidget(dd, parent, f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0)))
 {
-#ifdef Q_WS_WINCE
-    if (!qt_wince_is_smartphone())
-        setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint));
-#endif
-
 }
 
 /*!
@@ -350,39 +331,10 @@ void QDialogPrivate::resetModalitySetByOpen()
         // open() changed the window modality and the user didn't touch it afterwards; restore it
         q->setWindowModality(Qt::WindowModality(resetModalityTo));
         q->setAttribute(Qt::WA_SetWindowModality, wasModalitySet);
-#ifdef Q_WS_MAC
-        Q_ASSERT(resetModalityTo != Qt::WindowModal);
-        q->setParent(q->parentWidget(), Qt::Dialog);
-#endif
     }
     resetModalityTo = -1;
 }
 
-#if defined(Q_WS_WINCE)
-#ifdef Q_WS_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_WS_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.
 
@@ -429,9 +381,6 @@ void QDialog::open()
         d->wasModalitySet = testAttribute(Qt::WA_SetWindowModality);
         setWindowModality(Qt::WindowModal);
         setAttribute(Qt::WA_SetWindowModality, false);
-#ifdef Q_WS_MAC
-        setParent(parentWidget(), Qt::Sheet);
-#endif
     }
 
     setResult(0);
@@ -470,38 +419,8 @@ int QDialog::exec()
     setAttribute(Qt::WA_ShowModal, true);
     setResult(0);
 
-//On Windows Mobile we create an empty menu to hide the current menu
-#ifdef Q_WS_WINCE_WM
-#ifndef QT_NO_MENUBAR
-    QMenuBar *menuBar = 0;
-    if (!findChild<QMenuBar *>())
-        menuBar = new QMenuBar(this);
-    if (qt_wince_is_smartphone()) {
-        QAction *doneAction = new QAction(tr("Done"), this);
-        menuBar->setDefaultAction(doneAction);
-        connect(doneAction, SIGNAL(triggered()), this, SLOT(_q_doneAction()));
-    }
-#endif //QT_NO_MENUBAR
-#endif //Q_WS_WINCE_WM
-
-    bool showSystemDialogFullScreen = false;
-
-
-#ifdef Q_OS_BLACKBERRY
-    if (!qobject_cast<QMessageBox *>(this))
-        showSystemDialogFullScreen = true;
-#endif // Q_OS_BLACKBERRY
-
-    if (showSystemDialogFullScreen) {
-        setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint);
-        setWindowState(Qt::WindowFullScreen);
-    }
     show();
 
-#ifdef Q_WS_MAC
-    d->mac_nativeDialogModalHelp();
-#endif
-
     QEventLoop eventLoop;
     d->eventLoop = &eventLoop;
     QPointer<QDialog> guard = this;
@@ -515,12 +434,6 @@ int QDialog::exec()
     int res = result();
     if (deleteOnClose)
         delete this;
-#ifdef Q_WS_WINCE_WM
-#ifndef QT_NO_MENUBAR
-    else if (menuBar)
-        delete menuBar;
-#endif //QT_NO_MENUBAR
-#endif //Q_WS_WINCE_WM
     return res;
 }
 
@@ -622,11 +535,6 @@ void QDialog::keyPressEvent(QKeyEvent *e)
     //   Calls reject() if Escape is pressed. Simulates a button
     //   click for the default button if Enter is pressed. Move focus
     //   for the arrow keys. Ignore the rest.
-#ifdef Q_WS_MAC
-    if(e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period) {
-        reject();
-    } else
-#endif
     if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
         switch (e->key()) {
         case Qt::Key_Enter:
@@ -748,15 +656,6 @@ void QDialog::setVisible(bool visible)
         if (d->eventLoop)
             d->eventLoop->exit();
     }
-#ifdef Q_WS_WIN
-    if (d->mainDef && isActiveWindow()) {
-        BOOL snapToDefault = false;
-        if (SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &snapToDefault, 0)) {
-            if (snapToDefault)
-                QCursor::setPos(d->mainDef->mapToGlobal(d->mainDef->rect().center()));
-        }
-    }
-#endif
 }
 
 /*!\reimp */
index e1d7e45..1630738 100644 (file)
@@ -102,9 +102,6 @@ public Q_SLOTS:
 protected:
     QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0);
 
-#if defined(Q_WS_WINCE)
-    bool event(QEvent *e);
-#endif
     void keyPressEvent(QKeyEvent *);
     void closeEvent(QCloseEvent *);
     void showEvent(QShowEvent *);
@@ -117,11 +114,6 @@ protected:
 private:
     Q_DECLARE_PRIVATE(QDialog)
     Q_DISABLE_COPY(QDialog)
-
-
-#ifdef Q_WS_WINCE_WM
-    Q_PRIVATE_SLOT(d_func(), void _q_doneAction())
-#endif
 };
 
 QT_END_NAMESPACE
index 3b54d73..2db34a0 100644 (file)
@@ -93,14 +93,6 @@ public:
     void hideDefault();
     void resetModalitySetByOpen();
 
-#ifdef Q_WS_WINCE_WM
-    void _q_doneAction();
-#endif
-
-#ifdef Q_WS_MAC
-    virtual void mac_nativeDialogModalHelp() {}
-#endif
-
     int rescode;
     int resetModalityTo;
     bool wasModalitySet;
index 507e2a8..a199be5 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#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
-
-#include "qguifunctions_wince.h"
-#endif
-
-
 QT_BEGIN_NAMESPACE
 
 class QErrorMessagePrivate : public QDialogPrivate
@@ -101,33 +93,12 @@ public:
 
 QSize QErrorMessageTextView::minimumSizeHint() const
 {
-#ifdef Q_WS_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_WS_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_WS_WINCE
 }
 
 /*!
@@ -244,9 +215,6 @@ QErrorMessage::QErrorMessage(QWidget * parent)
     grid->addWidget(d->again, 1, preferredTextColumn, Qt::AlignTop);
     d->ok = new QPushButton(this);
 
-#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
-    d->ok->setFixedSize(0,0);
-#endif
     connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
     d->ok->setFocus();
     grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
index 7a07fc9..1e9ef29 100644 (file)
@@ -956,7 +956,7 @@ QStringList QFileDialogPrivate::addDefaultSuffixToFiles(const QStringList filesT
 {
     QStringList files;
     for (int i=0; i<filesToFix.size(); ++i) {
-        QString name = toInternal(filesToFix.at(i));
+        QString name = filesToFix.at(i);
         QFileInfo info(name);
         // if the filename has no suffix, add the default suffix
         if (!defaultSuffix.isEmpty() && !info.isDir() && name.lastIndexOf(QLatin1Char('.')) == -1)
@@ -1962,16 +1962,6 @@ QString QFileDialog::getExistingDirectory(QWidget *parent,
     args.mode = (options & ShowDirsOnly ? DirectoryOnly : Directory);
     args.options = options;
 
-#if defined(Q_WS_WIN)
-    if (qt_use_native_dialogs && !(args.options & DontUseNativeDialog) && (options & ShowDirsOnly)
-#if defined(Q_WS_WINCE)
-        && qt_priv_ptr_valid
-#endif
-        ) {
-        return qt_win_get_existing_directory(args);
-    }
-#endif
-
     // create a qt dialog
     QFileDialog dialog(args);
     if (dialog.exec() == QDialog::Accepted) {
index e036515..96ac4a2 100644 (file)
@@ -140,23 +140,7 @@ public:
     QLineEdit *lineEdit() const;
 
     int maxNameLength(const QString &path) {
-#if defined(Q_OS_UNIX)
         return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
-#elif defined(Q_OS_WIN)
-#ifndef Q_OS_WINCE
-        DWORD maxLength;
-        QString drive = path.left(3);
-        if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
-            return -1;
-        return maxLength;
-#else
-        Q_UNUSED(path);
-        return MAX_PATH;
-#endif //Q_OS_WINCE
-#else
-        Q_UNUSED(path);
-#endif
-        return -1;
     }
 
     QString basename(const QString &path) const
@@ -180,22 +164,6 @@ public:
 
     QAbstractItemView *currentView() const;
 
-    static inline QString toInternal(const QString &path)
-    {
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
-        QString n(path);
-        for (int i = 0; i < (int)n.length(); ++i)
-            if (n[i] == QLatin1Char('\\')) n[i] = 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;
-#endif
-    }
-
     void setLastVisitedDirectory(const QString &dir);
     void retranslateWindowTitle();
     void retranslateStrings();
index 5a0a529..d3dcaa3 100644 (file)
@@ -97,9 +97,6 @@ public:
         }
 
         QString fileName;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
-        QString volumeName;
-#endif
 
         inline qint64 size() const { if (info && !info->isDir()) return info->size(); return 0; }
         inline QString type() const { if (info) return info->displayType; return QLatin1String(""); }
index 532061a..b8189f3 100644 (file)
 #include <QtGui/qfontmetrics.h>
 #include <QtGui/qclipboard.h>
 
-#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
-
-#include "qguifunctions_wince.h"
-#endif
-
 QT_BEGIN_NAMESPACE
 
 enum DetailButtonLabel { ShowLabel = 0, HideLabel = 1 };
@@ -176,10 +168,6 @@ public:
     int layoutMinimumWidth();
     void retranslateStrings();
 
-#ifdef Q_WS_WINCE
-    void hideSpecial();
-#endif
-
     static QMessageBox::StandardButton showNewMessageBox(QWidget *parent,
                 QMessageBox::Icon icon, const QString& title, const QString& text,
                 QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton);
@@ -218,12 +206,8 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
     label->setTextInteractionFlags(Qt::TextInteractionFlags(q->style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, 0, q)));
     label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
     label->setOpenExternalLinks(true);
-#if defined(Q_WS_MAC)
-    label->setContentsMargins(16, 0, 0, 0);
-#else
     label->setContentsMargins(2, 0, 0, 0);
     label->setIndent(9);
-#endif
     icon = QMessageBox::NoIcon;
     iconLabel = new QLabel;
     iconLabel->setObjectName(QLatin1String("qt_msgboxex_icon_label"));
@@ -236,25 +220,12 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
                      q, SLOT(_q_buttonClicked(QAbstractButton*)));
 
     QGridLayout *grid = new QGridLayout;
-#ifndef Q_WS_MAC
     const int preferredIconColumn = 0;
     const int preferredTextColumn = 1;
     grid->addWidget(iconLabel, 0, preferredIconColumn, 2, 1, Qt::AlignTop);
     grid->addWidget(label, 0, preferredTextColumn, 1, 1);
     // -- leave space for information label --
     grid->addWidget(buttonBox, 2, 0, 1, 2);
-#else
-    grid->setMargin(0);
-    grid->setVerticalSpacing(8);
-    grid->setHorizontalSpacing(0);
-    q->setContentsMargins(24, 15, 24, 20);
-    grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop | Qt::AlignLeft);
-    grid->addWidget(label, 0, 1, 1, 1);
-    // -- leave space for information label --
-    grid->setRowStretch(1, 100);
-    grid->setRowMinimumHeight(2, 6);
-    grid->addWidget(buttonBox, 3, 1, 1, 1);
-#endif
 
     grid->setSizeConstraint(QLayout::SetNoConstraint);
     q->setLayout(grid);
@@ -265,11 +236,6 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
     }
     q->setModal(true);
 
-#ifdef Q_WS_MAC
-    QFont f = q->font();
-    f.setBold(true);
-    label->setFont(f);
-#endif
     retranslateStrings();
 }
 
@@ -286,26 +252,12 @@ void QMessageBoxPrivate::updateSize()
     if (!q->isVisible())
         return;
 
-    QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
-#if defined(Q_WS_WINCE)
-    // the width of the screen, less the window border.
-    int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
-#else
+    const QSize screenSize = QApplication::desktop()->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)
         hardLimit = screenSize.width();
-#endif
-#ifdef Q_WS_MAC
-    int softLimit = qMin(screenSize.width()/2, 420);
-#else
-    // note: ideally on windows, hard and soft limits but it breaks compat
-#ifndef Q_WS_WINCE
-    int softLimit = qMin(screenSize.width()/2, 500);
-#else
-    int softLimit = qMin(screenSize.width() * 3 / 4, 500);
-#endif //Q_WS_WINCE
-#endif
+    const int softLimit = qMin(screenSize.width()/2, 500);
 
     if (informativeLabel)
         informativeLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
@@ -361,28 +313,6 @@ void QMessageBoxPrivate::updateSize()
     QCoreApplication::removePostedEvents(q, QEvent::LayoutRequest);
 }
 
-
-#ifdef Q_WS_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
-
 int QMessageBoxPrivate::execReturnCode(QAbstractButton *button)
 {
     int ret = buttonBox->standardButton(button);
@@ -1189,24 +1119,6 @@ bool QMessageBox::event(QEvent *e)
         case QEvent::LanguageChange:
             d_func()->retranslateStrings();
             break;
-#ifdef Q_WS_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;
     }
@@ -1216,14 +1128,6 @@ bool QMessageBox::event(QEvent *e)
 /*!
     \reimp
 */
-void QMessageBox::resizeEvent(QResizeEvent *event)
-{
-    QDialog::resizeEvent(event);
-}
-
-/*!
-    \reimp
-*/
 void QMessageBox::closeEvent(QCloseEvent *e)
 {
     Q_D(QMessageBox);
@@ -1256,13 +1160,6 @@ void QMessageBox::changeEvent(QEvent *ev)
     }
     case QEvent::FontChange:
     case QEvent::ApplicationFontChange:
-#ifdef Q_WS_MAC
-    {
-        QFont f = font();
-        f.setBold(true);
-        d->label->setFont(f);
-    }
-#endif
     default:
         break;
     }
@@ -1275,43 +1172,12 @@ void QMessageBox::changeEvent(QEvent *ev)
 void QMessageBox::keyPressEvent(QKeyEvent *e)
 {
     Q_D(QMessageBox);
-    if (e->key() == Qt::Key_Escape
-#ifdef Q_WS_MAC
-        || (e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period)
-#endif
-        ) {
-            if (d->detectedEscapeButton) {
-#ifdef Q_WS_MAC
-                d->detectedEscapeButton->animateClick();
-#else
-                d->detectedEscapeButton->click();
-#endif
-            }
-            return;
-        }
-
-#if defined (Q_OS_WIN) && !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
-        if (e == QKeySequence::Copy) {
-            QString separator = QString::fromLatin1("---------------------------\n");
-            QString textToCopy = separator;
-            separator.prepend(QLatin1Char('\n'));
-            textToCopy += windowTitle() + separator; // title
-            textToCopy += d->label->text() + separator; // text
-
-            if (d->informativeLabel)
-                textToCopy += d->informativeLabel->text() + separator;
-
-            QString buttonTexts;
-            QList<QAbstractButton *> buttons = d->buttonBox->buttons();
-            for (int i = 0; i < buttons.count(); i++) {
-                buttonTexts += buttons[i]->text() + QLatin1String("   ");
-            }
-            textToCopy += buttonTexts + separator;
-
-            QApplication::clipboard()->setText(textToCopy);
-            return;
+    if (e->key() == Qt::Key_Escape) {
+        if (d->detectedEscapeButton) {
+            d->detectedEscapeButton->click();
         }
-#endif //QT_NO_SHORTCUT QT_NO_CLIPBOARD Q_OS_WIN
+        return;
+    }
 
 #ifndef QT_NO_SHORTCUT
     if (!(e->modifiers() & Qt::AltModifier)) {
@@ -1332,20 +1198,6 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
     QDialog::keyPressEvent(e);
 }
 
-#ifdef Q_WS_WINCE
-/*!
-    \reimp
-*/
-void QMessageBox::setVisible(bool visible)
-{
-    Q_D(QMessageBox);
-    if (visible)
-        d->hideSpecial();
-    QDialog::setVisible(visible);
-}
-#endif
-
-
 /*!
     \overload
 
@@ -1403,9 +1255,6 @@ void QMessageBox::showEvent(QShowEvent *e)
     Q_D(QMessageBox);
     if (d->autoAddOkButton) {
         addButton(Ok);
-#if defined(Q_WS_WINCE)
-        d->hideSpecial();
-#endif
     }
     if (d->detailsButton)
         addButton(d->detailsButton, QMessageBox::ActionRole);
@@ -1415,15 +1264,6 @@ void QMessageBox::showEvent(QShowEvent *e)
 #ifndef QT_NO_ACCESSIBILITY
     QAccessible::updateAccessibility(this, 0, QAccessible::Alert);
 #endif
-#ifdef Q_WS_WIN
-    HMENU systemMenu = GetSystemMenu((HWND)winId(), FALSE);
-    if (!d->detectedEscapeButton) {
-        EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED);
-    }
-    else {
-        EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED);
-    }
-#endif
     QDialog::showEvent(e);
 }
 
@@ -1610,40 +1450,13 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString
 */
 void QMessageBox::about(QWidget *parent, const QString &title, const QString &text)
 {
-#ifdef Q_WS_MAC
-    static QPointer<QMessageBox> oldMsgBox;
-
-    if (oldMsgBox && oldMsgBox->text() == text) {
-        oldMsgBox->show();
-        oldMsgBox->raise();
-        oldMsgBox->activateWindow();
-        return;
-    }
-#endif
-
-    QMessageBox *msgBox = new QMessageBox(Information, title, text, 0, parent
-#ifdef Q_WS_MAC
-                                          , Qt::WindowTitleHint | Qt::WindowSystemMenuHint
-#endif
-    );
+    QMessageBox *msgBox = new QMessageBox(Information, title, text, 0, parent);
     msgBox->setAttribute(Qt::WA_DeleteOnClose);
     QIcon icon = msgBox->windowIcon();
     QSize size = icon.actualSize(QSize(64, 64));
     msgBox->setIconPixmap(icon.pixmap(size));
 
-    // should perhaps be a style hint
-#ifdef Q_WS_MAC
-    oldMsgBox = msgBox;
-#if 0
-    // ### doesn't work until close button is enabled in title bar
-    msgBox->d_func()->autoAddOkButton = false;
-#else
-    msgBox->d_func()->buttonBox->setCenterButtons(true);
-#endif
-    msgBox->show();
-#else
     msgBox->exec();
-#endif
 }
 
 /*!
@@ -1663,17 +1476,6 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
 */
 void QMessageBox::aboutQt(QWidget *parent, const QString &title)
 {
-#ifdef Q_WS_MAC
-    static QPointer<QMessageBox> oldMsgBox;
-
-    if (oldMsgBox) {
-        oldMsgBox->show();
-        oldMsgBox->raise();
-        oldMsgBox->activateWindow();
-        return;
-    }
-#endif
-
     QString translatedTextAboutQtCaption;
     translatedTextAboutQtCaption = QMessageBox::tr(
         "<h3>About Qt</h3>"
@@ -1717,23 +1519,8 @@ 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_WS_WINCE)
-    msgBox->setDefaultButton(msgBox->addButton(QMessageBox::Ok));
-#endif
 
-    // should perhaps be a style hint
-#ifdef Q_WS_MAC
-    oldMsgBox = msgBox;
-#if 0
-    // ### doesn't work until close button is enabled in title bar
-    msgBox->d_func()->autoAddOkButton = false;
-#else
-    msgBox->d_func()->buttonBox->setCenterButtons(true);
-#endif
-    msgBox->show();
-#else
     msgBox->exec();
-#endif
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -1820,9 +1607,7 @@ void QMessageBox::setInformativeText(const QString &text)
         layout()->removeWidget(d->informativeLabel);
         delete d->informativeLabel;
         d->informativeLabel = 0;
-#ifndef Q_WS_MAC
         d->label->setContentsMargins(2, 0, 0, 0);
-#endif
         d->updateSize();
         return;
     }
@@ -1834,62 +1619,22 @@ void QMessageBox::setInformativeText(const QString &text)
         label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
         label->setOpenExternalLinks(true);
         label->setWordWrap(true);
-#ifndef Q_WS_MAC
         d->label->setContentsMargins(2, 0, 0, 0);
         label->setContentsMargins(2, 0, 0, 6);
         label->setIndent(9);
-#else
-        label->setContentsMargins(16, 0, 0, 0);
-        // apply a smaller font the information label on the mac
-        label->setFont(qt_app_fonts_hash()->value("QTipLabel"));
-#endif
         label->setWordWrap(true);
         QGridLayout *grid = static_cast<QGridLayout *>(layout());
-#if defined(Q_WS_MAEMO_5)
-        label->hide();
-        QTextBrowser *textBrowser = new QTextBrowser(this);
-        textBrowser->setOpenExternalLinks(true);
-        const int preferredTextColumn = 1;
-        grid->addWidget(textBrowser, 1, preferredTextColumn, 1, 1);
-        d->textBrowser = textBrowser;
-#else
         grid->addWidget(label, 1, 1, 1, 1);
-#endif
         d->informativeLabel = label;
     }
     d->informativeLabel->setText(text);
 
-#if defined(Q_WS_MAEMO_5)
-    //We need to put the informative label inside textBrowser to enable scrolling of long texts.
-    d->textBrowser->setText(d->informativeLabel->text());
-#endif
-
     d->updateSize();
 }
 
 /*!
     \since 4.2
 
-    This function shadows QWidget::setWindowTitle().
-
-    Sets the title of the message box to \a title. On Mac OS X,
-    the window title is ignored (as required by the Mac OS X
-    Guidelines).
-*/
-void QMessageBox::setWindowTitle(const QString &title)
-{
-    // Message boxes on the mac do not have a title
-#ifndef Q_WS_MAC
-    QDialog::setWindowTitle(title);
-#else
-    Q_UNUSED(title);
-#endif
-}
-
-
-/*!
-    \since 4.2
-
     This function shadows QWidget::setWindowModality().
 
     Sets the modality of the message box to \a windowModality.
index 550fcb6..6494746 100644 (file)
@@ -140,10 +140,6 @@ public:
     QPushButton *addButton(StandardButton button);
     void removeButton(QAbstractButton *button);
 
-#ifdef Q_WS_WINCE
-    void setVisible(bool visible);
-#endif
-
 #ifdef Q_NO_USING_KEYWORD
     void open() { QDialog::open(); }
 #else
@@ -206,7 +202,6 @@ public:
     void setDetailedText(const QString &text);
 #endif
 
-    void setWindowTitle(const QString &title);
     void setWindowModality(Qt::WindowModality windowModality);
 
     static QPixmap standardIcon(Icon icon);
@@ -216,7 +211,6 @@ Q_SIGNALS:
 
 protected:
     bool event(QEvent *e);
-    void resizeEvent(QResizeEvent *event);
     void showEvent(QShowEvent *event);
     void closeEvent(QCloseEvent *event);
     void keyPressEvent(QKeyEvent *event);
index 2d0ba35..87ab329 100644 (file)
@@ -83,9 +83,6 @@ public:
     void setOptions(PageSetupDialogOptions options);
     PageSetupDialogOptions options() const;
 
-#if defined(Q_WS_MAC) || defined(Q_OS_WIN)
-    virtual void setVisible(bool visible);
-#endif
     virtual int exec();
 
 #ifdef Q_NO_USING_KEYWORD
index 8cfa2a3..b42ed5d 100644 (file)
@@ -67,9 +67,7 @@ public:
     ~QPrintDialog();
 
     int exec();
-#if defined (Q_OS_UNIX)
     virtual void accept();
-#endif
     void done(int result);
 
 
@@ -78,9 +76,7 @@ public:
     void setOptions(PrintDialogOptions options);
     PrintDialogOptions options() const;
 
-#if defined(Q_OS_UNIX)
     void setVisible(bool visible);
-#endif
 
 #ifdef Q_NO_USING_KEYWORD
     void open() { QDialog::open(); }
@@ -100,12 +96,10 @@ Q_SIGNALS:
 
 private:
     Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool))
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
     Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
-#endif
-# if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_MESSAGEBOX)
+#if !defined(QT_NO_MESSAGEBOX)
     Q_PRIVATE_SLOT(d_func(), void _q_checkFields())
-# endif
+#endif
     friend class QUnixPrintWidget;
 };
 
index e8265ac..0a8ff4e 100644 (file)
@@ -559,13 +559,6 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
 public:
     QGraphicsObject(QGraphicsItem *parent = 0);
 
-    // ### Qt 5: Disambiguate
-#ifdef Q_NO_USING_KEYWORD
-    const QObjectList &children() const { return QObject::children(); }
-#else
-    using QObject::children;
-#endif
-
 #ifndef QT_NO_GESTURES
     void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
     void ungrabGesture(Qt::GestureType type);
index 576465b..2c318c9 100644 (file)
@@ -2389,18 +2389,6 @@ bool QGraphicsWidget::close()
     return true;
 }
 
-#ifdef Q_NO_USING_KEYWORD
-/*!
-    \fn const QObjectList &QGraphicsWidget::children() const
-    \internal
-
-    This function returns the same value as QObject::children(). It's
-    provided to differentiate between the obsolete member
-    QGraphicsItem::children() and QObject::children(). QGraphicsItem now
-    provides childItems() instead.
-*/
-#endif
-
 #if 0
 void QGraphicsWidget::dumpFocusChain()
 {
index df0c43c..546dc28 100644 (file)
@@ -171,13 +171,6 @@ public:
     void dumpFocusChain();
 #endif
 
-    // ### Qt 5: Disambiguate
-#ifdef Q_NO_USING_KEYWORD
-    const QObjectList &children() const { return QObject::children(); }
-#else
-    using QObject::children;
-#endif
-
 Q_SIGNALS:
     void geometryChanged();
     void layoutChanged();
index 9646644..9422467 100644 (file)
 #include "qpaintengine.h"
 #include "qthread.h"
 
-#ifdef Q_WS_MAC
-# include "qt_mac_p.h"
-#endif
-
 #if defined(Q_WS_X11)
 # include "qx11info_x11.h"
 # include "qt_x11_p.h"
@@ -1714,12 +1710,6 @@ int QPixmap::defaultDepth()
 {
 #if defined(Q_WS_X11)
     return QX11Info::appDepth();
-#elif defined(Q_WS_WINCE)
-    return QColormap::instance().depth();
-#elif defined(Q_WS_WIN)
-    return 32; // XXX
-#elif defined(Q_WS_MAC)
-    return 32;
 #endif
 }
 
index 68acfa3..723d461 100644 (file)
 #   endif
 #endif
 
-#ifdef Q_OS_WINCE
-#define CALLBACK_CALL_TYPE        __cdecl
-#else
-#define CALLBACK_CALL_TYPE
-#endif
-
 QT_BEGIN_NAMESPACE
 
 #if defined(Q_OS_WINCE) && defined(STANDARDSHELL_UI_MODEL)
@@ -170,8 +164,7 @@ private:
     float gamma;
 };
 
-static
-void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length)
+static void iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length)
 {
     QPngHandlerPrivate *d = (QPngHandlerPrivate *)png_get_io_ptr(png_ptr);
     QIODevice *in = d->q->device();
@@ -195,8 +188,7 @@ void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_siz
 }
 
 
-static
-void CALLBACK_CALL_TYPE qpiw_write_fn(png_structp png_ptr, png_bytep data, png_size_t length)
+static void qpiw_write_fn(png_structp png_ptr, png_bytep data, png_size_t length)
 {
     QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr(png_ptr);
     QIODevice* out = qpiw->device();
@@ -209,8 +201,7 @@ void CALLBACK_CALL_TYPE qpiw_write_fn(png_structp png_ptr, png_bytep data, png_s
 }
 
 
-static
-void CALLBACK_CALL_TYPE qpiw_flush_fn(png_structp /* png_ptr */)
+static void qpiw_flush_fn(png_structp /* png_ptr */)
 {
 }
 
@@ -370,7 +361,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre
 #if defined(Q_C_CALLBACKS)
 extern "C" {
 #endif
-static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const_charp message)
+static void qt_png_warning(png_structp /*png_ptr*/, png_const_charp message)
 {
     qWarning("libpng warning: %s", message);
 }
index 55725fc..aac0603 100644 (file)
@@ -131,12 +131,6 @@ public:
     QIcon fileIcon(const QModelIndex &index) const;
     QFileInfo fileInfo(const QModelIndex &index) const;
 
-#ifdef Q_NO_USING_KEYWORD
-    inline QObject *parent() const { return QObject::parent(); }
-#else
-    using QObject::parent;
-#endif
-
 public Q_SLOTS:
     void refresh(const QModelIndex &parent = QModelIndex());
 
index eb19c48..413357a 100644 (file)
 #include <qapplication.h>
 #include <qdir.h>
 #include <qpixmapcache.h>
-#if defined(Q_WS_WIN)
-#  define _WIN32_IE 0x0500
-#  include <qt_windows.h>
-#  include <commctrl.h>
-#  include <objbase.h>
-#elif defined(Q_WS_MAC)
-#  include <qt_cocoa_helpers_mac_p.h>
-#endif
 
 #include <qfunctions_p.h>
 #include <qguiplatformplugin_p.h>
 #  include <qt_x11_p.h>
 #endif
 
-#ifndef SHGFI_ADDOVERLAYS
-#  define SHGFI_ADDOVERLAYS 0x000000020
-#  define SHGFI_OVERLAYINDEX 0x000000040
-#endif
-
 QT_BEGIN_NAMESPACE
 
 /*!
@@ -201,205 +188,6 @@ QIcon QFileIconProvider::icon(IconType type) const
     return QIcon();
 }
 
-#ifdef Q_WS_WIN
-
-static bool isCacheable(const QFileInfo &fi)
-{
-    if (!fi.isFile())
-        return false;
-
-    // On windows it's faster to just look at the file extensions. QTBUG-13182
-    const QString fileExtension = fi.suffix();
-    return fileExtension.compare(QLatin1String("exe"), Qt::CaseInsensitive) &&
-           fileExtension.compare(QLatin1String("lnk"), Qt::CaseInsensitive) &&
-           fileExtension.compare(QLatin1String("ico"), Qt::CaseInsensitive);
-}
-
-QIcon QFileIconProviderPrivate::getWinIcon(const QFileInfo &fileInfo) const
-{
-    QIcon retIcon;
-    static int defaultFolderIIcon = -1;
-
-    QString key;
-    QPixmap pixmap;
-    // If it's a file, non-{exe,lnk,ico} then we might have it cached already
-    if (isCacheable(fileInfo)) {
-        const QString fileExtension = QLatin1Char('.') + fileInfo.suffix().toUpper();
-        key = QLatin1String("qt_") + fileExtension;
-        QPixmapCache::find(key, pixmap);
-        if (!pixmap.isNull()) {
-            retIcon.addPixmap(pixmap);
-            if (QPixmapCache::find(key + QLatin1Char('l'), pixmap))
-                retIcon.addPixmap(pixmap);
-            return retIcon;
-        }
-    }
-
-    const bool cacheableDirIcon = fileInfo.isDir() && !fileInfo.isRoot();
-    if (!useCustomDirectoryIcons && defaultFolderIIcon >= 0 && cacheableDirIcon) {
-        // We already have the default folder icon, just return it
-        key = QString::fromLatin1("qt_dir_%1").arg(defaultFolderIIcon);
-        QPixmapCache::find(key, pixmap);
-        if (!pixmap.isNull()) {
-            retIcon.addPixmap(pixmap);
-            if (QPixmapCache::find(key + QLatin1Char('l'), pixmap))
-                retIcon.addPixmap(pixmap);
-            return retIcon;
-        }
-    }
-
-    /* We don't use the variable, but by storing it statically, we
-     * ensure CoInitialize is only called once. */
-    static HRESULT comInit = CoInitialize(NULL);
-    Q_UNUSED(comInit);
-
-    SHFILEINFO info;
-    unsigned long val = 0;
-
-    //Get the small icon
-    unsigned int flags =
-#ifndef Q_OS_WINCE
-        SHGFI_ICON|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX;
-#else
-        SHGFI_SYSICONINDEX;
-#endif
-
-    if (cacheableDirIcon && !useCustomDirectoryIcons) {
-        flags |= SHGFI_USEFILEATTRIBUTES;
-        val = SHGetFileInfo(L"dummy",
-                            FILE_ATTRIBUTE_DIRECTORY, &info,
-                            sizeof(SHFILEINFO), flags | SHGFI_SMALLICON);
-    } else {
-        val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(),
-                            0, &info, sizeof(SHFILEINFO), flags | SHGFI_SMALLICON);
-    }
-
-    // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
-    if (val && info.hIcon) {
-        if (fileInfo.isDir() && !fileInfo.isRoot()) {
-            if (!useCustomDirectoryIcons && defaultFolderIIcon < 0)
-                defaultFolderIIcon = info.iIcon;
-            //using the unique icon index provided by windows save us from duplicate keys
-            key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon);
-            QPixmapCache::find(key, pixmap);
-            if (!pixmap.isNull()) {
-                retIcon.addPixmap(pixmap);
-                if (QPixmapCache::find(key + QLatin1Char('l'), pixmap))
-                    retIcon.addPixmap(pixmap);
-                DestroyIcon(info.hIcon);
-                return retIcon;
-            }
-        }
-        if (pixmap.isNull()) {
-#ifndef Q_OS_WINCE
-            pixmap = QPixmap::fromWinHICON(info.hIcon);
-#else
-            pixmap = QPixmap::fromWinHICON(ImageList_GetIcon((HIMAGELIST) val, info.iIcon, ILD_NORMAL));
-#endif
-            if (!pixmap.isNull()) {
-                retIcon.addPixmap(pixmap);
-                if (!key.isEmpty())
-                    QPixmapCache::insert(key, pixmap);
-            }
-            else {
-              qWarning("QFileIconProviderPrivate::getWinIcon() no small icon found");
-            }
-        }
-        DestroyIcon(info.hIcon);
-    }
-
-    //Get the big icon
-    val = SHGetFileInfo((const wchar_t *)QDir::toNativeSeparators(fileInfo.filePath()).utf16(),
-                0, &info, sizeof(SHFILEINFO), flags | SHGFI_LARGEICON);
-
-    if (val && info.hIcon) {
-        if (fileInfo.isDir() && !fileInfo.isRoot()) {
-            //using the unique icon index provided by windows save us from duplicate keys
-            key = QString::fromLatin1("qt_dir_%1").arg(info.iIcon);
-        }
-#ifndef Q_OS_WINCE
-        pixmap = QPixmap::fromWinHICON(info.hIcon);
-#else
-        pixmap = QPixmap::fromWinHICON(ImageList_GetIcon((HIMAGELIST) val, info.iIcon, ILD_NORMAL));
-#endif
-        if (!pixmap.isNull()) {
-            retIcon.addPixmap(pixmap);
-            if (!key.isEmpty())
-                QPixmapCache::insert(key + QLatin1Char('l'), pixmap);
-        }
-        else {
-            qWarning("QFileIconProviderPrivate::getWinIcon() no large icon found");
-        }
-        DestroyIcon(info.hIcon);
-    }
-    return retIcon;
-}
-
-#elif defined(Q_WS_MAC)
-QIcon QFileIconProviderPrivate::getMacIcon(const QFileInfo &fi) const
-{
-    QIcon retIcon;
-    QString fileExtension = fi.suffix().toUpper();
-    fileExtension.prepend(QLatin1String("."));
-
-    const QString keyBase = QLatin1String("qt_") + fileExtension;
-
-    QPixmap pixmap;
-    if (fi.isFile() && !fi.isExecutable() && !fi.isSymLink()) {
-        QPixmapCache::find(keyBase + QLatin1String("16"), pixmap);
-    }
-
-    if (!pixmap.isNull()) {
-        retIcon.addPixmap(pixmap);
-        if (QPixmapCache::find(keyBase + QLatin1String("32"), pixmap)) {
-            retIcon.addPixmap(pixmap);
-            if (QPixmapCache::find(keyBase + QLatin1String("64"), pixmap)) {
-                retIcon.addPixmap(pixmap);
-                if (QPixmapCache::find(keyBase + QLatin1String("128"), pixmap)) {
-                    retIcon.addPixmap(pixmap);
-                    return retIcon;
-                }
-            }
-        }
-    }
-
-
-    FSRef macRef;
-    OSStatus status = FSPathMakeRef(reinterpret_cast<const UInt8*>(fi.canonicalFilePath().toUtf8().constData()),
-                                    &macRef, 0);
-    if (status != noErr)
-        return retIcon;
-    FSCatalogInfo info;
-    HFSUniStr255 macName;
-    status = FSGetCatalogInfo(&macRef, kIconServicesCatalogInfoMask, &info, &macName, 0, 0);
-    if (status != noErr)
-        return retIcon;
-    IconRef iconRef;
-    SInt16 iconLabel;
-    status = GetIconRefFromFileInfo(&macRef, macName.length, macName.unicode,
-                                    kIconServicesCatalogInfoMask, &info, kIconServicesNormalUsageFlag,
-                                    &iconRef, &iconLabel);
-    if (status != noErr)
-        return retIcon;
-    qt_mac_constructQIconFromIconRef(iconRef, 0, &retIcon);
-    ReleaseIconRef(iconRef);
-
-    if (fi.isFile() && !fi.isExecutable() && !fi.isSymLink()) {
-        pixmap = retIcon.pixmap(16);
-        QPixmapCache::insert(keyBase + QLatin1String("16"), pixmap);
-        pixmap = retIcon.pixmap(32);
-        QPixmapCache::insert(keyBase + QLatin1String("32"), pixmap);
-        pixmap = retIcon.pixmap(64);
-        QPixmapCache::insert(keyBase + QLatin1String("64"), pixmap);
-        pixmap = retIcon.pixmap(128);
-        QPixmapCache::insert(keyBase + QLatin1String("128"), pixmap);
-    }
-
-    return retIcon;
-}
-#endif
-
-
 /*!
   Returns an icon for the file described by \a info.
 */
@@ -420,39 +208,8 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const
     }
 #endif
 
-#ifdef Q_WS_MAC
-    QIcon retIcon = d->getMacIcon(info);
-    if (!retIcon.isNull())
-        return retIcon;
-#elif defined Q_WS_WIN
-    QIcon icon = d->getWinIcon(info);
-    if (!icon.isNull())
-        return icon;
-#endif
     if (info.isRoot())
-#if defined (Q_WS_WIN) && !defined(Q_WS_WINCE)
-    {
-        UINT type = GetDriveType((wchar_t *)info.absoluteFilePath().utf16());
-
-        switch (type) {
-        case DRIVE_REMOVABLE:
-            return d->getIcon(QStyle::SP_DriveFDIcon);
-        case DRIVE_FIXED:
-            return d->getIcon(QStyle::SP_DriveHDIcon);
-        case DRIVE_REMOTE:
-            return d->getIcon(QStyle::SP_DriveNetIcon);
-        case DRIVE_CDROM:
-            return d->getIcon(QStyle::SP_DriveCDIcon);
-        case DRIVE_RAMDISK:
-        case DRIVE_UNKNOWN:
-        case DRIVE_NO_ROOT_DIR:
-        default:
-            return d->getIcon(QStyle::SP_DriveHDIcon);
-        }
-    }
-#else
-    return d->getIcon(QStyle::SP_DriveHDIcon);
-#endif
+        return d->getIcon(QStyle::SP_DriveHDIcon);
     if (info.isFile()) {
         if (info.isSymLink())
             return d->getIcon(QStyle::SP_FileLinkIcon);
@@ -488,24 +245,12 @@ QString QFileIconProvider::type(const QFileInfo &info) const
     }
 
     if (info.isDir())
-#ifdef Q_WS_WIN
-        return QApplication::translate("QFileDialog", "File Folder", "Match Windows Explorer");
-#else
         return QApplication::translate("QFileDialog", "Folder", "All other platforms");
-#endif
-    // Windows   - "File Folder"
-    // OS X      - "Folder"
     // Konqueror - "Folder"
     // Nautilus  - "folder"
 
     if (info.isSymLink())
-#ifdef Q_OS_MAC
-        return QApplication::translate("QFileDialog", "Alias", "Mac OS X Finder");
-#else
         return QApplication::translate("QFileDialog", "Shortcut", "All other platforms");
-#endif
-    // OS X      - "Alias"
-    // Windows   - "Shortcut"
     // Konqueror - "Folder" or "TXT File" i.e. what it is pointing to
     // Nautilus  - "link to folder" or "link to object file", same as Konqueror
 
index 234ed45..3aa49b9 100644 (file)
@@ -1161,11 +1161,7 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
     if (customize)
         ; // don't modify window flags if the user explicitly set them.
     else if (type == Qt::Dialog || type == Qt::Sheet)
-#ifndef Q_WS_WINCE
         flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint;
-#else
-        flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
-#endif
     else if (type == Qt::Tool)
         flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint;
     else
@@ -4272,20 +4268,10 @@ const QPalette &QWidget::palette() const
 {
     if (!isEnabled()) {
         data->pal.setCurrentColorGroup(QPalette::Disabled);
-    } else if ((!isVisible() || isActiveWindow())
-#if defined(Q_OS_WIN) && !defined(Q_WS_WINCE)
-        && !QApplicationPrivate::isBlockedByModal(const_cast<QWidget *>(this))
-#endif
-        ) {
+    } else if (!isVisible() || isActiveWindow()) {
         data->pal.setCurrentColorGroup(QPalette::Active);
     } else {
-#ifdef Q_WS_MAC
-        extern bool qt_mac_can_clickThrough(const QWidget *); //qwidget_mac.cpp
-        if (qt_mac_can_clickThrough(this))
-            data->pal.setCurrentColorGroup(QPalette::Active);
-        else
-#endif
-            data->pal.setCurrentColorGroup(QPalette::Inactive);
+        data->pal.setCurrentColorGroup(QPalette::Inactive);
     }
     return data->pal;
 }
@@ -7678,17 +7664,12 @@ QSize QWidgetPrivate::adjustedSize() const
         if (exp & Qt::Vertical)
             s.setHeight(qMax(s.height(), 100));
 #if defined(Q_WS_X11)
-        QRect screen = QApplication::desktop()->screenGeometry(q->x11Info().screen());
+        const QRect screen = QApplication::desktop()->screenGeometry(q->x11Info().screen());
 #else // all others
-        QRect screen = QApplication::desktop()->screenGeometry(q->pos());
+        const QRect screen = QApplication::desktop()->screenGeometry(q->pos());
 #endif
-#if defined (Q_WS_WINCE)
-        s.setWidth(qMin(s.width(), screen.width()));
-        s.setHeight(qMin(s.height(), screen.height()));
-#else
         s.setWidth(qMin(s.width(), screen.width()*2/3));
         s.setHeight(qMin(s.height(), screen.height()*2/3));
-#endif
         if (QTLWExtra *extra = maybeTopData())
             extra->sizeAdjusted = true;
     }
index e97e07b..e5bf684 100644 (file)
@@ -457,11 +457,7 @@ public Q_SLOTS:
 
     virtual void setVisible(bool visible);
     inline void setHidden(bool hidden) { setVisible(!hidden); }
-#ifndef Q_WS_WINCE
     inline void show() { setVisible(true); }
-#else
-    void show();
-#endif
     inline void hide() { setVisible(false); }
 
     void showMinimized();
index 4df2010..da55da9 100644 (file)
@@ -54,7 +54,6 @@
 #include <qlabel.h>
 #include <qbitmap.h>
 #include <qmath.h>
-
 #include <qfontengine_ft_p.h>
 #include <qmath_p.h>
 #include <qtextengine_p.h>
 #include <qimage_p.h>
 #include <qstatictext_p.h>
 #include "qmemrotate_p.h"
-
 #include "qpaintengine_raster_p.h"
 #include "qoutlinemapper_p.h"
 
-#if defined(Q_WS_WIN)
-#  include <qt_windows.h>
-#  include <qvarlengtharray.h>
-#  include <qfontengine_p.h>
-#  if defined(Q_OS_WINCE)
-#    include "qguifunctions_wince.h"
-#  endif
-#elif defined(Q_WS_MAC)
-#  include <qt_mac_p.h>
-#  include <qpaintengine_mac_p.h>
-#endif
-
-#if defined(Q_WS_WIN64)
-#  include <malloc.h>
-#endif
 #include <limits.h>
 
 QT_BEGIN_NAMESPACE
@@ -108,14 +91,6 @@ void dumpClip(int width, int height, const QClipData *clip);
 // use the same rounding as in qrasterizer.cpp (6 bit fixed point)
 static const qreal aliasedCoordinateDelta = 0.5 - 0.015625;
 
-#ifdef Q_WS_WIN
-extern bool qt_cleartype_enabled;
-#endif
-
-#ifdef Q_WS_MAC
-extern bool qt_applefontsmoothing_enabled;
-#endif
-
 
 /********************************************************************************
  * Span functions
@@ -272,11 +247,6 @@ void QRasterPaintEngine::init()
 {
     Q_D(QRasterPaintEngine);
 
-
-#ifdef Q_WS_WIN
-    d->hdc = 0;
-#endif
-
     d->rasterizer.reset(new QRasterizer);
     d->rasterBuffer.reset(new QRasterBuffer());
     d->outlineMapper.reset(new QOutlineMapper);
@@ -399,27 +369,9 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
     }
 #endif
 
-#if defined(Q_WS_WIN)
-    d->isPlain45DegreeRotation = true;
-#endif
-
     if (d->mono_surface)
         d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono;
-#if defined(Q_WS_WIN)
-    else if (qt_cleartype_enabled)
-#elif defined (Q_WS_MAC)
-    else if (qt_applefontsmoothing_enabled)
-#else
-    else if (false)
-#endif
-    {
-        QImage::Format format = static_cast<QImage *>(d->device)->format();
-        if (format == QImage::Format_ARGB32_Premultiplied || format == QImage::Format_RGB32)
-            d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
-        else
-            d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
-    } else
-        d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
+    d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
 
     setActive(true);
     return true;
@@ -506,32 +458,6 @@ void QRasterPaintEngine::updateMatrix(const QTransform &matrix)
     s->flags.tx_noshear = qt_scaleForTransform(s->matrix, &s->txscale);
 
     ensureOutlineMapper();
-
-#ifdef Q_WS_WIN
-    Q_D(QRasterPaintEngine);
-    d->isPlain45DegreeRotation = false;
-    if (txop >= QTransform::TxRotate) {
-        d->isPlain45DegreeRotation =
-            (qFuzzyIsNull(matrix.m11())
-             && qFuzzyIsNull(matrix.m12() - qreal(1))
-             && qFuzzyIsNull(matrix.m21() + qreal(1))
-             && qFuzzyIsNull(matrix.m22())
-                )
-            ||
-            (qFuzzyIsNull(matrix.m11() + qreal(1))
-             && qFuzzyIsNull(matrix.m12())
-             && qFuzzyIsNull(matrix.m21())
-             && qFuzzyIsNull(matrix.m22() + qreal(1))
-                )
-            ||
-            (qFuzzyIsNull(matrix.m11())
-             && qFuzzyIsNull(matrix.m12() + qreal(1))
-             && qFuzzyIsNull(matrix.m21() - qreal(1))
-             && qFuzzyIsNull(matrix.m22())
-                )
-            ;
-    }
-#endif
 }
 
 
@@ -2729,23 +2655,6 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
     ensurePen();
     ensureRasterState();
 
-#if defined (Q_WS_WIN) || defined(Q_WS_MAC)
-
-    if (!supportsTransformations(ti.fontEngine)) {
-        QVarLengthArray<QFixedPoint> positions;
-        QVarLengthArray<glyph_t> glyphs;
-
-        QTransform matrix = s->matrix;
-        matrix.translate(p.x(), p.y());
-
-        ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
-
-        drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), ti.fontEngine);
-        return;
-    }
-
-#else // Q_WS_WIN || Q_WS_MAC
-
     QFontEngine *fontEngine = ti.fontEngine;
 
 #if defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)
@@ -2772,7 +2681,6 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
 
     return;
 #endif
-#endif
 
     QPaintEngineEx::drawTextItem(p, ti);
 }
@@ -2894,53 +2802,6 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect)
     QPaintEngineEx::drawEllipse(rect);
 }
 
-/*!
-    \internal
-*/
-#ifdef Q_WS_MAC
-void QRasterPaintEngine::setCGContext(CGContextRef ctx)
-{
-    Q_D(QRasterPaintEngine);
-    d->cgContext = ctx;
-}
-
-/*!
-    \internal
-*/
-CGContextRef QRasterPaintEngine::getCGContext() const
-{
-    Q_D(const QRasterPaintEngine);
-    return d->cgContext;
-}
-#endif
-
-#ifdef Q_WS_WIN
-/*!
-    \internal
-*/
-void QRasterPaintEngine::setDC(HDC hdc) {
-    Q_D(QRasterPaintEngine);
-    d->hdc = hdc;
-}
-
-/*!
-    \internal
-*/
-HDC QRasterPaintEngine::getDC() const
-{
-    Q_D(const QRasterPaintEngine);
-    return d->hdc;
-}
-
-/*!
-    \internal
-*/
-void QRasterPaintEngine::releaseDC(HDC) const
-{
-}
-
-#endif
-
 bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const
 {
     if (!state()->WxF)
@@ -2960,14 +2821,6 @@ bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransfo
     return false;
 }
 
-/*!
-    \internal
-*/
-QPoint QRasterPaintEngine::coordinateOffset() const
-{
-    return QPoint(0, 0);
-}
-
 void QRasterPaintEngine::drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fg)
 {
     Q_ASSERT(fg);
index 2851538..a3857af 100644 (file)
@@ -202,7 +202,6 @@ public:
 #ifdef Q_NO_USING_KEYWORD
     inline void drawEllipse(const QRect &rect) { QPaintEngineEx::drawEllipse(rect); }
 #else
-    using QPaintEngineEx::drawPolygon;
     using QPaintEngineEx::drawEllipse;
 #endif
 
@@ -218,8 +217,6 @@ public:
 
     Type type() const { return Raster; }
 
-    QPoint coordinateOffset() const;
-
     bool supportsTransformations(const QFontEngine *fontEngine) const;
     bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
 
index 3304650..0f27dd2 100644 (file)
@@ -2970,10 +2970,6 @@ qreal QPainterPath::angleAtPercent(qreal t) const
     return QLineF(0, 0, m1, m2).angle();
 }
 
-#if defined(Q_WS_WINCE)
-#pragma warning( disable : 4056 4756 )
-#endif
-
 /*!
     Returns the slope of the path at the percentage \a t. The
     argument \a t has to be between 0 and 1.
index 8bec6d1..7668a38 100644 (file)
@@ -612,12 +612,6 @@ private:
     void addRequiredBoundaries() const;
     void shapeText(int item) const;
     void shapeTextWithHarfbuzz(int item) const;
-#if defined(Q_WS_WINCE)
-    void shapeTextWithCE(int item) const;
-#endif
-#if defined(Q_WS_MAC)
-    void shapeTextMac(int item) const;
-#endif
     void splitItem(int item, int pos) const;
 
     void resolveAdditionalFormats() const;
index 33cbd3c..af6b21d 100644 (file)
@@ -111,11 +111,6 @@ QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
 
 QAlphaWidget::~QAlphaWidget()
 {
-#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE)
-    // Restore user-defined opacity value
-    if (widget)
-        widget->setWindowOpacity(1);
-#endif
 }
 
 /*
@@ -145,13 +140,6 @@ void QAlphaWidget::run(int time)
     checkTime.start();
 
     showWidget = true;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
-    qApp->installEventFilter(this);
-    widget->setWindowOpacity(0.0);
-    widget->show();
-    connect(&anim, SIGNAL(timeout()), this, SLOT(render()));
-    anim.start(1);
-#else
     //This is roughly equivalent to calling setVisible(true) without actually showing the widget
     widget->setAttribute(Qt::WA_WState_ExplicitShowHide, true);
     widget->setAttribute(Qt::WA_WState_Hidden, false);
@@ -178,7 +166,6 @@ void QAlphaWidget::run(int time)
        duration = 0;
        render();
     }
-#endif
 }
 
 /*
@@ -252,27 +239,12 @@ void QAlphaWidget::render()
     else
         alpha = 1;
 
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
-    if (alpha >= 1 || !showWidget) {
-        anim.stop();
-        qApp->removeEventFilter(this);
-        widget->setWindowOpacity(1);
-        q_blend = 0;
-        deleteLater();
-    } else {
-        widget->setWindowOpacity(alpha);
-    }
-#else
     if (alpha >= 1 || !showWidget) {
         anim.stop();
         qApp->removeEventFilter(this);
 
         if (widget) {
             if (!showWidget) {
-#ifdef Q_WS_WIN
-                setEnabled(true);
-                setFocus();
-#endif // Q_WS_WIN
                 widget->hide();
             } else {
                 //Since we are faking the visibility of the widget 
@@ -289,7 +261,6 @@ void QAlphaWidget::render()
         pm = QPixmap::fromImage(mixedImage);
         repaint();
     }
-#endif // defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
 }
 
 /*
index fe4dec4..9a02bf8 100644 (file)
@@ -2859,28 +2859,6 @@ void QMenu::actionEvent(QActionEvent *e)
         d->widgetItems.remove(e->action());
     }
 
-#ifdef Q_WS_MAC
-    if (d->mac_menu) {
-        if (e->type() == QEvent::ActionAdded)
-            d->mac_menu->addAction(e->action(), d->mac_menu->findAction(e->before()), d);
-        else if (e->type() == QEvent::ActionRemoved)
-            d->mac_menu->removeAction(e->action());
-        else if (e->type() == QEvent::ActionChanged)
-            d->mac_menu->syncAction(e->action());
-    }
-#endif
-
-#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
-    if (!d->wce_menu)
-        d->wce_menu = new QMenuPrivate::QWceMenuPrivate;
-    if (e->type() == QEvent::ActionAdded)
-        d->wce_menu->addAction(e->action(), d->wce_menu->findAction(e->before()));
-    else if (e->type() == QEvent::ActionRemoved)
-        d->wce_menu->removeAction(e->action());
-    else if (e->type() == QEvent::ActionChanged)
-        d->wce_menu->syncAction(e->action());
-#endif
-
     if (isVisible()) {
         d->updateActionRects();
         resize(sizeHint());
index 53a6d1f..928cf0b 100644 (file)
 #include <QtGui/qicon.h>
 #include <QtGui/qaction.h>
 
-
-#ifdef Q_WS_WINCE
-#include <windef.h> // for HMENU
-#endif
-
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
@@ -133,13 +128,6 @@ public:
     void setIcon(const QIcon &icon);
 
     void setNoReplayFor(QWidget *widget);
-#ifdef Q_WS_MAC
-    OSMenuRef macMenu(OSMenuRef merge=0);
-#endif
-
-#ifdef Q_WS_WINCE
-    HMENU wceMenu();
-#endif
 
     bool separatorsCollapsible() const;
     void setSeparatorsCollapsible(bool collapse);
@@ -171,10 +159,6 @@ protected:
     bool focusNextPrevChild(bool next);
     void initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const;
 
-#ifdef Q_WS_WINCE
-    QAction* wceCommands(uint command);
-#endif
-
 private Q_SLOTS:
     void internalSetSloppyAction();
     void internalDelayedPopup();
@@ -197,15 +181,6 @@ private:
     friend class QComboBox;
     friend class QAction;
     friend class QToolButtonPrivate;
-
-#ifdef Q_WS_MAC
-    friend void qt_mac_trayicon_activate_action(QMenu *, QAction *action);
-    friend bool qt_mac_watchingAboutToShow(QMenu *);
-    friend OSStatus qt_mac_menu_event(EventHandlerCallRef, EventRef, void *);
-    friend bool qt_mac_activate_action(OSMenuRef, uint, QAction::ActionEvent, bool);
-    friend void qt_mac_emit_menuSignals(QMenu *, bool);
-    friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action);
-#endif
 };
 
 #endif // QT_NO_MENU
index 148f06a..b4cf81a 100644 (file)
@@ -68,59 +68,6 @@ QT_BEGIN_NAMESPACE
 class QTornOffMenu;
 class QEventLoop;
 
-#ifdef Q_WS_MAC
-#  ifdef __OBJC__
-QT_END_NAMESPACE
-@class NSMenuItem;
-QT_BEGIN_NAMESPACE
-#  else
-typedef void NSMenuItem;
-#  endif //__OBJC__
-struct QMacMenuAction {
-    QMacMenuAction()
-#ifndef QT_MAC_USE_COCOA
-       : command(0)
-#else
-       : menuItem(0)
-#endif
-         , ignore_accel(0), merged(0), menu(0)
-    {
-    }
-    ~QMacMenuAction();
-#ifndef QT_MAC_USE_COCOA
-    uint command;
-#else
-    NSMenuItem *menuItem;
-#endif
-    uchar ignore_accel : 1;
-    uchar merged : 1;
-    QPointer<QAction> action;
-    OSMenuRef menu;
-};
-
-struct QMenuMergeItem
-{
-#ifndef QT_MAC_USE_COCOA
-    inline QMenuMergeItem(MenuCommand c, QMacMenuAction *a) : command(c), action(a) { }
-    MenuCommand command;
-#else
-    inline QMenuMergeItem(NSMenuItem *c, QMacMenuAction *a) : menuItem(c), action(a) { }
-    NSMenuItem *menuItem;
-#endif
-    QMacMenuAction *action;
-};
-typedef QList<QMenuMergeItem> QMenuMergeList;
-#endif
-
-#ifdef Q_WS_WINCE
-struct QWceMenuAction {
-    uint command;
-    QPointer<QAction> action;
-    HMENU menuHandle;
-    QWceMenuAction() : menuHandle(0), command(0) {}
-};
-#endif
-
 class QMenuPrivate : public QWidgetPrivate
 {
     Q_DECLARE_PUBLIC(QMenu)
@@ -134,22 +81,10 @@ public:
 #endif
                       scroll(0), eventLoop(0), tearoff(0), tornoff(0), tearoffHighlighted(0),
                       hasCheckableItems(0), sloppyDelayTimer(0), sloppyAction(0), doChildEffects(false)
-#ifdef Q_WS_MAC
-                      ,mac_menu(0)
-#endif
-#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
-                      ,wce_menu(0)
-#endif
     { }
     ~QMenuPrivate()
     {
         delete scroll;
-#ifdef Q_WS_MAC
-        delete mac_menu;
-#endif
-#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
-        delete wce_menu;
-#endif
 
     }
     void init();
@@ -273,66 +208,8 @@ public:
     //menu fading/scrolling effects
     bool doChildEffects;
 
-#ifdef Q_WS_MAC
-    //mac menu binding
-    struct QMacMenuPrivate {
-        QList<QMacMenuAction*> actionItems;
-        OSMenuRef menu;
-        QMacMenuPrivate();
-        ~QMacMenuPrivate();
-
-        bool merged(const QAction *action) const;
-        void addAction(QAction *, QMacMenuAction* =0, QMenuPrivate *qmenu = 0);
-        void addAction(QMacMenuAction *, QMacMenuAction* =0, QMenuPrivate *qmenu = 0);
-        void syncAction(QMacMenuAction *);
-        inline void syncAction(QAction *a) { syncAction(findAction(a)); }
-        void removeAction(QMacMenuAction *);
-        inline void removeAction(QAction *a) { removeAction(findAction(a)); }
-        inline QMacMenuAction *findAction(QAction *a) {
-            for(int i = 0; i < actionItems.size(); i++) {
-                QMacMenuAction *act = actionItems[i];
-                if(a == act->action)
-                    return act;
-            }
-            return 0;
-        }
-    } *mac_menu;
-    OSMenuRef macMenu(OSMenuRef merge);
-#ifndef QT_MAC_USE_COCOA
-    void setMacMenuEnabled(bool enable = true);
-#endif
-    void syncSeparatorsCollapsible(bool collapsible);
-    static QHash<OSMenuRef, OSMenuRef> mergeMenuHash;
-    static QHash<OSMenuRef, QMenuMergeList*> mergeMenuItemsHash;
-#endif
-
     QPointer<QAction> actionAboutToTrigger;
 
-#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
-    struct QWceMenuPrivate {
-        QList<QWceMenuAction*> actionItems;
-        HMENU menuHandle;
-        QWceMenuPrivate();
-        ~QWceMenuPrivate();
-        void addAction(QAction *, QWceMenuAction* =0);
-        void addAction(QWceMenuAction *, QWceMenuAction* =0);
-        void syncAction(QWceMenuAction *);
-        inline void syncAction(QAction *a) { syncAction(findAction(a)); }
-        void removeAction(QWceMenuAction *);
-        void rebuild();
-        inline void removeAction(QAction *a) { removeAction(findAction(a)); }
-        inline QWceMenuAction *findAction(QAction *a) {
-            for(int i = 0; i < actionItems.size(); i++) {
-                QWceMenuAction *act = actionItems[i];
-                if(a == act->action)
-                    return act;
-            }
-            return 0;
-        }
-    } *wce_menu;
-    HMENU wceMenu();
-    QAction* wceCommands(uint command);
-#endif
     QPointer<QWidget> noReplayFor;
 };
 
index 4486428..fb1969d 100644 (file)
 #include "qmenubar_x11_p.h"
 #endif
 
-#ifdef Q_WS_WINCE
-extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
-#endif
-
 QT_BEGIN_NAMESPACE
 
 class QMenuBarExtension : public QToolButton
@@ -197,12 +193,6 @@ void QMenuBarPrivate::updateGeometries()
         }
     }
 
-#ifdef Q_WS_MAC
-    if(q->isNativeMenuBar()) {//nothing to see here folks, move along..
-        itemsDirty = false;
-        return;
-    }
-#endif
     calcActionRects(q_width, q_start);
     currentAction = 0;
 #ifndef QT_NO_SHORTCUT
@@ -728,21 +718,6 @@ void QMenuBarPrivate::init()
     Q_Q(QMenuBar);
     q->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
     q->setAttribute(Qt::WA_CustomWhatsThis);
-#ifdef Q_WS_MAC
-    macCreateMenuBar(q->parentWidget());
-    if(mac_menubar)
-        q->hide();
-#endif
-#ifdef Q_WS_WINCE
-    if (qt_wince_is_mobile()) {
-        wceCreateMenuBar(q->parentWidget());
-        if(wce_menubar)
-            q->hide();
-    }
-    else {
-        QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
-    }
-#endif
 #ifdef Q_WS_X11
     platformMenuBar = qt_guiPlatformMenuBarFactory()->create();
     platformMenuBar->init(q);
@@ -799,15 +774,6 @@ QMenuBar::QMenuBar(QWidget *parent) : QWidget(*new QMenuBarPrivate, parent, 0)
 */
 QMenuBar::~QMenuBar()
 {
-#ifdef Q_WS_MAC
-    Q_D(QMenuBar);
-    d->macDestroyMenuBar();
-#endif
-#ifdef Q_WS_WINCE
-    Q_D(QMenuBar);
-    if (qt_wince_is_mobile())
-        d->wceDestroyMenuBar();
-#endif
 #ifdef Q_WS_X11
     Q_D(QMenuBar);
     delete d->cornerWidgetToolBar;
@@ -1067,13 +1033,6 @@ void QMenuBar::setVisible(bool visible)
     Q_D(QMenuBar);
     d->platformMenuBar->setVisible(visible);
 #else
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE) || defined(Q_WS_S60)
-    if (isNativeMenuBar()) {
-        if (!visible)
-            QWidget::setVisible(false);
-        return;
-    }
-#endif
     QWidget::setVisible(visible);
 #endif // Q_WS_X11
 }
@@ -1274,23 +1233,6 @@ void QMenuBar::actionEvent(QActionEvent *e)
 #ifdef Q_WS_X11
     d->platformMenuBar->actionEvent(e);
 #endif
-#if defined (Q_WS_MAC) || defined(Q_OS_WINCE) || defined(Q_WS_S60)
-    if (isNativeMenuBar()) {
-#ifdef Q_WS_MAC
-        QMenuBarPrivate::QMacMenuBarPrivate *nativeMenuBar = d->mac_menubar;
-#else
-        QMenuBarPrivate::QWceMenuBarPrivate *nativeMenuBar = d->wce_menubar;
-#endif
-        if (!nativeMenuBar)
-            return;
-        if(e->type() == QEvent::ActionAdded)
-            nativeMenuBar->addAction(e->action(), e->before());
-        else if(e->type() == QEvent::ActionRemoved)
-            nativeMenuBar->removeAction(e->action());
-        else if(e->type() == QEvent::ActionChanged)
-            nativeMenuBar->syncAction(e->action());
-    }
-#endif
 
     if(e->type() == QEvent::ActionAdded) {
         connect(e->action(), SIGNAL(triggered()), this, SLOT(_q_actionTriggered()));
@@ -1372,21 +1314,6 @@ void QMenuBarPrivate::handleReparent()
 
     oldParent = newParent;
     oldWindow = newWindow;
-
-#ifdef Q_WS_MAC
-    if (q->isNativeMenuBar() && !macWidgetHasNativeMenubar(newParent)) {
-        // If the new parent got a native menubar from before, keep that
-        // menubar rather than replace it with this one (because a parents
-        // menubar has precedence over children menubars).
-        macDestroyMenuBar();
-        macCreateMenuBar(newParent);
-    }
-#endif
-
-#ifdef Q_WS_WINCE
-    if (qt_wince_is_mobile() && wce_menubar)
-        wce_menubar->rebuild();
-#endif
 }
 
 
@@ -1572,7 +1499,7 @@ QRect QMenuBar::actionGeometry(QAction *act) const
 QSize QMenuBar::minimumSizeHint() const
 {
     Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60) || defined(Q_WS_X11)
+#if defined(Q_WS_X11)
     const bool as_gui_menubar = !isNativeMenuBar();
 #else
     const bool as_gui_menubar = true;
@@ -1634,7 +1561,7 @@ QSize QMenuBar::minimumSizeHint() const
 QSize QMenuBar::sizeHint() const
 {
     Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60) || defined(Q_WS_X11)
+#if defined(Q_WS_X11)
     const bool as_gui_menubar = !isNativeMenuBar();
 #else
     const bool as_gui_menubar = true;
@@ -1699,7 +1626,7 @@ QSize QMenuBar::sizeHint() const
 int QMenuBar::heightForWidth(int) const
 {
     Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60) || defined(Q_WS_X11)
+#if defined(Q_WS_X11)
     const bool as_gui_menubar = !isNativeMenuBar();
 #else
     const bool as_gui_menubar = true;
@@ -1910,27 +1837,6 @@ void QMenuBar::setNativeMenuBar(bool nativeMenuBar)
 #else
     if (d->nativeMenuBar == -1 || (nativeMenuBar != bool(d->nativeMenuBar))) {
         d->nativeMenuBar = nativeMenuBar;
-#ifdef Q_WS_MAC
-        if (!d->nativeMenuBar) {
-            extern void qt_mac_clear_menubar();
-            qt_mac_clear_menubar();
-            d->macDestroyMenuBar();
-            const QList<QAction *> &menubarActions = actions();
-            for (int i = 0; i < menubarActions.size(); ++i) {
-                const QAction *action = menubarActions.at(i);
-                if (QMenu *menu = action->menu()) {
-                    delete menu->d_func()->mac_menu;
-                    menu->d_func()->mac_menu = 0;
-                }
-            }
-        } else {
-            d->macCreateMenuBar(parentWidget());
-        }
-        macUpdateMenuBar();
-       updateGeometry();
-       if (!d->nativeMenuBar && parentWidget())
-           setVisible(true);
-#endif
     }
 #endif // Q_WS_X11
 }
@@ -1949,59 +1855,6 @@ bool QMenuBar::isNativeMenuBar() const
 }
 
 /*!
-  \since 4.4
-
-  Sets the default action to \a act.
-
-  The default action is assigned to the left soft key. The menu is assigned
-  to the right soft key.
-
-  Currently there is only support for the default action on Windows
-  Mobile. On all other platforms this method is not available.
-
-  \sa defaultAction()
-*/
-
-#ifdef Q_WS_WINCE
-void QMenuBar::setDefaultAction(QAction *act)
-{
-    Q_D(QMenuBar);
-    if (d->defaultAction == act)
-        return;
-#ifdef Q_WS_WINCE
-    if (qt_wince_is_mobile())
-        if (d->defaultAction) {
-            disconnect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction()));
-            disconnect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction()));
-        }
-#endif
-    d->defaultAction = act;
-#ifdef Q_WS_WINCE
-    if (qt_wince_is_mobile())
-        if (d->defaultAction) {
-            connect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction()));
-            connect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction()));
-        }
-    if (d->wce_menubar) {
-        d->wce_menubar->rebuild();
-    }
-#endif
-}
-
-/*!
-  \since 4.4
-
-  Returns the current default action.
-
-  \sa setDefaultAction()
-*/
-QAction *QMenuBar::defaultAction() const
-{
-    return d_func()->defaultAction;
-}
-#endif
-
-/*!
     \fn void QMenuBar::triggered(QAction *action)
 
     This signal is emitted when an action in a menu belonging to this menubar
index a58fe4d..4bd8717 100644 (file)
@@ -102,19 +102,6 @@ public:
     void setCornerWidget(QWidget *w, Qt::Corner corner = Qt::TopRightCorner);
     QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
 
-#ifdef Q_WS_MAC
-    OSMenuRef macMenu();
-    static bool macUpdateMenuBar();
-#endif
-
-#ifdef Q_WS_WINCE
-    void setDefaultAction(QAction *);
-    QAction *defaultAction() const;
-
-    static void wceCommands(uint command);
-    static void wceRefresh();
-#endif
-
     bool isNativeMenuBar() const;
     void setNativeMenuBar(bool nativeMenuBar);
 
@@ -151,19 +138,9 @@ private:
     Q_PRIVATE_SLOT(d_func(), void _q_internalShortcutActivated(int))
     Q_PRIVATE_SLOT(d_func(), void _q_updateLayout())
 
-#ifdef Q_WS_WINCE
-    Q_PRIVATE_SLOT(d_func(), void _q_updateDefaultAction())
-#endif
-
     friend class QMenu;
     friend class QMenuPrivate;
     friend class QWindowsStyle;
-
-#ifdef Q_WS_MAC
-    friend class QApplicationPrivate;
-    friend class QWidgetPrivate;
-    friend bool qt_mac_activate_action(MenuRef, uint, QAction::ActionEvent, bool);
-#endif
 };
 
 #endif // QT_NO_MENUBAR
index a26ce67..9947bf9 100644 (file)
 // We mean it.
 //
 
-#ifndef QMAC_Q3MENUBAR_CPP_FILE
 #include "QtGui/qstyleoption.h"
-#include <qmenu_p.h> // Mac needs what in this file!
-
-#ifdef Q_WS_WINCE
-#include "qguifunctions_wince.h"
-#endif
+#include "qwidget_p.h"
+#include "qbasictimer.h"
 
 #ifdef Q_WS_X11
 #include "qabstractplatformmenubar_p.h"
 #endif
 
-#ifndef QT_NO_MENUBAR
-#endif
-
 QT_BEGIN_NAMESPACE
 
 #ifndef QT_NO_MENUBAR
@@ -83,15 +76,9 @@ public:
                          , nativeMenuBar(-1)
 #endif
                          , doChildEffects(false)
-#ifdef Q_WS_MAC
-                         , mac_menubar(0)
-#endif
 #ifdef Q_WS_X11
                          , platformMenuBar(0)
 #endif
-#ifdef Q_WS_WINCE
-                         , wce_menubar(0), wceClassicMenu(false)
-#endif
 
         { }
     ~QMenuBarPrivate()
@@ -99,12 +86,6 @@ public:
 #ifdef Q_WS_X11
             delete platformMenuBar;
 #endif
-#ifdef Q_WS_MAC
-            delete mac_menubar;
-#endif
-#ifdef Q_WS_WINCE
-            delete wce_menubar;
-#endif
         }
 
     void init();
@@ -147,10 +128,6 @@ public:
     void _q_internalShortcutActivated(int);
     void _q_updateLayout();
 
-#ifdef Q_WS_WINCE
-    void _q_updateDefaultAction();
-#endif
-
     //extra widgets in the menubar
     QPointer<QWidget> leftWidget, rightWidget;
     QMenuBarExtension *extension;
@@ -174,74 +151,6 @@ public:
 #ifdef Q_WS_X11
     QAbstractPlatformMenuBar *platformMenuBar;
 #endif
-#ifdef Q_WS_MAC
-    //mac menubar binding
-    struct QMacMenuBarPrivate {
-        QList<QMacMenuAction*> actionItems;
-        OSMenuRef menu, apple_menu;
-        QMacMenuBarPrivate();
-        ~QMacMenuBarPrivate();
-
-        void addAction(QAction *, QAction* =0);
-        void addAction(QMacMenuAction *, QMacMenuAction* =0);
-        void syncAction(QMacMenuAction *);
-        inline void syncAction(QAction *a) { syncAction(findAction(a)); }
-        void removeAction(QMacMenuAction *);
-        inline void removeAction(QAction *a) { removeAction(findAction(a)); }
-        inline QMacMenuAction *findAction(QAction *a) {
-            for(int i = 0; i < actionItems.size(); i++) {
-                QMacMenuAction *act = actionItems[i];
-                if(a == act->action)
-                    return act;
-            }
-            return 0;
-        }
-    } *mac_menubar;
-    static bool macUpdateMenuBarImmediatly();
-    bool macWidgetHasNativeMenubar(QWidget *widget);
-    void macCreateMenuBar(QWidget *);
-    void macDestroyMenuBar();
-    OSMenuRef macMenu();
-#endif
-#ifdef Q_WS_WINCE
-    void wceCreateMenuBar(QWidget *);
-    void wceDestroyMenuBar();
-    struct QWceMenuBarPrivate {
-        QList<QWceMenuAction*> actionItems;
-        QList<QWceMenuAction*> actionItemsLeftButton;
-        QList<QList<QWceMenuAction*>> actionItemsClassic;
-        HMENU menuHandle;
-        HMENU leftButtonMenuHandle;
-        HWND menubarHandle;
-        HWND parentWindowHandle;
-        bool leftButtonIsMenu;
-        QPointer<QAction> leftButtonAction;
-        QMenuBarPrivate *d;
-        int leftButtonCommand;
-
-        QWceMenuBarPrivate(QMenuBarPrivate *menubar);
-        ~QWceMenuBarPrivate();
-        void addAction(QAction *, QAction* =0);
-        void addAction(QWceMenuAction *, QWceMenuAction* =0);
-        void syncAction(QWceMenuAction *);
-        inline void syncAction(QAction *a) { syncAction(findAction(a)); }
-        void removeAction(QWceMenuAction *);
-        void rebuild();
-        inline void removeAction(QAction *a) { removeAction(findAction(a)); }
-        inline QWceMenuAction *findAction(QAction *a) {
-            for(int i = 0; i < actionItems.size(); i++) {
-                QWceMenuAction *act = actionItems[i];
-                if(a == act->action)
-                    return act;
-            }
-            return 0;
-        }
-    } *wce_menubar;
-    bool wceClassicMenu;
-    void wceCommands(uint command);
-    void wceRefresh();
-    bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command);
-#endif
 
 #ifdef Q_WS_X11
     void updateCornerWidgetToolBar();
@@ -249,7 +158,6 @@ public:
     QWidget *cornerWidgetContainer;
 #endif
 };
-#endif
 
 #endif // QT_NO_MENUBAR
 
index 436af66..63db151 100644 (file)
 #include <qwidgetaction.h>
 #include <qtimer.h>
 #include <qwidgetaction_p.h>
-#ifdef Q_WS_MAC
-#include <qt_mac_p.h>
-#include <qt_cocoa_helpers_mac_p.h>
-#endif
-
 #include <qmainwindowlayout_p.h>
 
 #include "qtoolbar_p.h"
 
 QT_BEGIN_NAMESPACE
 
-#ifdef Q_WS_MAC
-static void qt_mac_updateToolBarButtonHint(QWidget *parentWidget)
-{
-    if (!(parentWidget->windowFlags() & Qt::CustomizeWindowHint))
-        parentWidget->setWindowFlags(parentWidget->windowFlags() | Qt::MacWindowToolBarButtonHint);
-}
-#endif
-
 // qmainwindow.cpp
 extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
 
@@ -103,17 +90,6 @@ void QToolBarPrivate::init()
     layout = new QToolBarLayout(q);
     layout->updateMarginAndSpacing();
 
-#ifdef Q_WS_MAC
-    if (q->parentWidget() && q->parentWidget()->isWindow()) {
-        // Make sure that the window has the "toolbar" button.
-        QWidget *parentWidget = q->parentWidget();
-        qt_mac_updateToolBarButtonHint(parentWidget);
-        reinterpret_cast<QToolBar *>(parentWidget)->d_func()->createWinId(); // Please let me create your winId...
-        extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp
-        macWindowToolbarShow(q->parentWidget(), true);
-    }
-#endif
-
     toggleViewAction = new QAction(q);
     toggleViewAction->setCheckable(true);
     q->setMovable(q->style()->styleHint(QStyle::SH_ToolBar_Movable, 0, q ));
@@ -159,9 +135,6 @@ void QToolBarPrivate::updateWindowFlags(bool floating, bool unplug)
 
     if (unplug) {
         flags |= Qt::X11BypassWindowManagerHint;
-#ifdef Q_WS_MAC
-        flags |= Qt::WindowStaysOnTopHint;
-#endif
     }
 
     q->setWindowFlags(flags);
@@ -230,11 +203,6 @@ void QToolBarPrivate::startDrag(bool moving)
 
     if (!moving) {
         state->widgetItem = layout->unplug(q);
-#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
-        if (q->isWindow()) {
-           setWindowState(true, true); //set it to floating
-        }
-#endif
         Q_ASSERT(state->widgetItem != 0);
     }
     state->dragging = !moving;
@@ -255,7 +223,7 @@ void QToolBarPrivate::endDrag()
         if (!layout->plug(state->widgetItem)) {
             if (q->isFloatable()) {
                 layout->restore();
-#if defined(Q_WS_X11) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11)
                 setWindowState(true); // gets rid of the X11BypassWindowManager window flag
                                       // and activates the resizer
 #endif
@@ -276,21 +244,6 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event)
     QStyleOptionToolBar opt;
     q->initStyleOption(&opt);
     if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) {
-#ifdef Q_WS_MAC
-        // When using the unified toolbar on Mac OS X the user can can click and
-        // drag between toolbar contents to move the window. Make this work by
-        // implementing the standard mouse-dragging code and then call
-        // window->move() in mouseMoveEvent below.
-        if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parent)) {
-            if (mainWindow->toolBarArea(q) == Qt::TopToolBarArea
-                    && mainWindow->unifiedTitleAndToolBarOnMac()
-                    && q->childAt(event->pos()) == 0) {
-                macWindowDragging = true;
-                macWindowDragPressPosition = event->pos();
-                return true;
-            }
-        }
-#endif
         return false;
     }
 
@@ -309,16 +262,8 @@ bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*)
     if (state != 0) {
         endDrag();
         return true;
-    } else {
-#ifdef Q_WS_MAC
-        if (!macWindowDragging)
-            return false;
-        macWindowDragging = false;
-        macWindowDragPressPosition = QPoint();
-        return true;
-#endif
-        return false;
     }
+    return false;
 }
 
 bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event)
@@ -326,14 +271,6 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event)
     Q_Q(QToolBar);
 
     if (!state) {
-#ifdef Q_WS_MAC
-        if (!macWindowDragging)
-            return false;
-        QWidget *w = q->window();
-        const QPoint delta = event->pos() - macWindowDragPressPosition;
-        w->move(w->pos() + delta);
-        return true;
-#endif
         return false;
     }
 
@@ -573,16 +510,6 @@ QToolBar::QToolBar(const QString &title, QWidget *parent)
 */
 QToolBar::~QToolBar()
 {
-    // Remove the toolbar button if there is nothing left.
-    QMainWindow *mainwindow = qobject_cast<QMainWindow *>(parentWidget());
-    if (mainwindow) {
-#ifdef Q_WS_MAC
-        QMainWindowLayout *mainwin_layout = qt_mainwindow_layout(mainwindow);
-        if (mainwin_layout && mainwin_layout->layoutState.toolBarAreaLayout.isEmpty()
-                && mainwindow->testAttribute(Qt::WA_WState_Created))
-            macWindowToolbarShow(mainwindow, false);
-#endif
-    }
 }
 
 /*! \property QToolBar::movable
@@ -669,12 +596,6 @@ void QToolBar::setAllowedAreas(Qt::ToolBarAreas areas)
 Qt::ToolBarAreas QToolBar::allowedAreas() const
 {
     Q_D(const QToolBar);
-#ifdef Q_WS_MAC
-    if (QMainWindow *window = qobject_cast<QMainWindow *>(parentWidget())) {
-        if (window->unifiedTitleAndToolBarOnMac()) // Don't allow drags to the top (for now).
-            return (d->allowedAreas & ~Qt::TopToolBarArea);
-    }
-#endif
     return d->allowedAreas;
 }
 
@@ -1088,15 +1009,6 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup)
     return false;
 }
 
-#if defined(Q_WS_MAC)
-static bool toolbarInUnifiedToolBar(QToolBar *toolbar)
-{
-    const QMainWindow *mainWindow = qobject_cast<const QMainWindow *>(toolbar->parentWidget());
-    return mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()
-            && mainWindow->toolBarArea(toolbar) == Qt::TopToolBarArea;
-}
-#endif
-
 /*! \reimp */
 bool QToolBar::event(QEvent *event)
 {
@@ -1120,52 +1032,9 @@ bool QToolBar::event(QEvent *event)
     case QEvent::Show:
         d->toggleViewAction->setChecked(event->type() == QEvent::Show);
         emit visibilityChanged(event->type() == QEvent::Show);
-#if defined(Q_WS_MAC)
-        if (toolbarInUnifiedToolBar(this)) {
-             // I can static_cast because I did the qobject_cast in the if above, therefore
-            // we must have a QMainWindowLayout here.
-            QMainWindowLayout *mwLayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(parentWidget()));
-            mwLayout->fixSizeInUnifiedToolbar(this);
-            mwLayout->syncUnifiedToolbarVisibility();
-        }
-#  if !defined(QT_MAC_USE_COCOA)
-        // Fall through
-    case QEvent::LayoutRequest: {
-        // There's currently no way to invalidate the size and let
-        // HIToolbar know about it. This forces a re-check.
-        int earlyResult = -1;
-        if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget())) {
-            bool needUpdate = true;
-            if (event->type() == QEvent::LayoutRequest) {
-                QSize oldSizeHint = sizeHint();
-                earlyResult = QWidget::event(event) ? 1 : 0;
-                needUpdate = oldSizeHint != sizeHint();
-            }
-
-            if (needUpdate) {
-                OSWindowRef windowRef = qt_mac_window_for(mainWindow);
-                if (toolbarInUnifiedToolBar(this)
-                        && macWindowToolbarIsVisible(windowRef))   {
-                    DisableScreenUpdates();
-                    macWindowToolbarShow(this, false);
-                    macWindowToolbarShow(this, true);
-                    EnableScreenUpdates();
-                }
-            }
-
-            if (earlyResult != -1)
-                return earlyResult;
-        }
-    }
-#  endif // !QT_MAC_USE_COCOA
-#endif // Q_WS_MAC
         break;
     case QEvent::ParentChange:
         d->layout->checkUsePopupMenu();
-#if defined(Q_WS_MAC)
-        if (parentWidget() && parentWidget()->isWindow())
-            qt_mac_updateToolBarButtonHint(parentWidget());
-#endif
         break;
 
     case QEvent::MouseButtonPress: {
@@ -1197,27 +1066,8 @@ bool QToolBar::event(QEvent *event)
         if (d->mouseMoveEvent(static_cast<QMouseEvent*>(event)))
             return true;
         break;
-#ifdef Q_WS_WINCE
-    case QEvent::ContextMenu:
-        {
-            QContextMenuEvent* contextMenuEvent = static_cast<QContextMenuEvent*>(event);
-            QWidget* child = childAt(contextMenuEvent->pos());
-            QAbstractButton* button = qobject_cast<QAbstractButton*>(child);
-            if (button)
-                button->setDown(false);
-        }
-        break;
-#endif
     case QEvent::Leave:
-        if (d->state != 0 && d->state->dragging) {
-#ifdef Q_OS_WIN
-            // This is a workaround for loosing the mouse on Vista.
-            QPoint pos = QCursor::pos();
-            QMouseEvent fake(QEvent::MouseMove, mapFromGlobal(pos), pos, Qt::NoButton,
-                             QApplication::mouseButtons(), QApplication::keyboardModifiers());
-            d->mouseMoveEvent(&fake);
-#endif
-        } else {
+        if (!(d->state != 0 && d->state->dragging)) {
             if (!d->layout->expanded)
                 break;