VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsWarningPane.h@ 103977

Last change on this file since 103977 was 100967, checked in by vboxsync, 16 months ago

FE/Qt: UISettingsDialog: Adjusting UISettingsWarningPane to have more obvious show/hide API; S.a. r158899.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: UISettingsWarningPane.h 100967 2023-08-25 11:37:51Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UISettingsWarningPane 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_settings_UISettingsWarningPane_h
29#define FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_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 QHBoxLayout;
42class QEvent;
43class QLabel;
44class QObject;
45class QString;
46class QTimer;
47class QWidget;
48class UISettingsPageValidator;
49
50/** QWidget sub-class,
51 * used a settings dialog warning-pane. */
52class SHARED_LIBRARY_STUFF UISettingsWarningPane : public QWidget
53{
54 Q_OBJECT;
55
56signals:
57
58 /** Notifies about hover enter event.
59 * @param pValidator Brings the validator reference. */
60 void sigHoverEnter(UISettingsPageValidator *pValidator);
61 /** Notifies about hover leave event.
62 * @param pValidator Brings the validator reference. */
63 void sigHoverLeave(UISettingsPageValidator *pValidator);
64
65public:
66
67 /** Constructs warning-pane passing @a pParent to the base-class. */
68 UISettingsWarningPane(QWidget *pParent = 0);
69
70 /** Defines current warning-label @a strText. */
71 void setWarningLabelText(const QString &strText);
72 /** Defines whether warning-label should be @a fVisible. */
73 void setWarningLabelVisible(bool fVisible);
74
75 /** Registers corresponding @a pValidator. */
76 void registerValidator(UISettingsPageValidator *pValidator);
77
78protected:
79
80 /** Preprocesses Qt @a pEvent for passed @a pObject. */
81 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
82
83private slots:
84
85 /** Handles hover timer timeout. */
86 void sltHandleHoverTimer();
87
88private:
89
90 /** Prepares all. */
91 void prepare();
92
93 /** Holds the icon layout instance. */
94 QHBoxLayout *m_pIconLayout;
95 /** Holds the text label instance. */
96 QLabel *m_pTextLabel;
97
98 /** Holds the page validators list. */
99 QList<UISettingsPageValidator*> m_validators;
100 /** Holds the page icons list. */
101 QList<QLabel*> m_icons;
102 /** Holds the icons hovered-states list. */
103 QList<bool> m_hovered;
104
105 /** Holds the hover timer instance. */
106 QTimer *m_pHoverTimer;
107 /** Holds the hovered icon-label position. */
108 int m_iHoveredIconLabelPosition;
109};
110
111#endif /* !FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h */
Note: See TracBrowser for help on using the repository browser.

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