VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIWarningPane.h@ 100347

Last change on this file since 100347 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

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