1 | /* $Id: UIFormEditorWidget.h 79814 2019-07-16 15:59:06Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIFormEditorWidget class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019 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 | /* Forward declarations: */
|
---|
29 | class UIFormEditorModel;
|
---|
30 | class UIFormEditorView;
|
---|
31 | class CVirtualSystemDescriptionForm;
|
---|
32 |
|
---|
33 | /** QWidget subclass representing model/view Form Editor widget. */
|
---|
34 | class UIFormEditorWidget : public QWidget
|
---|
35 | {
|
---|
36 | Q_OBJECT;
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | /** Constructs Form Editor widget passing @a pParent to the base-class. */
|
---|
41 | UIFormEditorWidget(QWidget *pParent = 0);
|
---|
42 |
|
---|
43 | /** Defines virtual system description @a comForm to be edited. */
|
---|
44 | void setVirtualSystemDescriptionForm(const CVirtualSystemDescriptionForm &comForm);
|
---|
45 |
|
---|
46 | /** Makes sure current editor data committed. */
|
---|
47 | void makeSureEditorDataCommitted();
|
---|
48 |
|
---|
49 | protected:
|
---|
50 |
|
---|
51 | /** Preprocesses any Qt @a pEvent for passed @a pObject. */
|
---|
52 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
|
---|
53 |
|
---|
54 | private:
|
---|
55 |
|
---|
56 | /** Prepares all. */
|
---|
57 | void prepare();
|
---|
58 |
|
---|
59 | /** Adjusts table column sizes. */
|
---|
60 | void adjustTable();
|
---|
61 |
|
---|
62 | /** Holds the table-view instance. */
|
---|
63 | UIFormEditorView *m_pTableView;
|
---|
64 | /** Holds the table-model instance. */
|
---|
65 | UIFormEditorModel *m_pTableModel;
|
---|
66 | };
|
---|
67 |
|
---|
68 | /** Safe pointer to Form Editor widget. */
|
---|
69 | typedef QPointer<UIFormEditorWidget> UIFormEditorWidgetPointer;
|
---|
70 |
|
---|
71 | #endif /* !FEQT_INCLUDED_SRC_widgets_UIFormEditorWidget_h */
|
---|