r25016 by craig - QDialogButtonBox migration: ImportPage

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 11 21:23:01 UTC 2022


Author: craig
Date: Fri Mar 11 21:23:01 2022
New Revision: 25016

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25016
Log:
QDialogButtonBox migration: ImportPage

Modified:
    trunk/Scribus/scribus/ui/mergedoc.cpp
    trunk/Scribus/scribus/ui/mergedoc.h

Modified: trunk/Scribus/scribus/ui/mergedoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25016&path=/trunk/Scribus/scribus/ui/mergedoc.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/mergedoc.cpp	(original)
+++ trunk/Scribus/scribus/ui/mergedoc.cpp	Fri Mar 11 21:23:01 2022
@@ -97,18 +97,14 @@
 	}
 
 	dialogLayout->addLayout( fromInfoLayout );
-	importCancelLayout = new QHBoxLayout;
-	importCancelLayout->setContentsMargins(0, 0, 0, 0);
-	importCancelLayout->setSpacing(6);
-	QSpacerItem* spacer = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	importCancelLayout->addItem( spacer );
+	buttonBox = new QDialogButtonBox();
 	importButton = new QPushButton( tr( "&Import" ), this );
 	importButton->setEnabled(false);
-	importCancelLayout->addWidget( importButton );
+	buttonBox->addButton(importButton, QDialogButtonBox::AcceptRole);
 	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
 	cancelButton->setDefault(true);
-	importCancelLayout->addWidget( cancelButton );
-	dialogLayout->addLayout( importCancelLayout );
+	buttonBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
+	dialogLayout->addWidget(buttonBox);
 	resize(minimumSizeHint());
 
 	connect( importButton, SIGNAL( clicked() ), this, SLOT( accept() ) );

Modified: trunk/Scribus/scribus/ui/mergedoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25016&path=/trunk/Scribus/scribus/ui/mergedoc.h
==============================================================================
--- trunk/Scribus/scribus/ui/mergedoc.h	(original)
+++ trunk/Scribus/scribus/ui/mergedoc.h	Fri Mar 11 21:23:01 2022
@@ -11,6 +11,7 @@
 #define MERGEDOC_H
 
 #include <QDialog>
+#include <QDialogButtonBox>
 #include "scribusapi.h"
 
 class QCheckBox;
@@ -49,6 +50,7 @@
 	QLabel* fromLabel {nullptr};
 	QLineEdit* pageNumberData {nullptr};
 	QLineEdit* fromDocData {nullptr};
+	QDialogButtonBox* buttonBox {nullptr};
 	QPushButton* importButton {nullptr};
 	QPushButton* cancelButton {nullptr};
 	QPushButton* changeButton {nullptr};
@@ -58,7 +60,6 @@
 	QSpinBox* importWherePageData {nullptr};
 	QVBoxLayout* dialogLayout {nullptr};
 	QGridLayout* fromInfoLayout {nullptr};
-	QHBoxLayout* importCancelLayout {nullptr};
 	int count {0};
 	bool masterPages {false};
 




More information about the scribus-commit mailing list