diff options
Diffstat (limited to 'examples/widgets/widgets/tooltips/sortingbox.h')
-rw-r--r-- | examples/widgets/widgets/tooltips/sortingbox.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h deleted file mode 100644 index 4fa9b4d36c..0000000000 --- a/examples/widgets/widgets/tooltips/sortingbox.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef SORTINGBOX_H -#define SORTINGBOX_H - -#include "shapeitem.h" - -#include <QWidget> - -QT_BEGIN_NAMESPACE -class QAction; -class QPoint; -class QToolButton; -QT_END_NAMESPACE - -//! [0] -class SortingBox : public QWidget -{ - Q_OBJECT - -public: - SortingBox(QWidget *parent = nullptr); - -protected: - bool event(QEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void paintEvent(QPaintEvent *event) override; - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - -private slots: - void createNewCircle(); - void createNewSquare(); - void createNewTriangle(); -//! [0] - -//! [1] -private: - int updateButtonGeometry(QToolButton *button, int x, int y); - void createShapeItem(const QPainterPath &path, const QString &toolTip, - const QPoint &pos, const QColor &color); - int itemAt(const QPoint &pos); - void moveItemTo(const QPoint &pos); - QPoint initialItemPosition(const QPainterPath &path); - QPoint randomItemPosition(); - QColor initialItemColor(); - QColor randomItemColor(); - QToolButton *createToolButton(const QString &toolTip, const QIcon &icon, -//! [1] - const char *member); - -//! [2] - QList<ShapeItem> shapeItems; - QPainterPath circlePath; - QPainterPath squarePath; - QPainterPath trianglePath; - - QPoint previousPosition; - ShapeItem *itemInMotion; - - QToolButton *newCircleButton; - QToolButton *newSquareButton; - QToolButton *newTriangleButton; -}; -//! [2] - -#endif |