Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
newformwidget_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
NEWFORMWIDGET_H
6
#
define
NEWFORMWIDGET_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
"shared_global_p.h"
20
#
include
"deviceprofile_p.h"
21
22
#
include
<
QtDesigner
/
abstractnewformwidget
.
h
>
23
24
#
include
<
QtWidgets
/
qwidget
.
h
>
25
26
#
include
<
QtGui
/
qpixmap
.
h
>
27
28
#
include
<
QtCore
/
qlist
.
h
>
29
#
include
<
QtCore
/
qmap
.
h
>
30
#
include
<
QtCore
/
qstringlist
.
h
>
31
32
#
include
<
utility
>
33
34
QT_BEGIN_NAMESPACE
35
36
class
QIODevice;
37
class
QTreeWidgetItem;
38
39
namespace
qdesigner_internal
{
40
41
namespace
Ui
{
42
class
NewFormWidget;
43
}
44
45
class
QDESIGNER_SHARED_EXPORT
NewFormWidget
:
public
QDesignerNewFormWidgetInterface
46
{
47
Q_OBJECT
48
Q_DISABLE_COPY_MOVE
(
NewFormWidget
)
49
Q_PROPERTY
(
bool
embeddedGroupBoxVisible
READ
isEmbeddedGroupBoxVisible
WRITE
setEmbeddedGroupBoxVisible
)
50
51
public
:
52
using
DeviceProfileList
=
QList
<
qdesigner_internal
::
DeviceProfile
>;
53
54
explicit
NewFormWidget
(
QDesignerFormEditorInterface
*
core
,
QWidget
*
parentWidget
);
55
~
NewFormWidget
()
override
;
56
57
bool
hasCurrentTemplate
()
const
override
;
58
QString
currentTemplate
(
QString
*
errorMessage
=
nullptr
)
override
;
59
60
bool
isEmbeddedGroupBoxVisible
()
const
;
61
void
setEmbeddedGroupBoxVisible
(
bool
v
);
62
63
// Convenience for implementing file dialogs with preview
64
static
QImage
grabForm
(
QDesignerFormEditorInterface
*
core
,
65
QIODevice
&
file
,
66
const
QString
&
workingDir
,
67
const
qdesigner_internal
::
DeviceProfile
&
dp
);
68
69
private
slots
:
70
void
treeWidgetItemActivated
(
QTreeWidgetItem
*
item
);
71
void
treeWidgetCurrentItemChanged
(
QTreeWidgetItem
*
current
);
72
void
treeWidgetItemPressed
(
QTreeWidgetItem
*
item
);
73
void
slotDeviceProfileIndexChanged
(
int
idx
);
74
75
private
:
76
QPixmap
formPreviewPixmap
(
const
QString
&
fileName
)
const
;
77
QPixmap
formPreviewPixmap
(
QIODevice
&
file
,
const
QString
&
workingDir
=
QString
())
const
;
78
QPixmap
formPreviewPixmap
(
const
QTreeWidgetItem
*
item
);
79
80
void
loadFrom
(
const
QString
&
path
,
bool
resourceFile
,
const
QString
&
uiExtension
,
81
const
QString
&
selectedItem
,
QTreeWidgetItem
*&
selectedItemFound
);
82
void
loadFrom
(
const
QString
&
title
,
const
QStringList
&
nameList
,
83
const
QString
&
selectedItem
,
QTreeWidgetItem
*&
selectedItemFound
);
84
85
private
:
86
QString
itemToTemplate
(
const
QTreeWidgetItem
*
item
,
QString
*
errorMessage
)
const
;
87
QString
currentTemplateI
(
QString
*
ptrToErrorMessage
);
88
89
QSize
templateSize
()
const
;
90
void
setTemplateSize
(
const
QSize
&
s
);
91
int
profileComboIndex
()
const
;
92
qdesigner_internal
::
DeviceProfile
currentDeviceProfile
()
const
;
93
bool
showCurrentItemPixmap
();
94
95
// Pixmap cache (item, profile combo index)
96
using
ItemPixmapCacheKey
=
std
::
pair
<
const
QTreeWidgetItem
*,
int
>;
97
using
ItemPixmapCache
=
QMap
<
ItemPixmapCacheKey
,
QPixmap
>;
98
ItemPixmapCache
m_itemPixmapCache
;
99
100
QDesignerFormEditorInterface
*
m_core
;
101
Ui
::
NewFormWidget
*
m_ui
;
102
QTreeWidgetItem
*
m_currentItem
;
103
QTreeWidgetItem
*
m_acceptedItem
;
104
DeviceProfileList
m_deviceProfiles
;
105
};
106
107
}
108
109
QT_END_NAMESPACE
110
111
#
endif
// NEWFORMWIDGET_H
NewForm
Definition
newform.h:28
NewForm::grabForm
static QImage grabForm(QDesignerFormEditorInterface *core, QIODevice &file, const QString &workingDir, const qdesigner_internal::DeviceProfile &dp)
Definition
newform.cpp:178
NewForm::~NewForm
~NewForm() override
Definition
newform.cpp:94
QDesignerActions
Definition
qdesigner_actions.h:43
QDesignerActions::openForm
bool openForm(QWidget *parent)
Definition
qdesigner_actions.cpp:591
QDesignerActions::recentFilesActions
QActionGroup * recentFilesActions() const
Definition
qdesigner_actions.cpp:949
QDesignerSettings
Definition
qdesigner_settings.h:22
QDesignerSettings::setShowNewFormOnStartup
void setShowNewFormOnStartup(bool showIt)
Definition
qdesigner_settings.cpp:110
QDesignerSettings::QDesignerSettings
QDesignerSettings(QDesignerFormEditorInterface *core)
Definition
qdesigner_settings.cpp:40
QDesignerSettings::showNewFormOnStartup
bool showNewFormOnStartup() const
Definition
qdesigner_settings.cpp:115
QDesignerWorkbench
Definition
qdesigner_workbench.h:44
QDesignerWorkbench::actionManager
QDesignerActions * actionManager() const
Definition
qdesigner_workbench.cpp:736
QDesignerWorkbench::core
QDesignerFormEditorInterface * core() const
Definition
qdesigner_workbench.cpp:537
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:432
qdesigner_internal::NewFormWidget
Definition
newformwidget_p.h:46
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qdesigner_internal::Ui
Definition
templateoptionspage.h:21
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:67
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:33
qttools
src
designer
src
lib
shared
newformwidget_p.h
Generated on
for Qt by
1.18.0