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