| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QCOLUMNVIEWGRIP_P_H |
| 5 | #define QCOLUMNVIEWGRIP_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of other Qt classes. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
| 19 | #include <private/qwidget_p.h> |
| 20 | |
| 21 | QT_REQUIRE_CONFIG(columnview); |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QColumnViewGripPrivate; |
| 26 | |
| 27 | class Q_AUTOTEST_EXPORT QColumnViewGrip : public QWidget { |
| 28 | |
| 29 | Q_OBJECT |
| 30 | |
| 31 | Q_SIGNALS: |
| 32 | void gripMoved(int offset); |
| 33 | |
| 34 | public: |
| 35 | explicit QColumnViewGrip(QWidget *parent = nullptr); |
| 36 | ~QColumnViewGrip(); |
| 37 | int moveGrip(int offset); |
| 38 | |
| 39 | protected: |
| 40 | QColumnViewGrip(QColumnViewGripPrivate &, QWidget *parent = nullptr, Qt::WindowFlags f = { }); |
| 41 | void paintEvent(QPaintEvent *event) override; |
| 42 | void mouseDoubleClickEvent(QMouseEvent *event) override; |
| 43 | void mouseMoveEvent(QMouseEvent *event) override; |
| 44 | void mouseReleaseEvent(QMouseEvent *event) override; |
| 45 | void mousePressEvent(QMouseEvent *event) override; |
| 46 | |
| 47 | private: |
| 48 | Q_DECLARE_PRIVATE(QColumnViewGrip) |
| 49 | Q_DISABLE_COPY_MOVE(QColumnViewGrip) |
| 50 | }; |
| 51 | |
| 52 | class QColumnViewGripPrivate : public QWidgetPrivate |
| 53 | { |
| 54 | Q_DECLARE_PUBLIC(QColumnViewGrip) |
| 55 | |
| 56 | public: |
| 57 | QColumnViewGripPrivate(); |
| 58 | ~QColumnViewGripPrivate() {} |
| 59 | |
| 60 | int originalXLocation; |
| 61 | }; |
| 62 | |
| 63 | QT_END_NAMESPACE |
| 64 | |
| 65 | #endif //QCOLUMNVIEWGRIP_P_H |
| 66 |
