From: Ivailo Monev Date: Sat, 8 Jun 2019 14:35:26 +0000 (+0000) Subject: events cleanup X-Git-Tag: 4.12.0~5817 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4b3b1bcdbee75b04c435519b148fa7336661b3a7;p=kde%2FKatie.git events cleanup Signed-off-by: Ivailo Monev --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b42a8cbd1..b74f189bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -749,7 +749,6 @@ katie_generate_obsolete(qplaintextdocumentlayout.h QtGui qplaintextedit.h) katie_generate_obsolete(qgraphicsopacityeffect.h QtGui qgraphicseffect.h) katie_generate_obsolete(qpinchgesture.h QtGui qgesture.h) katie_generate_obsolete(qgestureevent.h QtGui qevent.h) -katie_generate_obsolete(qicondragevent.h QtGui qevent.h) katie_generate_obsolete(qiconenginefactoryinterface.h QtGui qiconengineplugin.h) katie_generate_obsolete(qiconenginefactoryinterfacev2.h QtGui qiconengineplugin.h) katie_generate_obsolete(qiconenginepluginv2.h QtGui qiconengineplugin.h) diff --git a/scripts/incfsck.py b/scripts/incfsck.py index c32c2c2d0..6a91c121c 100755 --- a/scripts/incfsck.py +++ b/scripts/incfsck.py @@ -180,7 +180,6 @@ incmap = { 'QHelpEvent': 'qevent.h', 'QHideEvent': 'qevent.h', 'QHoverEvent': 'qevent.h', - 'QIconDragEvent': 'qevent.h', 'QIconEngineFactoryInterface': 'qiconengineplugin.h', 'QIconEngineFactoryInterfaceV2': 'qiconengineplugin.h', 'QIconEnginePluginV2': 'qiconengineplugin.h', diff --git a/scripts/namefsck.py b/scripts/namefsck.py index ea2d3249c..2a63ad622 100755 --- a/scripts/namefsck.py +++ b/scripts/namefsck.py @@ -318,7 +318,6 @@ classlist = { "QHttpRequestHeader", "QHttpResponseHeader", "QIcon", - "QIconDragEvent", "QIconEngine", "QIconEngineFactoryInterface", "QIconEngineFactoryInterfaceV2", @@ -773,7 +772,6 @@ classlist = { "QtMsgHandler", "QtNetwork", "QToolBar", - "QToolBarChangeEvent", "QToolBox", "QToolButton", "QToolTip", diff --git a/src/core/kernel/qcoreevent.cpp b/src/core/kernel/qcoreevent.cpp index 1b67d5ccc..80506a27d 100644 --- a/src/core/kernel/qcoreevent.cpp +++ b/src/core/kernel/qcoreevent.cpp @@ -124,7 +124,6 @@ QT_BEGIN_NAMESPACE \value Enter Mouse enters widget's boundaries. \value EnterEditFocus An editor widget gains focus for editing. \value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode. - \value FileOpen File open request (QFileOpenEvent). \value FocusIn Widget gains keyboard focus (QFocusEvent). \value FocusOut Widget loses keyboard focus (QFocusEvent). \value FontChange Widget's font has changed. @@ -143,15 +142,14 @@ QT_BEGIN_NAMESPACE \value GraphicsSceneMouseMove Move mouse in a graphics scene (QGraphicsSceneMouseEvent). \value GraphicsSceneMousePress Mouse press in a graphics scene (QGraphicsSceneMouseEvent). \value GraphicsSceneMouseRelease Mouse release in a graphics scene (QGraphicsSceneMouseEvent). - \value GraphicsSceneMove Widget was moved (QGraphicsSceneMoveEvent). - \value GraphicsSceneResize Widget was resized (QGraphicsSceneResizeEvent). + \value GraphicsSceneMove Graphics scene was moved (QGraphicsSceneMoveEvent). + \value GraphicsSceneResize Graphics scene was resized (QGraphicsSceneResizeEvent). \value GraphicsSceneWheel Mouse wheel rolled in a graphics scene (QGraphicsSceneWheelEvent). \value Hide Widget was hidden (QHideEvent). \value HideToParent A child widget has been hidden. \value HoverEnter The mouse cursor enters a hover widget (QHoverEvent). \value HoverLeave The mouse cursor leaves a hover widget (QHoverEvent). \value HoverMove The mouse cursor moves inside a hover widget (QHoverEvent). - \value IconDrag The main icon of a window has been dragged away (QIconDragEvent). \value IconTextChange Widget's icon text has been changed. \value KeyPress Key press (QKeyEvent). \value KeyRelease Key release (QKeyEvent). @@ -191,7 +189,6 @@ QT_BEGIN_NAMESPACE \value StatusTip A status tip is requested (QStatusTipEvent). \value StyleChange Widget's style has been changed. \value Timer Regular timer events (QTimerEvent). - \value ToolBarChange The toolbar button is toggled on Mac OS X. \value ToolTip A tooltip was requested (QHelpEvent). \value ToolTipChange The widget's tooltip has changed. \value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only). @@ -233,7 +230,6 @@ QT_BEGIN_NAMESPACE \omitvalue AccelAvailable \omitvalue AccelOverride \omitvalue AcceptDropsChange - \omitvalue CaptionChange \omitvalue ChildInsertedRequest \omitvalue ChildInserted \omitvalue Create @@ -247,8 +243,6 @@ QT_BEGIN_NAMESPACE \omitvalue Speech \omitvalue Style \omitvalue ThreadChange - \omitvalue ApplicationActivated - \omitvalue ApplicationDeactivated \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue NativeGesture diff --git a/src/core/kernel/qcoreevent.h b/src/core/kernel/qcoreevent.h index f4f3e37be..c3230c93a 100644 --- a/src/core/kernel/qcoreevent.h +++ b/src/core/kernel/qcoreevent.h @@ -117,113 +117,109 @@ public: LayoutDirectionChange = 59, // the layout direction changed Style = 60, // internal style event - IconDrag = 61, // proxy icon dragged + FontChange = 61, // font has changed + EnabledChange = 62, // enabled state has changed + ActivationChange = 63, // window activation has changed + StyleChange = 64, // style has changed + IconTextChange = 65, // icon text has changed + ModifiedChange = 66, // modified state has changed + MouseTrackingChange = 67, // mouse tracking state has changed - FontChange = 62, // font has changed - EnabledChange = 63, // enabled state has changed - ActivationChange = 64, // window activation has changed - StyleChange = 65, // style has changed - IconTextChange = 66, // icon text has changed - ModifiedChange = 67, // modified state has changed - MouseTrackingChange = 68, // mouse tracking state has changed + WindowBlocked = 68, // window is about to be blocked modally + WindowUnblocked = 69, // windows modal blocking has ended + WindowStateChange = 70, - WindowBlocked = 69, // window is about to be blocked modally - WindowUnblocked = 70, // windows modal blocking has ended - WindowStateChange = 71, + ToolTip = 71, + WhatsThis = 72, + StatusTip = 73, - ToolTip = 72, - WhatsThis = 73, - StatusTip = 74, + ActionChanged = 74, + ActionAdded = 75, + ActionRemoved = 76, - ActionChanged = 75, - ActionAdded = 76, - ActionRemoved = 77, + Shortcut = 77, // shortcut triggered + ShortcutOverride = 78, // shortcut override request - Shortcut = 78, // shortcut triggered - ShortcutOverride = 79, // shortcut override request + WhatsThisClicked = 79, - WhatsThisClicked = 80, + ApplicationActivate = 80, // application has been changed to active + ApplicationDeactivate = 81, // application has been changed to inactive - ToolBarChange = 81, // toolbar visibility toggled + QueryWhatsThis = 82, // query what's this widget help + EnterWhatsThisMode = 83, + LeaveWhatsThisMode = 84, - ApplicationActivate = 82, // application has been changed to active - ApplicationDeactivate = 83, // application has been changed to inactive + ZOrderChange = 85, // child widget has had its z-order changed - QueryWhatsThis = 84, // query what's this widget help - EnterWhatsThisMode = 85, - LeaveWhatsThisMode = 86, + HoverEnter = 86, // mouse cursor enters a hover widget + HoverLeave = 87, // mouse cursor leaves a hover widget + HoverMove = 88, // mouse cursor move inside a hover widget - ZOrderChange = 87, // child widget has had its z-order changed - - HoverEnter = 88, // mouse cursor enters a hover widget - HoverLeave = 89, // mouse cursor leaves a hover widget - HoverMove = 90, // mouse cursor move inside a hover widget - - AccessibilityHelp = 91, // accessibility help text request - AccessibilityDescription = 92, // accessibility description text request + AccessibilityHelp = 89, // accessibility help text request + AccessibilityDescription = 90, // accessibility description text request #ifdef QT_KEYPAD_NAVIGATION - EnterEditFocus = 93, // enter edit mode in keypad navigation (Defined only with QT_KEYPAD_NAVIGATION) - LeaveEditFocus = 94, // leave edit mode in keypad navigation (Defined only with QT_KEYPAD_NAVIGATION) + EnterEditFocus = 91, // enter edit mode in keypad navigation (Defined only with QT_KEYPAD_NAVIGATION) + LeaveEditFocus = 92, // leave edit mode in keypad navigation (Defined only with QT_KEYPAD_NAVIGATION) #endif - AcceptDropsChange = 95, + AcceptDropsChange = 93, - GraphicsSceneMouseMove = 96, // GraphicsView - GraphicsSceneMousePress = 97, - GraphicsSceneMouseRelease = 98, - GraphicsSceneMouseDoubleClick = 99, - GraphicsSceneContextMenu = 100, - GraphicsSceneHoverEnter = 101, - GraphicsSceneHoverMove = 102, - GraphicsSceneHoverLeave = 103, - GraphicsSceneLeave = 104, // internal - GraphicsSceneHelp = 105, - GraphicsSceneDragEnter = 106, - GraphicsSceneDragMove = 107, - GraphicsSceneDragLeave = 108, - GraphicsSceneDrop = 109, - GraphicsSceneWheel = 110, + GraphicsSceneMouseMove = 94, // GraphicsView + GraphicsSceneMousePress = 95, + GraphicsSceneMouseRelease = 96, + GraphicsSceneMouseDoubleClick = 97, + GraphicsSceneContextMenu = 98, + GraphicsSceneHoverEnter = 99, + GraphicsSceneHoverMove = 100, + GraphicsSceneHoverLeave = 101, + GraphicsSceneLeave = 102, // internal + GraphicsSceneHelp = 103, + GraphicsSceneDragEnter = 104, + GraphicsSceneDragMove = 105, + GraphicsSceneDragLeave = 106, + GraphicsSceneDrop = 107, + GraphicsSceneWheel = 108, - KeyboardLayoutChange = 111, // keyboard layout changed + KeyboardLayoutChange = 109, // keyboard layout changed - DynamicPropertyChange = 112, // A dynamic property was changed through setProperty/property + DynamicPropertyChange = 110, // A dynamic property was changed through setProperty/property - NonClientAreaMouseMove = 113, - NonClientAreaMouseButtonPress = 114, - NonClientAreaMouseButtonRelease = 115, - NonClientAreaMouseButtonDblClick = 116, + NonClientAreaMouseMove = 111, + NonClientAreaMouseButtonPress = 112, + NonClientAreaMouseButtonRelease = 113, + NonClientAreaMouseButtonDblClick = 114, - ContentsRectChange = 117, // sent by QWidget::setContentsMargins (internal) + ContentsRectChange = 115, // sent by QWidget::setContentsMargins (internal) - FutureCallOut = 118, + FutureCallOut = 116, - GraphicsSceneResize = 119, - GraphicsSceneMove = 120, + GraphicsSceneResize = 117, + GraphicsSceneMove = 118, - CursorChange = 121, - ToolTipChange = 122, + CursorChange = 119, + ToolTipChange = 120, - NetworkReplyUpdated = 123, // Internal for QNetworkReply + NetworkReplyUpdated = 121, // Internal for QNetworkReply - GrabMouse = 124, - UngrabMouse = 125, - GrabKeyboard = 126, - UngrabKeyboard = 127, + GrabMouse = 122, + UngrabMouse = 123, + GrabKeyboard = 124, + UngrabKeyboard = 125, - TouchBegin = 128, - TouchUpdate = 129, - TouchEnd = 130, + TouchBegin = 126, + TouchUpdate = 127, + TouchEnd = 128, #ifndef QT_NO_GESTURES - NativeGesture = 131, // Internal for platform gesture support + NativeGesture = 129, // Internal for platform gesture support #endif - RequestSoftwareInputPanel = 132, - CloseSoftwareInputPanel = 133, + RequestSoftwareInputPanel = 130, + CloseSoftwareInputPanel = 131, - WinIdChange = 134, + WinIdChange = 132, #ifndef QT_NO_GESTURES - Gesture = 135, - GestureOverride = 136, + Gesture = 133, + GestureOverride = 134, #endif User = 1000, // first user event id diff --git a/src/designer/components/formeditor/formwindowmanager.cpp b/src/designer/components/formeditor/formwindowmanager.cpp index bc5bb5095..9c8059132 100644 --- a/src/designer/components/formeditor/formwindowmanager.cpp +++ b/src/designer/components/formeditor/formwindowmanager.cpp @@ -187,7 +187,6 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e) case QEvent::StatusTip: case QEvent::StyleChange: case QEvent::Timer: - case QEvent::ToolBarChange: case QEvent::ToolTip: case QEvent::WhatsThis: case QEvent::WhatsThisClicked: diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 088dfbb31..3df4aee29 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -115,7 +115,6 @@ set(GUI_PUBLIC_HEADERS QGroupBox QHeaderView QIcon - QIconDragEvent QIconEngine QIconEngineFactoryInterface QIconEngineFactoryInterfaceV2 @@ -296,7 +295,6 @@ set(GUI_PUBLIC_HEADERS QTextTableCellFormat QTileRules QToolBar - QToolBarChangeEvent QToolBox QToolButton QToolTip diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4dd7f805a..2ccc78199 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3250,7 +3250,6 @@ bool QApplication::notify(QObject *receiver, QEvent *e) case QEvent::AccessibilityPrepare: case QEvent::LocaleChange: case QEvent::Style: - case QEvent::IconDrag: case QEvent::StyleChange: case QEvent::AccessibilityHelp: case QEvent::AccessibilityDescription: diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index ad929b781..44ebe17c1 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -862,7 +862,7 @@ void QClipboard::connectNotify(const char *) bool QClipboard::event(QEvent *e) { if (e->type() == QEvent::Timer) { - QTimerEvent *te = (QTimerEvent *) e; + QTimerEvent *te = static_cast(e); if (waiting_for_data) // should never happen return false; @@ -929,9 +929,9 @@ bool QClipboard::event(QEvent *e) ATOM(_QT_SELECTION), ownerId, qt_x11Data->time); XSync(dpy, false); - XEvent event; + XEvent waitevent; // waiting until the clipboard manager fetches the content. - if (!qt_x11Data->clipboardWaitForEvent(ownerId, SelectionNotify, &event, 10000, true)) { + if (!qt_x11Data->clipboardWaitForEvent(ownerId, SelectionNotify, &waitevent, 10000, true)) { qWarning("QClipboard: Unable to receive an event from the " "clipboard manager in a reasonable time"); } diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index baecc16f3..420b60a93 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1169,37 +1169,6 @@ QCloseEvent::~QCloseEvent() } /*! - \class QIconDragEvent - \brief The QIconDragEvent class indicates that a main icon drag has begun. - - \ingroup events - - Icon drag events are sent to widgets when the main icon of a window - has been dragged away. On Mac OS X, this happens when the proxy - icon of a window is dragged off the title bar. - - It is normal to begin using drag and drop in response to this - event. - - \sa {Drag and Drop}, QMimeData, QDrag -*/ - -/*! - Constructs an icon drag event object with the accept flag set to - false. - - \sa accept() -*/ -QIconDragEvent::QIconDragEvent() - : QEvent(IconDrag) -{ ignore(); } - -/*! \internal */ -QIconDragEvent::~QIconDragEvent() -{ -} - -/*! \class QContextMenuEvent \brief The QContextMenuEvent class contains parameters that describe a context menu event. @@ -2097,53 +2066,6 @@ QShowEvent::~QShowEvent() Use QDropEvent::encodedData(). */ -#ifndef QT_NO_TOOLBAR -/*! - \internal - \class QToolBarChangeEvent - \brief The QToolBarChangeEvent class provides an event that is - sent whenever a the toolbar button is clicked on Mac OS X. - - \ingroup events - - The QToolBarChangeEvent is sent when the toolbar button is clicked. On Mac - OS X, this is the long oblong button on the right side of the window - title bar. The default implementation is to toggle the appearance (hidden or - shown) of the associated toolbars for the window. -*/ - -/*! - \internal - - Construct a QToolBarChangeEvent given the current button state in \a state. -*/ -QToolBarChangeEvent::QToolBarChangeEvent(bool t) - : QEvent(ToolBarChange), tog(t) -{} - -/*! \internal -*/ -QToolBarChangeEvent::~QToolBarChangeEvent() -{ -} - -/*! - \fn bool QToolBarChangeEvent::toggle() const - \internal -*/ - -/* - \fn Qt::ButtonState QToolBarChangeEvent::state() const - - Returns the keyboard modifier flags at the time of the event. - - The returned value is a selection of the following values, - combined using the OR operator: - Qt::ShiftButton, Qt::ControlButton, Qt::MetaButton, and Qt::AltButton. -*/ - -#endif // QT_NO_TOOLBAR - #ifndef QT_NO_SHORTCUT /*! diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 25fa7f21f..a3c74116e 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -269,14 +269,6 @@ public: }; -class Q_GUI_EXPORT QIconDragEvent : public QEvent -{ -public: - QIconDragEvent(); - ~QIconDragEvent(); -}; - - class Q_GUI_EXPORT QShowEvent : public QEvent { public: @@ -472,19 +464,6 @@ public: }; #endif -#ifndef QT_NO_TOOLBAR -class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent -{ -public: - QToolBarChangeEvent(bool t); - ~QToolBarChangeEvent(); - - inline bool toggle() const { return tog; } -private: - bool tog; -}; -#endif - #ifndef QT_NO_SHORTCUT class Q_GUI_EXPORT QShortcutEvent : public QEvent { diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index f1173c245..a3eafde78 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7585,7 +7585,6 @@ bool QWidget::event(QEvent *event) d->resolvePalette(); break; - case QEvent::ToolBarChange: case QEvent::ActivationChange: case QEvent::EnabledChange: case QEvent::FontChange: @@ -7795,7 +7794,7 @@ bool QWidget::event(QEvent *event) The state being changed in this event can be retrieved through the \a event supplied. - Change events include: QEvent::ToolBarChange, + Change events include: QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange, QEvent::StyleChange, QEvent::PaletteChange, QEvent::WindowTitleChange, QEvent::IconTextChange, diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index fd24ac628..583530b8b 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1362,13 +1362,6 @@ bool QMainWindow::event(QEvent *event) #endif -#ifndef QT_NO_TOOLBAR - case QEvent::ToolBarChange: { - d->layout->toggleToolBarsVisible(); - return true; - } -#endif - #ifndef QT_NO_STATUSTIP case QEvent::StatusTip: #ifndef QT_NO_STATUSBAR diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index 9447662ea..bb5d33cc7 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -898,20 +898,6 @@ void QMainWindowLayout::getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar layoutState.toolBarAreaLayout.getStyleOptionInfo(option, toolBar); } -void QMainWindowLayout::toggleToolBarsVisible() -{ - layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible; - if (!layoutState.mainWindow->isMaximized()) { - QPoint topLeft = parentWidget()->geometry().topLeft(); - QRect r = parentWidget()->geometry(); - r = layoutState.toolBarAreaLayout.rectHint(r); - r.moveTo(topLeft); - parentWidget()->setGeometry(r); - } else { - update(); - } -} - #endif // QT_NO_TOOLBAR /****************************************************************************** diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index 7baf6cb07..2494128b9 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -176,7 +176,6 @@ public: bool toolBarBreak(QToolBar *toolBar) const; void getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar *toolBar) const; void removeToolBar(QToolBar *toolbar); - void toggleToolBarsVisible(); void moveToolBar(QToolBar *toolbar, int pos); #endif