From a5df6b69672afd780433ee8f43d343d1e2251fd4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 29 Jun 2016 19:53:36 +0200 Subject: Remove DialogButtonBox::flat The Material Design allows mixing standard flat buttons with non-flat custom buttons. It is enough that the delegate provides flat standard buttons by default. It is better to not force all buttons to be flat, but let the user freely specify whether custom buttons are flat. This API has not yet been released, so it is still safe to remove. Change-Id: Iec400553ccefb47f20fb98d64919491d9bb27cbe Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdialogbuttonbox.cpp | 33 --------------------------- 1 file changed, 33 deletions(-) (limited to 'src/quicktemplates2/qquickdialogbuttonbox.cpp') diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp index bc05bd7a..2f2ab479 100644 --- a/src/quicktemplates2/qquickdialogbuttonbox.cpp +++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp @@ -142,7 +142,6 @@ static QPlatformDialogHelper::ButtonRole buttonRole(QQuickAbstractButton *button } QQuickDialogButtonBoxPrivate::QQuickDialogButtonBoxPrivate() : - flat(false), alignment(0), position(QQuickDialogButtonBox::Footer), standardButtons(QPlatformDialogHelper::NoButton), @@ -358,36 +357,6 @@ QQuickDialogButtonBox::~QQuickDialogButtonBox() { } -/*! - \qmlproperty bool QtQuick.Controls::DialogButtonBox::flat - - This property holds whether the buttons in the button box are flat. - - The default value is \c false. - - \sa Button::flat -*/ -bool QQuickDialogButtonBox::isFlat() const -{ - Q_D(const QQuickDialogButtonBox); - return d->flat; -} - -void QQuickDialogButtonBox::setFlat(bool flat) -{ - Q_D(QQuickDialogButtonBox); - if (flat == d->flat) - return; - - for (int i = 0; i < count(); ++i) { - QQuickButton *button = qobject_cast(itemAt(i)); - if (button) - button->setFlat(flat); - } - - d->flat = flat; - emit flatChanged(); -} /*! \qmlproperty enumeration QtQuick.Controls::DialogButtonBox::position @@ -604,8 +573,6 @@ void QQuickDialogButtonBox::itemAdded(int index, QQuickItem *item) Q_UNUSED(index); if (QQuickAbstractButton *button = qobject_cast(item)) QObjectPrivate::connect(button, &QQuickAbstractButton::clicked, d, &QQuickDialogButtonBoxPrivate::handleClick); - if (QQuickButton *button = qobject_cast(item)) - button->setFlat(d->flat); if (QQuickDialogButtonBoxAttached *attached = qobject_cast(qmlAttachedPropertiesObject(item, false))) QQuickDialogButtonBoxAttachedPrivate::get(attached)->setButtonBox(this); if (isComponentComplete()) -- cgit v1.2.3