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
grid_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
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists for the convenience
10
// of Qt Designer. This header
11
// file may change from version to version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
QDESIGNER_GRID_H
17
#
define
QDESIGNER_GRID_H
18
19
#
include
"shared_global_p.h"
20
21
#
include
<
QtCore
/
qcompare
.
h
>
22
#
include
<
QtCore
/
qvariant
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QWidget
;
27
class
QPaintEvent;
28
class
QPainter
;
29
30
namespace
qdesigner_internal
{
31
32
// Designer grid which is able to serialize to QVariantMap
33
class
QDESIGNER_SHARED_EXPORT
Grid
34
{
35
public
:
36
Grid
();
37
38
bool
fromVariantMap
(
const
QVariantMap
&
vm
);
39
40
void
addToVariantMap
(
QVariantMap
&
vm
,
bool
forceKeys
=
false
)
const
;
41
QVariantMap
toVariantMap
(
bool
forceKeys
=
false
)
const
;
42
43
bool
visible
()
const
{
return
m_visible
; }
44
void
setVisible
(
bool
visible
) {
m_visible
=
visible
; }
45
46
bool
snapX
()
const
{
return
m_snapX
; }
47
void
setSnapX
(
bool
snap
) {
m_snapX
=
snap
; }
48
49
bool
snapY
()
const
{
return
m_snapY
; }
50
void
setSnapY
(
bool
snap
) {
m_snapY
=
snap
; }
51
52
int
deltaX
()
const
{
return
m_deltaX
; }
53
void
setDeltaX
(
int
dx
) {
m_deltaX
=
dx
; }
54
55
int
deltaY
()
const
{
return
m_deltaY
; }
56
void
setDeltaY
(
int
dy
) {
m_deltaY
=
dy
; }
57
58
void
paint
(
QWidget
*
widget
,
QPaintEvent
*
e
)
const
;
59
void
paint
(
QPainter
&
p
,
const
QWidget
*
widget
,
QPaintEvent
*
e
)
const
;
60
61
QPoint
snapPoint
(
const
QPoint
&
p
)
const
;
62
63
int
widgetHandleAdjustX
(
int
x
)
const
;
64
int
widgetHandleAdjustY
(
int
y
)
const
;
65
66
private
:
67
friend
bool
comparesEqual
(
const
Grid
&
lhs
,
const
Grid
&
rhs
)
noexcept
68
{
69
return
lhs
.
m_visible
==
rhs
.
m_visible
70
&&
lhs
.
m_snapX
==
rhs
.
m_snapX
&&
lhs
.
m_snapY
==
rhs
.
m_snapY
71
&&
lhs
.
m_deltaX
==
rhs
.
m_deltaX
&&
lhs
.
m_deltaY
==
rhs
.
m_deltaY
;
72
}
73
Q_DECLARE_EQUALITY_COMPARABLE
(
Grid
)
74
75
int
snapValue
(
int
value
,
int
grid
)
const
;
76
bool
m_visible
;
77
bool
m_snapX
;
78
bool
m_snapY
;
79
int
m_deltaX
;
80
int
m_deltaY
;
81
};
82
}
// namespace qdesigner_internal
83
84
QT_END_NAMESPACE
85
86
#
endif
// QDESIGNER_GRID_H
QPaintEngine::QPainter
friend class QPainter
Definition
qpaintengine.h:220
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:432
qdesigner_internal::FormEditorOptionsPage
Definition
formeditor_optionspage.h:23
qdesigner_internal::FormEditorOptionsPage::FormEditorOptionsPage
FormEditorOptionsPage(QDesignerFormEditorInterface *core)
Definition
formeditor_optionspage.cpp:80
qdesigner_internal::FormEditorOptionsPage::name
QString name() const override
Definition
formeditor_optionspage.cpp:85
qdesigner_internal::FormEditorOptionsPage::finish
void finish() override
Definition
formeditor_optionspage.cpp:170
qdesigner_internal::FormEditorOptionsPage::apply
void apply() override
Definition
formeditor_optionspage.cpp:137
qdesigner_internal::GridPanel
Definition
gridpanel_p.h:34
qdesigner_internal::Grid
Definition
grid_p.h:34
qdesigner_internal::QDesignerSharedSettings
Definition
shared_settings_p.h:43
qdesigner_internal::ZoomSettingsWidget
Definition
formeditor_optionspage.cpp:32
qdesigner_internal::ZoomSettingsWidget::fromSettings
void fromSettings(const QDesignerSharedSettings &s)
Definition
formeditor_optionspage.cpp:63
qdesigner_internal::ZoomSettingsWidget::toSettings
void toSettings(QDesignerSharedSettings &s) const
Definition
formeditor_optionspage.cpp:70
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_internal::ObjectNamingMode
ObjectNamingMode
Definition
shared_enums_p.h:58
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:33
qttools
src
designer
src
lib
shared
grid_p.h
Generated on
for Qt by
1.18.0