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
qquickclippedtext.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qquickclippedtext_p.h"
6
7
#
include
<
QtQuick
/
private
/
qquickitem_p
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
QQuickClippedText::QQuickClippedText(QQuickItem *parent)
12
: QQuickText(parent)
13
{
14
}
15
16
qreal QQuickClippedText::clipX()
const
17
{
18
return
m_clipX;
19
}
20
21
void
QQuickClippedText::setClipX(qreal x)
22
{
23
if
(qFuzzyCompare(x, m_clipX))
24
return
;
25
26
m_clipX = x;
27
markClipDirty();
28
}
29
30
qreal QQuickClippedText::clipY()
const
31
{
32
return
m_clipY;
33
}
34
35
void
QQuickClippedText::setClipY(qreal y)
36
{
37
if
(qFuzzyCompare(y, m_clipY))
38
return
;
39
40
m_clipY = y;
41
markClipDirty();
42
}
43
44
qreal QQuickClippedText::clipWidth()
const
45
{
46
return
m_clipWidth ? m_clipWidth : width();
47
}
48
49
void
QQuickClippedText::setClipWidth(qreal width)
50
{
51
m_hasClipWidth =
true
;
52
if
(qFuzzyCompare(width, m_clipWidth))
53
return
;
54
55
m_clipWidth = width;
56
markClipDirty();
57
}
58
59
qreal QQuickClippedText::clipHeight()
const
60
{
61
return
m_clipHeight ? m_clipHeight : height();
62
}
63
64
void
QQuickClippedText::setClipHeight(qreal height)
65
{
66
m_hasClipHeight =
true
;
67
if
(qFuzzyCompare(height, m_clipHeight))
68
return
;
69
70
m_clipHeight = height;
71
markClipDirty();
72
}
73
74
QRectF QQuickClippedText::clipRect()
const
75
{
76
return
QRectF(clipX(), clipY(), clipWidth(), clipHeight());
77
}
78
79
void
QQuickClippedText::markClipDirty()
80
{
81
QQuickItemPrivate::get(
this
)->dirty(QQuickItemPrivate::Size);
82
}
83
84
QT_END_NAMESPACE
85
86
#
include
"moc_qquickclippedtext_p.cpp"
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtdeclarative
src
quickcontrolsimpl
qquickclippedtext.cpp
Generated on
for Qt by
1.14.0