From bab630e4bf0a9a651a7e15d0d15f9c0f57ab5e46 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 12 Dec 2012 22:40:30 +0100 Subject: QDialogButtonBox: add a missing constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting the buttons in the constructor is a use-case that happens more often than setting the orientation. Yet, there was a (Qt::Orientation,QWidget*) constructor, but no (StandardButtons,QWidget*) one. This patch adds it. Change-Id: If6a5c9f7450a388cd77bd93c8dd144b2fdc11847 Reviewed-by: Friedemann Kleint Reviewed-by: David Faure (KDE) Reviewed-by: Kevin Ottens Reviewed-by: Konstantin Ritt Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Giuseppe D'Angelo --- src/widgets/widgets/qdialogbuttonbox.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/widgets/widgets/qdialogbuttonbox.cpp') diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index bc5d84e259..226969cdd1 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -668,6 +668,21 @@ QDialogButtonBox::QDialogButtonBox(Qt::Orientation orientation, QWidget *parent) d_func()->initLayout(); } +/*! + \since 5.2 + + Constructs a horizontal button box with the given \a parent, containing + the standard buttons specified by \a buttons. + + \sa orientation, addButton() +*/ +QDialogButtonBox::QDialogButtonBox(StandardButtons buttons, QWidget *parent) + : QWidget(*new QDialogButtonBoxPrivate(Qt::Horizontal), parent, 0) +{ + d_func()->initLayout(); + d_func()->createStandardButtons(buttons); +} + /*! Constructs a button box with the given \a orientation and \a parent, containing the standard buttons specified by \a buttons. -- cgit v1.2.3