OSDN Git Service

various cleanups
authorIvailo Monev <xakepa10@gmail.com>
Sun, 17 Jul 2016 23:58:13 +0000 (23:58 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 17 Jul 2016 23:58:13 +0000 (23:58 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
16 files changed:
src/gui/CMakeLists.txt
src/gui/dialogs/qprintdialog_mac.mm
src/gui/image/qimage.cpp
src/gui/image/qimage.h
src/gui/inputmethod/qinputcontext.h
src/gui/kernel/qapplication_mac.mm
src/gui/kernel/qclipboard.h
src/gui/kernel/qclipboard_mac.cpp
src/gui/kernel/qclipboard_win.cpp
src/gui/kernel/qclipboard_x11.cpp
src/gui/kernel/qsessionmanager.h
src/gui/kernel/qsizepolicy.qdoc
src/gui/kernel/qwidget.h
src/gui/kernel/qwidget_mac.mm
src/gui/styles/qmacstyle_mac.mm
src/gui/widgets/qeffects_p.h

index 14976c5..cc55bff 100644 (file)
@@ -188,7 +188,6 @@ set(GUI_PUBLIC_HEADERS
     QPlainTextDocumentLayout
     QPlainTextEdit
     QPlastiqueStyle
-    QPlatformClipboard
     QPlatformCursor
     QPlatformCursorImage
     QPlatformCursorPrivate
index d6cc2a3..4f4fd74 100644 (file)
@@ -386,14 +386,6 @@ int QPrintDialog::exec()
     return result();
 }
 
-#ifdef QT3_SUPPORT
-QPrinter *QPrintDialog::printer() const
-{
-    Q_D(const QPrintDialog);
-    return d->printer;
-}
-#endif
-
 /*!
     \reimp
 */
index 4759a17..3236a39 100644 (file)
@@ -978,9 +978,6 @@ QImage::QImage(const QString &fileName, const char *format)
 QImage::QImage(const char *fileName, const char *format)
     : QPaintDevice()
 {
-    // ### Qt 5: if you remove the QImage(const QByteArray &) QT3_SUPPORT
-    // constructor, remove this constructor as well. The constructor here
-    // exists so that QImage("foo.png") compiles without ambiguity.
     d = 0;
     load(QString::fromAscii(fileName), format);
 }
index 0b5f03c..1addd51 100644 (file)
@@ -63,7 +63,6 @@ template <class T> class QList;
 template <class T> class QVector;
 
 struct QImageData;
-class QImageDataMisc; // internal
 #ifndef QT_NO_IMAGE_TEXT
 class Q_GUI_EXPORT QImageTextKeyLang {
 public:
@@ -268,7 +267,6 @@ protected:
     virtual int metric(PaintDeviceMetric metric) const;
 
 private:
-    friend class QWSOnScreenSurface;
     QImageData *d;
 
     friend class QRasterPixmapData;
index 96a0e5f..36b7b7f 100644 (file)
@@ -73,7 +73,6 @@ QT_BEGIN_NAMESPACE
 
 class QWidget;
 class QFont;
-class QPopupMenu;
 class QInputContextPrivate;
 
 class Q_GUI_EXPORT QInputContext : public QObject
index 2bd2bab..bb6f87b 100644 (file)
@@ -1374,15 +1374,6 @@ void qt_cleanup()
 extern QWidget * mac_mouse_grabber;
 extern QWidget * mac_keyboard_grabber;
 
-#ifdef QT3_SUPPORT
-void QApplication::setMainWidget(QWidget *mainWidget)
-{
-    QApplicationPrivate::main_widget = mainWidget;
-    if (QApplicationPrivate::main_widget && windowIcon().isNull()
-        && QApplicationPrivate::main_widget->testAttribute(Qt::WA_SetWindowIcon))
-        setWindowIcon(QApplicationPrivate::main_widget->windowIcon());
-}
-#endif
 #ifndef QT_NO_CURSOR
 
 /*****************************************************************************
index 2de2002..69fc806 100644 (file)
@@ -95,8 +95,6 @@ Q_SIGNALS:
     void selectionChanged();
     void findBufferChanged();
     void dataChanged();
-private Q_SLOTS:
-    void ownerDestroyed();
 
 protected:
     void connectNotify(const char *);
@@ -104,10 +102,8 @@ protected:
 
     friend class QApplication;
     friend class QApplicationPrivate;
-    friend class QBaseApplication;
     friend class QDragManager;
     friend class QMimeSource;
-    friend class QPlatformClipboard;
 
 private:
     Q_DISABLE_COPY(QClipboard)
index 2a919a7..787894e 100644 (file)
@@ -105,11 +105,6 @@ void QClipboard::clear(Mode mode)
     setMimeData(0, mode);
 }
 
-void QClipboard::ownerDestroyed()
-{
-}
-
-
 void QClipboard::connectNotify(const char *signal)
 {
     Q_UNUSED(signal);
index e9734a1..3a20009 100644 (file)
@@ -411,10 +411,6 @@ bool QClipboard::ownsMode(Mode mode) const
     }
 }
 
-void QClipboard::ownerDestroyed()
-{
-}
-
 QT_END_NAMESPACE
 
 #endif // QT_NO_CLIPBOARD
index ab02c5d..77a8b52 100644 (file)
@@ -857,13 +857,6 @@ static Atom send_selection(QClipboardData *d, Atom target, Window window, Atom p
 }
 
 /*! \internal
-    Internal cleanup for Windows.
-*/
-void QClipboard::ownerDestroyed()
-{ }
-
-
-/*! \internal
     Internal optimization for Windows.
 */
 void QClipboard::connectNotify(const char *)
index 8abdf66..cb548c7 100644 (file)
@@ -98,7 +98,6 @@ public:
 private:
     friend class QApplication;
     friend class QApplicationPrivate;
-    friend class QBaseApplication;
 };
 
 QT_END_NAMESPACE
index 891ca13..c7b0e01 100644 (file)
 
     \sa setControlType(), controlType()
 */
-
-#ifdef QT3_SUPPORT
-/*!
-    \typedef QSizePolicy::SizeType
-    \compat
-
-    Use the QSizePolicy::Policy enum instead.
-*/
-
-/*!
-    \enum QSizePolicy::ExpandData
-    \compat
-
-    Use the Qt::Orientations enum instead.
-
-    \value NoDirection  Use 0 instead.
-    \value Horizontally  Use Qt::Horizontal instead.
-    \value Vertically  Use Qt::Vertical instead.
-    \value BothDirections  Use Qt::Horizontal | Qt::Vertical instead.
-*/
-
-/*!
-    \fn bool QSizePolicy::mayShrinkHorizontally() const
-
-    Use the horizontalPolicy() function combined with the
-    QSizePolicy::PolicyFlag enum instead.
-
-    \oldcode
-        bool policy = mayShrinkHorizontally();
-    \newcode
-        bool policy = horizontalPolicy() & QSizePolicy::ShrinkFlag;
-    \endcode
-*/
-
-/*!
-    \fn bool QSizePolicy::mayShrinkVertically() const
-
-    Use the verticalPolicy() function combined with the
-    QSizePolicy::PolicyFlag enum instead.
-
-    \oldcode
-        bool policy = mayShrinkVertically();
-    \newcode
-        bool policy = verticalPolicy() & QSizePolicy::ShrinkFlag;
-    \endcode
-*/
-
-/*!
-    \fn bool QSizePolicy::mayGrowHorizontally() const
-
-    Use the horizontalPolicy() function combined with the
-    QSizePolicy::PolicyFlag enum instead.
-
-    \oldcode
-        bool policy = mayGrowHorizontally();
-    \newcode
-        bool policy = horizontalPolicy() & QSizePolicy::GrowFlag;
-    \endcode
-*/
-
-/*!
-    \fn bool QSizePolicy::mayGrowVertically() const
-
-    Use the verticalPolicy() function combined with the
-    QSizePolicy::PolicyFlag enum instead.
-
-    \oldcode
-        bool policy = mayGrowVertically();
-    \newcode
-        bool policy = verticalPolicy() & QSizePolicy::GrowFlag;
-    \endcode
-*/
-
-/*!
-    \fn Qt::QSizePolicy::Orientations QSizePolicy::expanding() const
-
-    Use expandingDirections() instead.
-*/
-
-/*!
-    \fn QSizePolicy::QSizePolicy(Policy horizontal, Policy vertical, bool dependent)
-
-    Use the QSizePolicy() constructor and the setHeightForWidth()
-    function instead.
-
-    \oldcode
-        QSizePolicy *policy = new QSizePolicy(horizontal, vertical, dependent);
-    \newcode
-        QSizePolicy *policy = new QSizePolicy(horizontal, vertical);
-        policy->setHeightForWidth(dependent);
-    \endcode
-*/
-
-/*!
-    \fn QSizePolicy::QSizePolicy(Policy horizontal, Policy vertical, uchar horizontalStretch,
-                                 uchar verticalStretch, bool dependent)
-
-    Use the QSizePolicy() constructor and call the
-    setHorizontalStretch(), setVerticalStretch(), and
-    setHeightForWidth() functions instead.
-
-    \oldcode
-        QSizePolicy *policy = new QSizePolicy(horizontal, vertical,
-                                                                 horizontalStretch, verticalStretch,
-                                                                 dependent);
-    \newcode
-        QSizePolicy *policy = new QSizePolicy(horizontal, vertical);
-        policy->setHorizontalStretch(horizontalStretch);
-        policy->setVerticalStretch(verticalStretch);
-        policy->setHeightForWidth(dependent);
-    \endcode
-*/
-
-/*!
-    \fn QSizePolicy::Policy QSizePolicy::horData() const
-
-    Use horizontalPolicy() instead.
-*/
-
-/*!
-    \fn QSizePolicy::Policy QSizePolicy::verData() const
-
-    Use verticalPolicy() instead.
-*/
-
-/*!
-    \fn void QSizePolicy::setHorData(Policy policy)
-
-    Use setHorizontalPolicy() instead.
-*/
-
-/*!
-    \fn void QSizePolicy::setVerData(Policy policy)
-
-    Use setVerticalPolicy() instead.
-*/
-
-/*!
-    \fn uint QSizePolicy::horStretch() const
-
-    Use horizontalStretch() instead.
-*/
-
-/*!
-    \fn uint QSizePolicy::verStretch() const
-
-    Use verticalStretch() instead.
-*/
-
-/*!
-    \fn void QSizePolicy::setHorStretch(uchar stretch)
-
-    Use setHorizontalStretch() instead.
-*/
-
-/*!
-    \fn void QSizePolicy::setVerStretch(uchar stretch)
-
-    Use setVerticalStretch() instead.
-*/
-#endif
index 45f2ec3..8f885df 100644 (file)
@@ -695,7 +695,6 @@ private:
     friend class QWidgetBackingStore;
     friend class QApplication;
     friend class QApplicationPrivate;
-    friend class QBaseApplication;
     friend class QPainter;
     friend class QPainterPrivate;
     friend class QPixmap; // for QPixmap::fill()
index b5c9afd..6460772 100644 (file)
@@ -1385,9 +1385,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event,
                     qrgn.translate(redirectionOffset);
                     QPaintEvent e(qrgn);
                     widget->d_func()->dirtyOnWidget = QRegion();
-#ifdef QT3_SUPPORT
-                    e.setErased(true);
-#endif
                     QApplication::sendSpontaneousEvent(widget, &e);
                     if (!redirectionOffset.isNull())
                         widget->d_func()->restoreRedirected();
index d84ed84..c9357ab 100644 (file)
@@ -388,11 +388,7 @@ static int getControlSize(const QStyleOption *option, const QWidget *widget)
 static inline bool isTreeView(const QWidget *widget)
 {
     return (widget && widget->parentWidget() &&
-            (qobject_cast<const QTreeView *>(widget->parentWidget())
-#ifdef QT3_SUPPORT
-             || widget->parentWidget()->inherits("Q3ListView")
-#endif
-             ));
+            (qobject_cast<const QTreeView *>(widget->parentWidget())));
 }
 
 QString qt_mac_removeMnemonics(const QString &original)
@@ -1491,11 +1487,7 @@ bool QMacStylePrivate::addWidget(QWidget *w)
             startAnimate(AquaPushButton, btn);
         return true;
     } else {
-        bool isProgressBar = (qobject_cast<QProgressBar *>(w)
-#ifdef QT3_SUPPORT
-                || w->inherits("Q3ProgressBar")
-#endif
-            );
+        bool isProgressBar = (qobject_cast<QProgressBar *>(w));
         if (isProgressBar) {
             w->installEventFilter(this);
             startAnimate(AquaProgressBar, w);
@@ -1514,11 +1506,7 @@ void QMacStylePrivate::removeWidget(QWidget *w)
     QPushButton *btn = qobject_cast<QPushButton *>(w);
     if (btn && btn == defaultButton) {
         stopAnimate(AquaPushButton, btn);
-    } else if (qobject_cast<QProgressBar *>(w)
-#ifdef QT3_SUPPORT
-            || w->inherits("Q3ProgressBar")
-#endif
-            ) {
+    } else if (qobject_cast<QProgressBar *>(w)) {
         stopAnimate(AquaProgressBar, w);
     }
 }
@@ -1563,21 +1551,6 @@ void QMacStylePrivate::timerEvent(QTimerEvent *)
                             pb->update();
                     }
                 }
-#ifdef QT3_SUPPORT
-                else {
-                    // Watch me now...
-                    QVariant progress = maybeProgress->property("progress");
-                    QVariant totalSteps = maybeProgress->property("totalSteps");
-                    if (progress.isValid() && totalSteps.isValid()) {
-                        int intProgress = progress.toInt();
-                        int intTotalSteps = totalSteps.toInt();
-                        if (intTotalSteps == 0 || intProgress > 0 && intProgress < intTotalSteps) {
-                            if (doAnimate(AquaProgressBar))
-                                maybeProgress->update();
-                        }
-                    }
-                }
-#endif
                 ++i;
             }
         }
@@ -2013,9 +1986,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
                 || (qobject_cast<const QMainWindow*>(widget->parentWidget())
                    && static_cast<QMainWindow *>(widget->parentWidget())->centralWidget() == widget))
                 && (qobject_cast<const QAbstractScrollArea *>(widget)
-#ifdef QT3_SUPPORT
-                    || widget->inherits("QScrollView")
-#endif
                     || widget->inherits("QWorkspaceChild")))
             ret = 0;
         else
@@ -2375,11 +2345,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
         break;
     case SH_ScrollView_FrameOnlyAroundContents:
         if (w && (w->isWindow() || !w->parentWidget() || w->parentWidget()->isWindow())
-                && (w->inherits("QWorkspaceChild")
-#ifdef QT3_SUPPORT
-                || w->inherits("QScrollView")
-#endif
-                ))
+                && (w->inherits("QWorkspaceChild")))
             ret = true;
         else
             ret = QWindowsStyle::styleHint(sh, opt, w, hret);
index 8cdfc3f..39133a4 100644 (file)
@@ -47,7 +47,7 @@
 //  -------------
 //
 // This file is not part of the Qt API.  It exists for the convenience
-// of qeffects.cpp, qcombobox.cpp, qpopupmenu.cpp and qtooltip.cpp.
+// of qeffects.cpp, qcombobox.cpp and qtooltip.cpp.
 // This header file may change from version to version without notice,
 // or even be removed.
 //