diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-01-09 13:31:54 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-01-17 06:42:04 +0100 |
commit | 2951f72584e70ddf31c1ef644f7eb8643da0084b (patch) | |
tree | 64b915e153846f9b911fa20c8d8c73d9d6d8f85a /examples/widgets/doc | |
parent | ca772a8ffa2fdde4238ff0af325997dd78dbfe83 (diff) |
Remove mousebuttons examples
The example didn't show anything useful, and seemed more like a
manual test case.
Pick-to: 6.5
Change-Id: Ia71f39b26943aab04b6895e63b6eed50dd084bfd
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r-- | examples/widgets/doc/images/mousebutton-buttontester.png | bin | 17428 -> 0 bytes | |||
-rw-r--r-- | examples/widgets/doc/mousebuttons.qdoc | 70 |
2 files changed, 0 insertions, 70 deletions
diff --git a/examples/widgets/doc/images/mousebutton-buttontester.png b/examples/widgets/doc/images/mousebutton-buttontester.png Binary files differdeleted file mode 100644 index f8f71db59b..0000000000 --- a/examples/widgets/doc/images/mousebutton-buttontester.png +++ /dev/null diff --git a/examples/widgets/doc/mousebuttons.qdoc b/examples/widgets/doc/mousebuttons.qdoc deleted file mode 100644 index ecf46dc094..0000000000 --- a/examples/widgets/doc/mousebuttons.qdoc +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// Copyright (C) 2016 Rick Stockton <rickstockton@reno-computerhelp.com> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example widgets/mousebuttons - \title Mouse Button Tester - - \brief The 'Mouse Button Tester' example demonstrates how to reimplement - mouse events within a custom class. You can also use this program to - verify that Qt is actually receiving mouse events from your mouse. - - Many 'gamer' mouse devices are configured with high-numbered "buttons" - sending text shortcuts for certain games. With such a mouse, no mouse - button events occur: The "mouse" sends keystrokes, and the - 'Mouse Button Tester' Window will not see the event. Receiving no event, - it will not repaint the Window with new text describing a button event. - - And so, in addition to it's use as Qt example code, the program may be - useful s a mouse device tester. Note that there is another example - mouse buttons example which provides the same function, written in QML. - - This program (the Widget-based example) consists of three classes, - in addition to the main() parent program: - - \list - \li \c A QPushButton, "Quit". - \li \c ButtonTester. This is derived from Qt's TextArea class, for - purpose of customizing/re-implementing the mouse and wheel event - member functions. - \li \c A simple QVBoxLayout layout. - \endlist - - First we will review the main program, with it's layout and "Quit" - QPushButton. Then we will take a look at the \c ButtonTester class. - - \section1 The Main Program - - Note that the QPushButton, "Quit", is defined directly within the main() - program, rather than another class. This is a correct way of defining a - "Quit" QPushButton: A "Quit" Button defined inside another - class would result in the destructor of that second class being - called twice. This "Quit" Button uses the traditional Signal/Slot - connection to invoke termination of the QApp, which will properly destroy - its child classes before terminating itself. - - The remainder of the main() program is concerned with defining the layout, - and applying a minimum size to the customized ButtonTester. - - \section1 ButtonTester Class Definition - - The \c ButtonTester class inherits from QTextEdit, and listens for - mouse events on all possible Qt::MouseButton values. It also listens for - wheel events from the mouse, and indicates the direction of wheel motion - ("up", down", "left", or "right"). It prints short debug messages into - the Window, and also on the console QDebug() stream, when mouse button - and wheel events occur. Our reimplementation of mousePressEvent(), - mouseReleaseEvent(), mouseDoubleClickEvent(), and wheelEvent() "drive" - the program; the other functions simply convert the Qt::MouseButton - values into text strings. - - You should call the ignore() function on any mouse event (or other event) - which your widget-based classes do not use and consume. This function - assures that Qt will propagate the event through each parent widget, - until it is used or propagated to the Window Manager. (Qt attempts to do - this automatically, but it is better programming practice to explicitly - invoke the function.) - - \image mousebutton-buttontester.png -*/ |