VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIInputDialog.h

Last change on this file was 104358, checked in by vboxsync, 5 weeks ago

FE/Qt. bugref:10622. More refactoring around the retranslation functionality.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: QIInputDialog.h 104358 2024-04-18 05:33:40Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QIInputDialog class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-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_extensions_QIInputDialog_h
29#define FEQT_INCLUDED_SRC_extensions_QIInputDialog_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QDialog>
36#include <QPointer>
37
38/* GUI includes: */
39#include "UILibraryDefs.h"
40
41/* Forward declarations: */
42class QLabel;
43class QLineEdit;
44class QIDialogButtonBox;
45
46/** QDialog extension providing the GUI with
47 * the advanced input dialog capabilities. */
48class SHARED_LIBRARY_STUFF QIInputDialog : public QDialog
49{
50 Q_OBJECT;
51
52public:
53
54 /** Constructs the dialog passing @a pParent and @a enmFlags to the base-class. */
55 QIInputDialog(QWidget *pParent = 0, Qt::WindowFlags enmFlags = Qt::WindowFlags());
56
57 /** Returns label text. */
58 QString labelText() const;
59 /** Undefines label text. */
60 void resetLabelText();
61 /** Defines label @a strText. */
62 void setLabelText(const QString &strText);
63
64 /** Returns text value. */
65 QString textValue() const;
66 /** Defines @a strText value. */
67 void setTextValue(const QString &strText);
68
69protected:
70
71 /** Handles translation event. */
72 virtual void retranslateUi();
73
74private slots:
75
76 /** Handles text value change. */
77 void sltTextChanged();
78
79private:
80
81 /** Prepared all. */
82 void prepare();
83
84 /** Holds whether label text redefined. */
85 bool m_fDefaultLabelTextRedefined;
86
87 /** Holds the label instance. */
88 QLabel *m_pLabel;
89 /** Holds the text value editor instance. */
90 QLineEdit *m_pTextValueEditor;
91 /** Holds the button-box instance. */
92 QIDialogButtonBox *m_pButtonBox;
93};
94
95/** Safe pointer to the QIInputDialog class. */
96typedef QPointer<QIInputDialog> QISafePointerInputDialog;
97
98#endif /* !FEQT_INCLUDED_SRC_extensions_QIInputDialog_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use