VirtualBox

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

Last change on this file was 100967, checked in by vboxsync, 9 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
RevLine 
[55401]1/* $Id: UISettingsWarningPane.h 100967 2023-08-25 11:37:51Z vboxsync $ */
[25178]2/** @file
[100961]3 * VBox Qt GUI - UISettingsWarningPane class declaration.
[25178]4 */
5
6/*
[98103]7 * Copyright (C) 2009-2023 Oracle and/or its affiliates.
[25178]8 *
[96407]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
[25178]26 */
27
[100961]28#ifndef FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h
29#define FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h
[76532]30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
[25178]33
[71942]34/* Qt includes: */
[25178]35#include <QWidget>
36
[71942]37/* GUI includes: */
38#include "UILibraryDefs.h"
39
[47616]40/* Forward declarations: */
[47846]41class QHBoxLayout;
[71942]42class QEvent;
[47616]43class QLabel;
[71942]44class QObject;
45class QString;
[47951]46class QTimer;
[71942]47class QWidget;
[100959]48class UISettingsPageValidator;
[47616]49
[100961]50/** QWidget sub-class,
51 * used a settings dialog warning-pane. */
52class SHARED_LIBRARY_STUFF UISettingsWarningPane : public QWidget
[25178]53{
54 Q_OBJECT;
55
[47761]56signals:
57
[71942]58 /** Notifies about hover enter event.
59 * @param pValidator Brings the validator reference. */
[100959]60 void sigHoverEnter(UISettingsPageValidator *pValidator);
[71942]61 /** Notifies about hover leave event.
62 * @param pValidator Brings the validator reference. */
[100959]63 void sigHoverLeave(UISettingsPageValidator *pValidator);
[47761]64
[25178]65public:
66
[71942]67 /** Constructs warning-pane passing @a pParent to the base-class. */
[100961]68 UISettingsWarningPane(QWidget *pParent = 0);
[25178]69
[100967]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);
[25178]74
[71942]75 /** Registers corresponding @a pValidator. */
[100959]76 void registerValidator(UISettingsPageValidator *pValidator);
[47846]77
[71942]78protected:
79
80 /** Preprocesses Qt @a pEvent for passed @a pObject. */
[93990]81 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
[71942]82
[47951]83private slots:
84
[71942]85 /** Handles hover timer timeout. */
[47951]86 void sltHandleHoverTimer();
87
[25178]88private:
89
[71942]90 /** Prepares all. */
[47616]91 void prepare();
92
[71942]93 /** Holds the icon layout instance. */
94 QHBoxLayout *m_pIconLayout;
95 /** Holds the text label instance. */
96 QLabel *m_pTextLabel;
[47761]97
[71942]98 /** Holds the page validators list. */
[100959]99 QList<UISettingsPageValidator*> m_validators;
[71942]100 /** Holds the page icons list. */
[100959]101 QList<QLabel*> m_icons;
[71942]102 /** Holds the icons hovered-states list. */
[100959]103 QList<bool> m_hovered;
[71942]104
105 /** Holds the hover timer instance. */
[47951]106 QTimer *m_pHoverTimer;
[71942]107 /** Holds the hovered icon-label position. */
108 int m_iHoveredIconLabelPosition;
[25178]109};
110
[100961]111#endif /* !FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use