From 303dd2f25ded3d9ba0654dc37d0444d6bfc49ad8 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 27 Oct 2021 13:02:18 +0200 Subject: [PATCH] using C++ auto --- playground/dialogbuttons/Window.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/playground/dialogbuttons/Window.cpp b/playground/dialogbuttons/Window.cpp index 4a1d119d..3bdc9177 100644 --- a/playground/dialogbuttons/Window.cpp +++ b/playground/dialogbuttons/Window.cpp @@ -30,7 +30,7 @@ Window::Window( Qt::Orientation orientation ) void Window::addBox( QskDialog::Actions actions ) { - QskDialogButtonBox* box = new QskDialogButtonBox( m_orientation ); + auto box = new QskDialogButtonBox( m_orientation ); box->setActions( actions ); box->setObjectName( "DialogBox" ); @@ -39,10 +39,10 @@ void Window::addBox( QskDialog::Actions actions ) void Window::addActionBox() { - QskPushButton* flipButton = new QskPushButton( "Flip" ); - QskPushButton* centerButton = new QskPushButton( "Center" ); + auto flipButton = new QskPushButton( "Flip" ); + auto centerButton = new QskPushButton( "Center" ); - QskDialogButtonBox* box = new QskDialogButtonBox( m_orientation ); + auto box = new QskDialogButtonBox( m_orientation ); box->addButton( flipButton, QskDialog::UserRole ); box->addButton( centerButton, QskDialog::UserRole ); box->setObjectName( "UserBox" ); @@ -62,8 +62,8 @@ void Window::flipOrientation() m_orientation = invertedOrientation(); - const QVector< QskDialogButtonBox* > boxes = dialogBoxes(); - for ( QskDialogButtonBox* box : boxes ) + const auto boxes = dialogBoxes(); + for ( auto box : boxes ) { box->setOrientation( m_orientation ); box->setParent( nullptr ); @@ -79,8 +79,8 @@ void Window::flipOrientation() void Window::centerButtons() { - const QVector< QskDialogButtonBox* > boxes = dialogBoxes(); - for ( QskDialogButtonBox* box : boxes ) + const auto boxes = dialogBoxes(); + for ( auto box : boxes ) box->setCenteredButtons( !box->centeredButtons() ); }