Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickweeknumbercolumn.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 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
6
7#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
8#include <QtQml/qqmlinfo.h>
9
11
16
50
52{
53 if (!contentItem)
54 return;
55
56 QSizeF itemSize;
57 itemSize.setWidth(contentItem->width());
58 itemSize.setHeight((contentItem->height() - 5 * spacing) / 6);
59
60 const auto childItems = contentItem->childItems();
62 item->setSize(itemSize);
63}
64
74
86{
87 Q_D(const QQuickWeekNumberColumn);
88 return d->model->month() - 1;
89}
90
92{
94 if (month < 0 || month > 11) {
95 qmlWarning(this) << "month " << month << " is out of range [0...11]";
96 return;
97 }
98 d->model->setMonth(month + 1);
99}
100
110{
111 Q_D(const QQuickWeekNumberColumn);
112 return d->model->year();
113}
114
116{
118 if (year < -271820 || year > 275759) {
119 qmlWarning(this) << "year " << year << " is out of range [-271820...275759]";
120 return;
121 }
122 d->model->setYear(year);
123}
124
133{
134 Q_D(const QQuickWeekNumberColumn);
135 return d->source;
136}
137
139{
141 if (d->source != source) {
142 d->source = source;
144 }
145}
146
165{
166 Q_D(const QQuickWeekNumberColumn);
167 return d->delegate;
168}
169
171{
173 if (d->delegate != delegate) {
174 d->delegate = delegate;
176 }
177}
178
185
186void QQuickWeekNumberColumn::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
187{
189 QQuickControl::geometryChange(newGeometry, oldGeometry);
191 d->resizeItems();
192}
193
194void QQuickWeekNumberColumn::localeChange(const QLocale &newLocale, const QLocale &oldLocale)
195{
197 QQuickControl::localeChange(newLocale, oldLocale);
198 d->model->setLocale(newLocale);
199}
200
201void QQuickWeekNumberColumn::paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding)
202{
204 QQuickControl::paddingChange(newPadding, oldPadding);
206 d->resizeItems();
207}
208
210
211#include "moc_qquickweeknumbercolumn_p.cpp"
\inmodule QtCore
Definition qmargins.h:270
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
The QQmlComponent class encapsulates a QML component definition.
QQuickDeferredPointer< QQuickItem > contentItem
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
virtual void localeChange(const QLocale &newLocale, const QLocale &oldLocale)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
virtual void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding)
QList< QQuickItem * > childItems
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
QList< QQuickItem * > childItems() const
Returns the children of this item.
qreal width
This property holds the width of this item.
Definition qquickitem.h:75
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal height
This property holds the height of this item.
Definition qquickitem.h:76
void setSource(const QVariant &source)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QQuickWeekNumberColumn(QQuickItem *parent=nullptr)
void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override
void setDelegate(QQmlComponent *delegate)
void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore
Definition qsize.h:208
constexpr void setHeight(qreal h) noexcept
Sets the height to the given finite height.
Definition qsize.h:341
constexpr void setWidth(qreal w) noexcept
Sets the width to the given finite width.
Definition qsize.h:338
\inmodule QtCore
Definition qvariant.h:65
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Definition qvariant.h:536
Combined button and popup list for selecting options.
GLsizei GLsizei GLchar * source
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define emit
QObject::connect nullptr
QGraphicsItem * item