VirtualBox

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

Last change on this file since 93990 was 93990, checked in by vboxsync, 3 years ago

FE/Qt: Replaced /* override */ comments with RT_OVERRIDE. bugref:9898

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: UIFormEditorWidget.h 93990 2022-02-28 15:34:57Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIFormEditorWidget class declaration.
4 */
5
6/*
7 * Copyright (C) 2019-2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_h
19#define FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QPointer>
26#include <QWidget>
27
28/* COM includes: */
29#include "COMEnums.h"
30#include "CFormValue.h"
31
32/* Forward declarations: */
33class QHeaderView;
34class QItemEditorFactory;
35class UIFormEditorModel;
36class UIFormEditorView;
37class UINotificationCenter;
38class CForm;
39class CVirtualSystemDescriptionForm;
40
41/** QWidget subclass representing model/view Form Editor widget. */
42class UIFormEditorWidget : public QWidget
43{
44 Q_OBJECT;
45
46public:
47
48 /** Constructs Form Editor widget passing @a pParent to the base-class.
49 * @param pNotificationCenter Brings the notification-center this widget should report to. */
50 UIFormEditorWidget(QWidget *pParent = 0, UINotificationCenter *pNotificationCenter = 0);
51 /** Destructs Form Editor widget. */
52 virtual ~UIFormEditorWidget() RT_OVERRIDE;
53
54 /** Returns the notification-center reference. */
55 UINotificationCenter *notificationCenter() const { return m_pNotificationCenter; }
56 /** Defines the @a pNotificationCenter reference. */
57 void setNotificationCenter(UINotificationCenter *pNotificationCenter) { m_pNotificationCenter = pNotificationCenter; }
58
59 /** Returns horizontal header reference. */
60 QHeaderView *horizontalHeader() const;
61 /** Returns vertical header reference. */
62 QHeaderView *verticalHeader() const;
63
64 /** Clears form. */
65 void clearForm();
66 /** Defines @a values to be edited. */
67 void setValues(const QVector<CFormValue> &values);
68 /** Defines @a comForm to be edited. */
69 void setForm(const CForm &comForm);
70 /** Defines virtual system description @a comForm to be edited. */
71 void setVirtualSystemDescriptionForm(const CVirtualSystemDescriptionForm &comForm);
72
73 /** Makes sure current editor data committed. */
74 void makeSureEditorDataCommitted();
75
76protected:
77
78 /** Preprocesses any Qt @a pEvent for passed @a pObject. */
79 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
80
81private:
82
83 /** Prepares all. */
84 void prepare();
85 /** Cleanups all. */
86 void cleanup();
87
88 /** Adjusts table column sizes. */
89 void adjustTable();
90
91 /** Holds the notification-center reference. */
92 UINotificationCenter *m_pNotificationCenter;
93
94 /** Holds the table-view instance. */
95 UIFormEditorView *m_pTableView;
96 /** Holds the table-model instance. */
97 UIFormEditorModel *m_pTableModel;
98
99 /** Holds the item editor factory instance. */
100 QItemEditorFactory *m_pItemEditorFactory;
101};
102
103/** Safe pointer to Form Editor widget. */
104typedef QPointer<UIFormEditorWidget> UIFormEditorWidgetPointer;
105
106#endif /* !FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_h */
Note: See TracBrowser for help on using the repository browser.

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