VirtualBox

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

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

FE/Qt/Ds: bugref:6899: Fix for UIFormEditorWidget; Table rows should have table reference initialised; Required for accessibility needs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: UIFormEditorWidget.h 95725 2022-07-19 12:08:09Z 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 table-view reference. */
60 UIFormEditorView *view() const;
61 /** Returns horizontal header reference. */
62 QHeaderView *horizontalHeader() const;
63 /** Returns vertical header reference. */
64 QHeaderView *verticalHeader() const;
65 /** Defines table-view @a strWhatsThis help text. */
66 void setWhatsThis(const QString &strWhatsThis);
67
68 /** Clears form. */
69 void clearForm();
70 /** Defines @a values to be edited. */
71 void setValues(const QVector<CFormValue> &values);
72 /** Defines @a comForm to be edited. */
73 void setForm(const CForm &comForm);
74 /** Defines virtual system description @a comForm to be edited. */
75 void setVirtualSystemDescriptionForm(const CVirtualSystemDescriptionForm &comForm);
76
77 /** Makes sure current editor data committed. */
78 void makeSureEditorDataCommitted();
79
80protected:
81
82 /** Preprocesses any Qt @a pEvent for passed @a pObject. */
83 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
84
85private:
86
87 /** Prepares all. */
88 void prepare();
89 /** Cleanups all. */
90 void cleanup();
91
92 /** Adjusts table column sizes. */
93 void adjustTable();
94
95 /** Holds the notification-center reference. */
96 UINotificationCenter *m_pNotificationCenter;
97
98 /** Holds the table-view instance. */
99 UIFormEditorView *m_pTableView;
100 /** Holds the table-model instance. */
101 UIFormEditorModel *m_pTableModel;
102
103 /** Holds the item editor factory instance. */
104 QItemEditorFactory *m_pItemEditorFactory;
105};
106
107/** Safe pointer to Form Editor widget. */
108typedef QPointer<UIFormEditorWidget> UIFormEditorWidgetPointer;
109
110#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