1 | /* $Id: QISplitter.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QISplitter class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_extensions_QISplitter_h
|
---|
29 | #define FEQT_INCLUDED_SRC_extensions_QISplitter_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QSplitter>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UILibraryDefs.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QSplitterHandle;
|
---|
42 |
|
---|
43 | /** QSplitter subclass with extended functionality. */
|
---|
44 | class SHARED_LIBRARY_STUFF QISplitter : public QSplitter
|
---|
45 | {
|
---|
46 | Q_OBJECT;
|
---|
47 |
|
---|
48 | public:
|
---|
49 |
|
---|
50 | /** Handle types. */
|
---|
51 | enum Type { Flat, Shade, Native };
|
---|
52 |
|
---|
53 | /** Constructs splitter passing @a pParent to the base-class. */
|
---|
54 | QISplitter(QWidget *pParent = 0);
|
---|
55 | /** Constructs splitter passing @a enmOrientation and @a pParent to the base-class.
|
---|
56 | * @param enmType Brings the splitter handle type. */
|
---|
57 | QISplitter(Qt::Orientation enmOrientation, Type enmType, QWidget *pParent = 0);
|
---|
58 |
|
---|
59 | /** Configure custom color defined as @a color. */
|
---|
60 | void configureColor(const QColor &color);
|
---|
61 | /** Configure custom colors defined as @a color1 and @a color2. */
|
---|
62 | void configureColors(const QColor &color1, const QColor &color2);
|
---|
63 |
|
---|
64 | protected:
|
---|
65 |
|
---|
66 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
67 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
|
---|
68 |
|
---|
69 | /** Handles show @a pEvent. */
|
---|
70 | void showEvent(QShowEvent *pEvent);
|
---|
71 |
|
---|
72 | /** Creates handle. */
|
---|
73 | QSplitterHandle *createHandle();
|
---|
74 |
|
---|
75 | private:
|
---|
76 |
|
---|
77 | /** Holds the serialized base-state. */
|
---|
78 | QByteArray m_baseState;
|
---|
79 |
|
---|
80 | /** Holds the handle type. */
|
---|
81 | Type m_enmType;
|
---|
82 |
|
---|
83 | /** Holds whether the splitter is polished. */
|
---|
84 | bool m_fPolished : 1;
|
---|
85 | #ifdef VBOX_WS_MAC
|
---|
86 | /** Holds whether handle is grabbed. */
|
---|
87 | bool m_fHandleGrabbed : 1;
|
---|
88 | #endif
|
---|
89 |
|
---|
90 | /** Holds color. */
|
---|
91 | QColor m_color;
|
---|
92 | /** Holds color1. */
|
---|
93 | QColor m_color1;
|
---|
94 | /** Holds color2. */
|
---|
95 | QColor m_color2;
|
---|
96 | };
|
---|
97 |
|
---|
98 | #endif /* !FEQT_INCLUDED_SRC_extensions_QISplitter_h */
|
---|