VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h@ 74109

Last change on this file since 74109 was 74109, checked in by vboxsync, 7 years ago

FE/Qt: VirtualBox Manager UI: Details pane re-styling: Let the background color be light, while frame color come from group item, not from scene background.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.hmergedeligible
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h79562-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h79645-79692
File size: 5.4 KB
Line 
1/* $Id: UIDetailsGroup.h 74109 2018-09-06 10:14:20Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsGroup class declaration.
4 */
5
6/*
7 * Copyright (C) 2012-2018 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 ___UIDetailsGroup_h___
19#define ___UIDetailsGroup_h___
20
21/* GUI includes: */
22#include "UIDetailsItem.h"
23
24/* Forward declarations: */
25class QGraphicsScene;
26class UIVirtualMachineItem;
27
28/** UIDetailsItem extension implementing group item. */
29class UIDetailsGroup : public UIDetailsItem
30{
31 Q_OBJECT;
32
33signals:
34
35 /** @name Layout stuff.
36 * @{ */
37 /** Notifies listeners about @a iMinimumWidthHint changed. */
38 void sigMinimumWidthHintChanged(int iMinimumWidthHint);
39 /** Notifies listeners about @a iMinimumHeightHint changed. */
40 void sigMinimumHeightHintChanged(int iMinimumHeightHint);
41 /** @} */
42
43public:
44
45 /** RTTI item type. */
46 enum { Type = UIDetailsItemType_Group };
47
48 /** Constructs group item, passing pScene to the base-class. */
49 UIDetailsGroup(QGraphicsScene *pScene);
50 /** Destructs group item. */
51 virtual ~UIDetailsGroup() /* override */;
52
53 /** @name Item stuff.
54 * @{ */
55 /** Builds group based on passed @a machineItems. */
56 void buildGroup(const QList<UIVirtualMachineItem*> &machineItems);
57 /** Builds group based on cached machine items. */
58 void rebuildGroup();
59 /** Stops currently building group. */
60 void stopBuildingGroup();
61 /** @} */
62
63 /** @name Children stuff.
64 * @{ */
65 /** Returns children items of certain @a enmType. */
66 virtual QList<UIDetailsItem*> items(UIDetailsItemType enmType = UIDetailsItemType_Set) const /* override */;
67 /** @} */
68
69 /** @name Layout stuff.
70 * @{ */
71 /** Updates layout. */
72 virtual void updateLayout() /* override */;
73 /** @} */
74
75protected slots:
76
77 /** @name Item stuff.
78 * @{ */
79 /** Handles request about starting step build.
80 * @param strStepId Brings the step ID.
81 * @param iStepNumber Brings the step number. */
82 /** @} */
83 virtual void sltBuildStep(QString strStepId, int iStepNumber) /* override */;
84
85protected:
86
87 /** @name Event-handling stuff.
88 * @{ */
89 /** Performs painting using passed @a pPainter, @a pOptions and optionally specified @a pWidget. */
90 virtual void paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *pWidget = 0) /* override */;
91 /** @} */
92
93 /** @name Item stuff.
94 * @{ */
95 /** Returns RTTI item type. */
96 virtual int type() const /* override */ { return Type; }
97
98 /** Returns the description of the item. */
99 virtual QString description() const /* override */ { return QString(); }
100 /** @} */
101
102 /** @name Children stuff.
103 * @{ */
104 /** Adds child @a pItem. */
105 virtual void addItem(UIDetailsItem *pItem) /* override */;
106 /** Removes child @a pItem. */
107 virtual void removeItem(UIDetailsItem *pItem) /* override */;
108
109 /** Returns whether there are children items of certain @a enmType. */
110 virtual bool hasItems(UIDetailsItemType enmType = UIDetailsItemType_Set) const /* override */;
111 /** Clears children items of certain @a enmType. */
112 virtual void clearItems(UIDetailsItemType enmType = UIDetailsItemType_Set) /* override */;
113 /** @} */
114
115 /** @name Layout stuff.
116 * @{ */
117 /** Updates geometry. */
118 virtual void updateGeometry() /* override */;
119
120 /** Returns minimum width-hint. */
121 virtual int minimumWidthHint() const /* override */;
122 /** Returns minimum height-hint. */
123 virtual int minimumHeightHint() const /* override */;
124 /** @} */
125
126private:
127
128 /** Data field types. */
129 enum GroupItemData
130 {
131 /* Layout hints: */
132 GroupData_Margin,
133 GroupData_Spacing
134 };
135
136 /** @name Prepare/cleanup cascade.
137 * @{ */
138 /** Prepares connections. */
139 void prepareConnections();
140 /** @} */
141
142 /** @name Item stuff.
143 * @{ */
144 /** Returns abstractly stored data value for certain @a iKey. */
145 QVariant data(int iKey) const;
146 /** @} */
147
148 /** @name Painting stuff.
149 * @{ */
150 /** Paints background using specified @a pPainter and certain @a pOptions. */
151 void paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const;
152 /** @} */
153
154 /** @name Item stuff.
155 * @{ */
156 /** Holds the build step instance. */
157 UIPrepareStep *m_pBuildStep;
158 /** Holds the generated group ID. */
159 QString m_strGroupId;
160 /** @} */
161
162 /** @name Children stuff.
163 * @{ */
164 /** Holds the cached machine item list. */
165 QList<UIVirtualMachineItem*> m_machineItems;
166
167 /** Holds the child list (a list of sets). */
168 QList<UIDetailsItem*> m_items;
169 /** @} */
170
171 /** @name Layout stuff.
172 * @{ */
173 int m_iPreviousMinimumWidthHint;
174 int m_iPreviousMinimumHeightHint;
175 /** @} */
176};
177
178#endif /* !___UIDetailsGroup_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette