VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneDetails.h

Last change on this file was 103988, checked in by vboxsync, 8 weeks ago

FE/Qt. bugref:10624. Adding missing override keywords gcc has found.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: UIPopupPaneDetails.h 103988 2024-03-21 13:49:47Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIPopupPaneDetails class declaration.
4 */
5
6/*
7 * Copyright (C) 2013-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_widgets_UIPopupPaneDetails_h
29#define FEQT_INCLUDED_SRC_widgets_UIPopupPaneDetails_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QWidget>
36
37/* GUI includes: */
38#include "UILibraryDefs.h"
39
40/* Forward declarations: */
41class QTextEdit;
42class UIAnimation;
43
44/** QWidget extension providing GUI with popup-pane details-pane prototype class. */
45class SHARED_LIBRARY_STUFF UIPopupPaneDetails : public QWidget
46{
47 Q_OBJECT;
48 Q_PROPERTY(QSize collapsedSizeHint READ collapsedSizeHint);
49 Q_PROPERTY(QSize expandedSizeHint READ expandedSizeHint);
50 Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint WRITE setMinimumSizeHint);
51
52signals:
53
54 /** Notifies about focus enter. */
55 void sigFocusEnter();
56 /** Notifies about focus enter. */
57 void sigFocusLeave();
58
59 /** Notifies about size-hint change. */
60 void sigSizeHintChanged();
61
62public:
63
64 /** Constructs details-pane passing @a pParent to the base-class.
65 * @param strText Brings the details text.
66 * @param fFcoused Brings whether the pane is focused. */
67 UIPopupPaneDetails(QWidget *pParent, const QString &strText, bool fFocused);
68
69 /** Defines the details @a strText. */
70 void setText(const QString &strText);
71
72 /** Returns the details minimum size-hint. */
73 QSize minimumSizeHint() const RT_OVERRIDE RT_FINAL;
74 /** Defines the details @a minimumSizeHint. */
75 void setMinimumSizeHint(const QSize &minimumSizeHint);
76 /** Lays the content out. */
77 void layoutContent();
78
79 /** Returns the collapsed size-hint. */
80 QSize collapsedSizeHint() const { return m_collapsedSizeHint; }
81 /** Returns the expanded size-hint. */
82 QSize expandedSizeHint() const { return m_expandedSizeHint; }
83
84public slots:
85
86 /** Handles proposal for @a iWidth. */
87 void sltHandleProposalForWidth(int iWidth);
88 /** Handles proposal for @a iHeight. */
89 void sltHandleProposalForHeight(int iHeight);
90
91 /** Handles focus enter. */
92 void sltFocusEnter();
93 /** Handles focus leave. */
94 void sltFocusLeave();
95
96private:
97
98 /** Prepares all. */
99 void prepare();
100 /** Prepares content. */
101 void prepareContent();
102 /** Prepares animations. */
103 void prepareAnimation();
104
105 /** Updates size-hint. */
106 void updateSizeHint();
107 /** Updates visibility. */
108 void updateVisibility();
109
110 /** Adjusts @a font. */
111 static QFont tuneFont(QFont font);
112
113 /** Holds the layout margin. */
114 const int m_iLayoutMargin;
115 /** Holds the layout spacing. */
116 const int m_iLayoutSpacing;
117
118 /** Holds the text-editor size-hint. */
119 QSize m_textEditSizeHint;
120 /** Holds the collapsed size-hint. */
121 QSize m_collapsedSizeHint;
122 /** Holds the expanded size-hint. */
123 QSize m_expandedSizeHint;
124 /** Holds the minimum size-hint. */
125 QSize m_minimumSizeHint;
126
127 /** Holds the text. */
128 QString m_strText;
129
130 /** Holds the text-editor instance. */
131 QTextEdit *m_pTextEdit;
132
133 /** Holds the desired textr-editor width. */
134 int m_iDesiredTextEditWidth;
135 /** Holds the maximum pane height. */
136 int m_iMaximumPaneHeight;
137 /** Holds the desired textr-editor height. */
138 int m_iMaximumTextEditHeight;
139 /** Holds the text content margin. */
140 int m_iTextContentMargin;
141
142 /** Holds whether details-pane is focused. */
143 bool m_fFocused;
144
145 /** Holds the animation instance. */
146 UIAnimation *m_pAnimation;
147};
148
149#endif /* !FEQT_INCLUDED_SRC_widgets_UIPopupPaneDetails_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use