OSDN Git Service

namespace cleanup
authorIvailo Monev <xakepa10@laimg.moc>
Tue, 7 May 2019 15:37:59 +0000 (15:37 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Tue, 7 May 2019 15:37:59 +0000 (15:37 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
12 files changed:
src/core/global/qnamespace.h
src/core/global/qnamespace.qdoc
src/designer/components/formeditor/formwindow.cpp
src/gui/kernel/qapplication_x11.cpp
src/gui/kernel/qevent.cpp
src/gui/styles/qcommonstyle.cpp
src/gui/text/qtextcontrol.cpp
src/gui/util/qsystemtrayicon_x11.cpp
src/gui/widgets/qlinecontrol.cpp
src/gui/widgets/qlineedit.cpp
src/gui/widgets/qmdiarea.cpp
src/gui/widgets/qscrollbar.cpp

index 776b08b..24629c5 100644 (file)
@@ -144,8 +144,7 @@ public:
         NoButton         = 0x00000000,
         LeftButton       = 0x00000001,
         RightButton      = 0x00000002,
-        MidButton        = 0x00000004, // ### Qt 5: remove me
-        MiddleButton     = MidButton,
+        MiddleButton     = 0x00000004,
         XButton1         = 0x00000008,
         XButton2         = 0x00000010,
         MouseButtonMask  = 0x000000ff
@@ -157,7 +156,6 @@ public:
         Horizontal = 0x1,
         Vertical = 0x2
     };
-
     Q_DECLARE_FLAGS(Orientations, Orientation)
 
     enum FocusPolicy {
@@ -182,7 +180,6 @@ public:
     // Text formatting flags for QPainter::drawText and QLabel.
     // The following two enums can be combined to one integer which
     // is passed as 'flags' to drawText and qt_format_text.
-
     enum AlignmentFlag {
         AlignLeft = 0x0001,
         AlignLeading = AlignLeft,
@@ -200,7 +197,6 @@ public:
 
         AlignCenter = AlignVCenter | AlignHCenter
     };
-
     Q_DECLARE_FLAGS(Alignment, AlignmentFlag)
 
     enum TextFlag {
@@ -218,7 +214,6 @@ public:
         TextForceRightToLeft = 0x40000,
         TextLongestVariant = 0x80000,
         TextBypassShaping = 0x100000
-
     };
 
     enum TextElideMode {
@@ -267,7 +262,6 @@ public:
         WindowFullScreen = 0x00000004,
         WindowActive     = 0x00000008
     };
-
     Q_DECLARE_FLAGS(WindowStates, WindowState)
 
     enum WidgetAttribute {
@@ -404,10 +398,8 @@ public:
         AA_AttributeCount
     };
 
-
     // Image conversion flags.  The unusual ordering is caused by
     // compatibility and default requirements.
-
     enum ImageConversionFlag {
         ColorMode_Mask          = 0x00000003,
         AutoColor               = 0x00000000,
@@ -442,7 +434,6 @@ public:
         OpaqueMode
     };
 
-
     enum Key {
         Key_Escape = 0x01000000,                // misc keys
         Key_Tab = 0x01000001,
@@ -916,7 +907,7 @@ public:
         RightArrow
     };
 
-    enum PenStyle { // pen style
+    enum PenStyle {
         NoPen,
         SolidLine,
         DashLine,
@@ -929,14 +920,16 @@ public:
 #endif
     };
 
-    enum PenCapStyle { // line endcap style
+    // line endcap style
+    enum PenCapStyle {
         FlatCap = 0x00,
         SquareCap = 0x10,
         RoundCap = 0x20,
         MPenCapStyle = 0x30
     };
 
-    enum PenJoinStyle { // line join style
+    // line join style
+    enum PenJoinStyle {
         MiterJoin = 0x00,
         BevelJoin = 0x40,
         RoundJoin = 0x80,
@@ -944,7 +937,7 @@ public:
         MPenJoinStyle = 0x1c0
     };
 
-    enum BrushStyle { // brush style
+    enum BrushStyle {
         NoBrush,
         SolidPattern,
         Dense1Pattern,
@@ -971,7 +964,6 @@ public:
         RelativeSize
     };
 
-
     enum UIEffect {
         UI_General,
         UI_AnimateMenu,
@@ -1042,7 +1034,6 @@ public:
     enum DockWidgetAreaSizes {
         NDockWidgetAreas = 4
     };
-
     Q_DECLARE_FLAGS(DockWidgetAreas, DockWidgetArea)
 
     enum ToolBarArea {
@@ -1059,10 +1050,8 @@ public:
     enum ToolBarAreaSizes {
         NToolBarAreas = 4
     };
-
     Q_DECLARE_FLAGS(ToolBarAreas, ToolBarArea)
 
-
     enum DateFormat {
         TextDate,      // default Qt
         ISODate,       // ISO 8601
@@ -1097,7 +1086,6 @@ public:
         ScrollBarAlwaysOn
     };
 
-
     enum CaseSensitivity {
         CaseInsensitive,
         CaseSensitive
@@ -1204,8 +1192,6 @@ public:
         AnchorBottom
     };
 
-
-
     enum DropAction {
         CopyAction = 0x1,
         MoveAction = 0x2,
@@ -1428,13 +1414,13 @@ public:
         Printer           = 4,
         CustomRaster      = 5
     };
+
     enum RelayoutType {
         RelayoutNormal,
         RelayoutDragging,
         RelayoutDropped
     };
 
-
     enum Callback {
         ConnectCallback,
         DisconnectCallback,
@@ -1469,7 +1455,6 @@ public:
     static bool callFunction(InternalFunction func, void **);
 };
 
-
 QT_END_NAMESPACE
 
 QT_END_HEADER
index 4b3097d..f193365 100644 (file)
     to the left button. (The left button may be the right button on
     left-handed mice.)
     \value RightButton     The right button.
-    \value MidButton       The middle button.
     \value MiddleButton    The middle button.
     \value XButton1        The first X button.
     \value XButton2        The second X button.
index f80af61..cd028a8 100644 (file)
@@ -595,7 +595,7 @@ bool FormWindow::handleMousePressEvent(QWidget * widget, QWidget *managedWidget,
         core()->formWindowManager()->setActiveFormWindow(this);
 
     const Qt::MouseButtons buttons = e->buttons();
-    if (buttons != Qt::LeftButton && buttons != Qt::MidButton)
+    if (buttons != Qt::LeftButton && buttons != Qt::MiddleButton)
         return true;
 
     m_startPos = mapFromGlobal(e->globalPos());
@@ -603,7 +603,7 @@ bool FormWindow::handleMousePressEvent(QWidget * widget, QWidget *managedWidget,
     if (debugFormWindow)
         qDebug() << "handleMousePressEvent:" <<  widget << ',' << managedWidget;
 
-    if (buttons == Qt::MidButton || isMainContainer(managedWidget) == true) { // press was on the formwindow
+    if (buttons == Qt::MiddleButton || isMainContainer(managedWidget) == true) { // press was on the formwindow
         clearObjectInspectorSelection(m_core);  // We might have a toolbar or non-widget selected in the object inspector.
         clearSelection(false);
 
@@ -782,7 +782,7 @@ bool FormWindow::handleMouseReleaseEvent(QWidget *w, QWidget *mw, QMouseEvent *e
      * MousePressEvent. */
     switch (e->button()) {
     case Qt::LeftButton:
-    case Qt::MidButton:
+    case Qt::MiddleButton:
     case Qt::RightButton:
         emitSelectionChanged();
         break;
index be5b7fa..47315dd 100644 (file)
@@ -2997,7 +2997,7 @@ static Qt::MouseButtons translateMouseButtons(int s)
     if (s & Button1Mask)
         ret |= Qt::LeftButton;
     if (s & Button2Mask)
-        ret |= Qt::MidButton;
+        ret |= Qt::MiddleButton;
     if (s & Button3Mask)
         ret |= Qt::RightButton;
     // X11 has no special state for XButton1 and XButton2, so we need to use
@@ -3114,7 +3114,7 @@ bool QETWidget::translateMouseEvent(const XEvent *event)
         modifiers = qt_x11Data->translateModifiers(event->xbutton.state);
         switch (event->xbutton.button) {
         case Button1: button = Qt::LeftButton; break;
-        case Button2: button = Qt::MidButton; break;
+        case Button2: button = Qt::MiddleButton; break;
         case Button3: button = Qt::RightButton; break;
         case Button4:
         case Button5:
index f117d50..7cc790f 100644 (file)
@@ -329,7 +329,7 @@ QMouseEventEx::~QMouseEventEx()
 
     Returns the button state when the event was generated. The button
     state is a combination of Qt::LeftButton, Qt::RightButton,
-    Qt::MidButton using the OR operator. For mouse move events,
+    Qt::MiddleButton using the OR operator. For mouse move events,
     this is all buttons that are pressed down. For mouse press and
     double click events this includes the button that caused the
     event. For mouse release events this excludes the button that
@@ -1333,7 +1333,7 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
 
     The returned value is a selection of the following values,
     combined with the OR operator:
-    Qt::LeftButton, Qt::RightButton, Qt::MidButton,
+    Qt::LeftButton, Qt::RightButton, Qt::MiddleButton,
     Qt::ShiftButton, Qt::ControlButton, and Qt::AltButton.
 */
 
index 5f7dbb5..cd65589 100644 (file)
@@ -4679,7 +4679,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
         ret = false;
         break;
     case SH_Slider_AbsoluteSetButtons:
-        ret = Qt::MidButton;
+        ret = Qt::MiddleButton;
         break;
     case SH_Slider_PageSetButtons:
         ret = Qt::LeftButton;
index 8123530..3c8979e 100644 (file)
@@ -1691,7 +1691,7 @@ void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, c
 #ifndef QT_NO_CLIPBOARD
         setClipboardSelection();
         selectionChanged(true);
-    } else if (button == Qt::MidButton
+    } else if (button == Qt::MiddleButton
                && (interactionFlags & Qt::TextEditable)
                && QApplication::clipboard()->supportsSelection()) {
         setCursorPosition(pos);
index 87b6050..2c74501 100644 (file)
@@ -298,7 +298,7 @@ void QSystemTrayIconSys::mousePressEvent(QMouseEvent *ev)
         emit q->activated(QSystemTrayIcon::Trigger);
     else if (ev->button() == Qt::RightButton)
         emit q->activated(QSystemTrayIcon::Context);
-    else if (ev->button() == Qt::MidButton)
+    else if (ev->button() == Qt::MiddleButton)
         emit q->activated(QSystemTrayIcon::MiddleClick);
 }
 
index c98630b..52076e5 100644 (file)
@@ -1449,7 +1449,7 @@ void QLineControl::processMouseEvent(QMouseEvent* ev)
             if (QApplication::clipboard()->supportsSelection()) {
                 if (ev->button() == Qt::LeftButton) {
                     copy(QClipboard::Selection);
-                } else if (!isReadOnly() && ev->button() == Qt::MidButton) {
+                } else if (!isReadOnly() && ev->button() == Qt::MiddleButton) {
                     deselect();
                     insert(QApplication::clipboard()->text(QClipboard::Selection));
                 }
index ba0495f..208489d 100644 (file)
@@ -1424,7 +1424,7 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e)
     if (QApplication::clipboard()->supportsSelection()) {
         if (e->button() == Qt::LeftButton) {
             d->control->copy(QClipboard::Selection);
-        } else if (!d->control->isReadOnly() && e->button() == Qt::MidButton) {
+        } else if (!d->control->isReadOnly() && e->button() == Qt::MiddleButton) {
             deselect();
             insert(QApplication::clipboard()->text(QClipboard::Selection));
         }
index 78973ba..e9f2356 100644 (file)
@@ -553,7 +553,7 @@ private:
 */
 void QMdiAreaTabBar::mousePressEvent(QMouseEvent *event)
 {
-    if (event->button() != Qt::MidButton) {
+    if (event->button() != Qt::MiddleButton) {
         QTabBar::mousePressEvent(event);
         return;
     }
index a0180dc..e2adb75 100644 (file)
@@ -527,7 +527,7 @@ void QScrollBar::mousePressEvent(QMouseEvent *e)
 
     if (d->maximum == d->minimum // no range
         || (e->buttons() & (~e->button())) // another button was clicked before
-        || !(e->button() == Qt::LeftButton || (midButtonAbsPos && e->button() == Qt::MidButton)))
+        || !(e->button() == Qt::LeftButton || (midButtonAbsPos && e->button() == Qt::MiddleButton)))
         return;
 
     d->pressedControl = style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, e->pos(), this);
@@ -546,7 +546,7 @@ void QScrollBar::mousePressEvent(QMouseEvent *e)
 
     if ((d->pressedControl == QStyle::SC_ScrollBarAddPage
           || d->pressedControl == QStyle::SC_ScrollBarSubPage)
-        && ((midButtonAbsPos && e->button() == Qt::MidButton)
+        && ((midButtonAbsPos && e->button() == Qt::MiddleButton)
             || (style()->styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition, &opt, this)
                 && e->button() == Qt::LeftButton))) {
         int sliderLength = HORIZONTAL ? sr.width() : sr.height();
@@ -601,7 +601,7 @@ void QScrollBar::mouseMoveEvent(QMouseEvent *e)
     QStyleOptionSlider opt;
     initStyleOption(&opt);
     if (!(e->buttons() & Qt::LeftButton
-          ||  ((e->buttons() & Qt::MidButton)
+          ||  ((e->buttons() & Qt::MiddleButton)
                && style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition, &opt, this))))
         return;