VirtualBox

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

Last change on this file was 104999, checked in by vboxsync, 3 months ago

FE/Qt: bugref:10681: UIFormEditorWidget: A bit of interface cleanup.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: UIFormEditorWidget.h 104999 2024-06-24 14:33:58Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIFormEditorWidget class declaration.
4 */
5
6/*
7 * Copyright (C) 2019-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_UIFormEditorWidget_h
29#define FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QPointer>
36#include <QWidget>
37
38/* COM includes: */
39#include "CFormValue.h"
40
41/* Forward declarations: */
42class QHeaderView;
43class QITableView;
44class UIFormEditorModel;
45class UINotificationCenter;
46class CForm;
47class CVirtualSystemDescriptionForm;
48
49/** QWidget subclass representing model/view Form Editor widget. */
50class UIFormEditorWidget : public QWidget
51{
52 Q_OBJECT;
53
54public:
55
56 /** Constructs Form Editor widget passing @a pParent to the base-class.
57 * @param pNotificationCenter Brings the notification-center this widget should report to. */
58 UIFormEditorWidget(QWidget *pParent = 0, UINotificationCenter *pNotificationCenter = 0);
59
60 /** Returns the notification-center reference. */
61 UINotificationCenter *notificationCenter() const { return m_pNotificationCenter; }
62 /** Defines the @a pNotificationCenter reference. */
63 void setNotificationCenter(UINotificationCenter *pNotificationCenter) { m_pNotificationCenter = pNotificationCenter; }
64
65 /** Returns table-view reference. */
66 QITableView *view() const;
67 /** Returns horizontal header reference. */
68 QHeaderView *horizontalHeader() const;
69 /** Returns vertical header reference. */
70 QHeaderView *verticalHeader() const;
71 /** Defines table-view @a strWhatsThis help text. */
72 void setWhatsThis(const QString &strWhatsThis);
73
74 /** Clears form. */
75 void clearForm();
76 /** Defines form @a values to be edited. */
77 void setFormValues(const QVector<CFormValue> &values);
78 /** Defines @a comForm to be edited. */
79 void setForm(const CForm &comForm);
80 /** Defines virtual system description @a comForm to be edited. */
81 void setVirtualSystemDescriptionForm(const CVirtualSystemDescriptionForm &comForm);
82
83 /** Makes sure current editor data committed. */
84 void makeSureEditorDataCommitted();
85
86private:
87
88 /** Prepares all. */
89 void prepare();
90
91 /** Holds the notification-center reference. */
92 UINotificationCenter *m_pNotificationCenter;
93
94 /** Holds the table-view instance. */
95 QITableView *m_pTableView;
96 /** Holds the table-model instance. */
97 UIFormEditorModel *m_pTableModel;
98};
99
100/** Safe pointer to Form Editor widget. */
101typedef QPointer<UIFormEditorWidget> UIFormEditorWidgetPointer;
102
103#endif /* !FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_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