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