10#include <QtCore/qpointer.h>
11#include <QtGui/private/qguiapplication_p.h>
12#include <QtGui/qpa/qplatformtheme.h>
13#include <QtQml/qqmlengine.h>
14#include <QtQml/qqmlcontext.h>
15#include <QtQml/qqmlcomponent.h>
194 y += (rectangle.
size().height() -
h) / 2;
196 y += rectangle.
size().height() -
h;
198 x += rectangle.
size().width() -
w;
200 x += (rectangle.
size().width() -
w) / 2;
210 QRectF geometry =
q->boundingRect().
adjusted(
q->leftPadding(),
q->topPadding(), -
q->rightPadding(), -
q->bottomPadding());
228 QList<QQuickAbstractButton *> buttons;
236 if (!
p->widthValid()) {
238 item->setWidth(itemWidth);
245 p->widthValidFlag =
false;
251 struct ButtonLayout {
263 const int *l = m_layout;
267 if (role == firstRole)
269 if (role == secondRole)
275 if (firstRole == secondRole)
285 for (
int i = 0;
i < buttons.size() - 1; ++
i)
286 q->insertItem(
i, buttons.at(
i));
297 qreal totalWidth = totalSpacing;
302 totalWidth +=
item->implicitWidth();
303 maxWidth =
qMax(maxWidth,
item->implicitWidth());
307 totalWidth =
qMax(totalWidth,
count * maxWidth + totalSpacing);
322 maxHeight =
qMax(maxHeight,
item->implicitHeight());
339 QPointer<QQuickDialogButtonBox> guard(
q);
365 emit q->helpRequested();
384 if (!creationContext)
406 int i =
q->count() - 1;
411 qmlAttachedPropertiesObject<QQuickDialogButtonBox>(
button,
false));
427 int i =
q->count() - 1;
432 qmlAttachedPropertiesObject<QQuickDialogButtonBox>(
button,
true));
585 return d->standardButtons;
591 if (
d->standardButtons == buttons)
594 d->removeStandardButtons();
608 d->standardButtons = buttons;
681 return d->buttonLayout;
693 emit buttonLayoutChanged();
742 return qobject_cast<QQuickAbstractButton *>(
item);
753 d->updateImplicitContentSize();
766 d->updateImplicitContentSize();
771#if QT_CONFIG(accessibility)
772QAccessible::Role QQuickDialogButtonBox::accessibleRole()
const
774 return QAccessible::PageTabList;
785 emit q->buttonBoxChanged();
793 while (parentItem && !
d->buttonBox) {
794 d->buttonBox = qobject_cast<QQuickDialogButtonBox *>(parentItem);
834 return d->buttonRole;
840 if (
d->buttonRole == role)
843 d->buttonRole = role;
849#include "moc_qquickdialogbuttonbox_p.cpp"
Type type() const
Returns the event type.
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
static QPlatformTheme * platformTheme()
static constexpr Policy Preferred
static constexpr Policy Fixed
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
QObject * parent() const
Returns a pointer to the parent object.
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
void deleteLater()
\threadsafe
The QQmlComponent class encapsulates a QML component definition.
virtual QObject * beginCreate(QQmlContext *)
Create an object instance from this component, within the specified context.
virtual void completeCreate()
This method provides advanced control over component instance creation.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
The QQmlContext class defines a context within a QML engine.
int count() const override
\qmlproperty int QtQml.Models::ObjectModel::count
QQuickItem * itemAt(int index) const
QQmlObjectModel * contentModel
Q_INVOKABLE void addItem(QQuickItem *item)
\qmlmethod void QtQuick.Controls::Container::addItem(Item item)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override
QQuickDeferredPointer< QQuickItem > contentItem
void updateImplicitContentWidth()
void updateImplicitContentHeight()
static QPlatformDialogHelper::ButtonRole buttonRole(QQuickAbstractButton *button)
Popup dialog with standard buttons and a title, used for short-term interaction with the user.
virtual void itemImplicitWidthChanged(QQuickItem *)
virtual void itemImplicitHeightChanged(QQuickItem *)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setSize(const QSizeF &size)
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
QQuickItem * parentItem() const
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
virtual void updatePolish()
This function should perform any layout as required for this item.
void setPosition(const QPointF &)
void polish()
Schedules a polish event for this item.
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QStyleOptionButton * btn
[3]
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLsizei const GLint * box
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QRectF alignedRect(bool mirrored, Qt::Alignment alignment, const QSizeF &size, const QRectF &rectangle)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
static const struct TessellationWindingOrderTab cw[]