r23714 by jghali - #15977: QComboBox in Startup Dialog does not extend properly with Breeze/Oxygen theme

scribus-commit scribus-commit at lists.scribus.net
Fri May 8 20:29:13 UTC 2020


Author: jghali
Date: Fri May  8 20:29:13 2020
New Revision: 23714

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23714
Log:
#15977: QComboBox in Startup Dialog does not extend properly with Breeze/Oxygen theme

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

Modified: trunk/Scribus/scribus/ui/newdocdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23714&path=/trunk/Scribus/scribus/ui/newdocdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newdocdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/newdocdialog.cpp	Fri May  8 20:29:13 2020
@@ -6,7 +6,6 @@
 */
 #include "newdocdialog.h"
 
-#include <QFormLayout>
 #include <QGridLayout>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
@@ -94,12 +93,13 @@
 {
 	setObjectName(QString::fromLocal8Bit("NewDocumentWindow"));
 	setModal(true);
-	m_tabSelected = 0;
+
 	m_onStartup = startUp;
 	m_unitIndex = prefsManager.appPrefs.docSetupPrefs.docUnitIndex;
 	m_unitRatio = unitGetRatioFromIndex(m_unitIndex);
 	m_unitSuffix = unitGetSuffixFromIndex(m_unitIndex);
 	m_orientation = prefsManager.appPrefs.docSetupPrefs.pageOrientation;
+
 	setWindowTitle( tr( "New Document" ) );
 	setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
 	TabbedNewDocLayout = new QVBoxLayout( this );
@@ -262,8 +262,8 @@
 	marginGroup->setFacingPages(!(prefsManager.appPrefs.docSetupPrefs.pagePositioning == singlePage));
 	widthSpinBox->setValue(prefsManager.appPrefs.docSetupPrefs.pageWidth * m_unitRatio);
 	heightSpinBox->setValue(prefsManager.appPrefs.docSetupPrefs.pageHeight * m_unitRatio);
-	QStringList pageSizes=ps.activeSizeTRList();
-	int sizeIndex=pageSizes.indexOf(ps.nameTR());
+	QStringList pageSizes = ps.activeSizeTRList();
+	int sizeIndex = pageSizes.indexOf(ps.nameTR());
 	if (sizeIndex != -1)
 		pageSizeComboBox->setCurrentIndex(sizeIndex);
 	else
@@ -274,26 +274,26 @@
 
 	optionsGroupBox = new QGroupBox( newDocFrame );
 	optionsGroupBox->setTitle( tr( "Options" ) );
-	optionsGroupBoxLayout = new QFormLayout( optionsGroupBox );
+	optionsGroupBoxLayout = new QGridLayout( optionsGroupBox );
 	optionsGroupBoxLayout->setSpacing( 5 );
 	optionsGroupBoxLayout->setMargin( 10 );
 	optionsGroupBoxLayout->setAlignment( Qt::AlignTop );
-	optionsGroupBoxLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop);
-	optionsGroupBoxLayout->setLabelAlignment(Qt::AlignLeft);
 	pageCountLabel = new QLabel( tr( "N&umber of Pages:" ), optionsGroupBox );
 
 	pageCountSpinBox = new QSpinBox( optionsGroupBox );
 	pageCountSpinBox->setMaximum( 10000 );
 	pageCountSpinBox->setMinimum( 1 );
 	pageCountLabel->setBuddy(pageCountSpinBox);
-	optionsGroupBoxLayout->addRow( pageCountLabel, pageCountSpinBox);
+	optionsGroupBoxLayout->addWidget(pageCountLabel, 0, 0, Qt::AlignLeft);
+	optionsGroupBoxLayout->addWidget(pageCountSpinBox, 0, 1);
 
 	layoutLabel1 = new QLabel( optionsGroupBox );
 	layoutLabel1->setText( tr( "First Page is:" ) );
 	firstPage = new QComboBox( optionsGroupBox );
 	firstPage->clear();
 	selectItem(prefsManager.appPrefs.docSetupPrefs.pagePositioning);
-	optionsGroupBoxLayout->addRow( layoutLabel1, firstPage );
+	optionsGroupBoxLayout->addWidget(layoutLabel1, 1, 0, Qt::AlignLeft);
+	optionsGroupBoxLayout->addWidget(firstPage, 1, 1);
 	firstPage->setCurrentIndex(prefsManager.appPrefs.pageSets[prefsManager.appPrefs.docSetupPrefs.pagePositioning].FirstPage);
 
 	setDocLayout(prefsManager.appPrefs.docSetupPrefs.pagePositioning);
@@ -302,21 +302,23 @@
 
 	autoTextFrame = new QCheckBox( optionsGroupBox );
 	autoTextFrame->setText( tr( "&Automatic Text Frames" ) );
-	optionsGroupBoxLayout->addRow( autoTextFrame );
+	optionsGroupBoxLayout->addWidget(autoTextFrame, 2, 0, 1, 2, Qt::AlignLeft);
+
 	TextLabel3 = new QLabel( tr( "Colu&mns:" ), optionsGroupBox );
 	numberOfCols = new QSpinBox( optionsGroupBox );
 	numberOfCols->setButtonSymbols( QSpinBox::UpDownArrows );
 	numberOfCols->setMinimum( 1 );
 	numberOfCols->setValue( 1 );
 	TextLabel3->setBuddy(numberOfCols);
-	optionsGroupBoxLayout->addRow( TextLabel3, numberOfCols );
+	optionsGroupBoxLayout->addWidget(TextLabel3, 3, 0, Qt::AlignLeft);
+	optionsGroupBoxLayout->addWidget(numberOfCols, 3, 1);
 
 	TextLabel4 = new QLabel( tr( "&Gap:" ), optionsGroupBox );
 	Distance = new ScrSpinBox( 0, 1000, optionsGroupBox, m_unitIndex );
 	Distance->setValue(11 * m_unitRatio);
-	m_distance = 11;
-	optionsGroupBoxLayout->addRow( TextLabel4, Distance );
 	TextLabel4->setBuddy(Distance);
+	optionsGroupBoxLayout->addWidget(TextLabel4, 4, 0, Qt::AlignLeft);
+	optionsGroupBoxLayout->addWidget(Distance, 4, 1);
 
 	firstPage->setMinimumWidth(Distance->width());
 
@@ -327,7 +329,8 @@
 	startDocSetup = new QCheckBox( optionsGroupBox );
 	startDocSetup->setText( tr( "Show Document Settings After Creation" ) );
 	startDocSetup->setChecked(false);
-	optionsGroupBoxLayout->addRow( startDocSetup );
+	optionsGroupBoxLayout->addWidget(startDocSetup, 5, 0, 1, 2, Qt::AlignLeft);
+
 	NewDocLayout = new QGridLayout( newDocFrame );
 	NewDocLayout->setMargin(10);
 	NewDocLayout->setSpacing(5);

Modified: trunk/Scribus/scribus/ui/newdocdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23714&path=/trunk/Scribus/scribus/ui/newdocdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/newdocdialog.h	(original)
+++ trunk/Scribus/scribus/ui/newdocdialog.h	Fri May  8 20:29:13 2020
@@ -16,7 +16,6 @@
 
 class QCheckBox;
 class QComboBox;
-class QFormLayout;
 class QGridLayout;
 class QHBoxLayout;
 class QVBoxLayout;
@@ -74,42 +73,43 @@
 	void createOpenDocPage();
 	void createRecentDocPage();
 	void setSize(const QString& gr);
-	QTabWidget* tabWidget;
-	QFrame* newDocFrame;
-	PageLayoutsWidget* layoutsView;
-	QLabel* layoutLabel1;
-	QComboBox* firstPage;
-	QGroupBox* pageSizeGroupBox;
-	MarginWidget* marginGroup;
-	QGroupBox* optionsGroupBox;
-	QLabel* TextLabel1;
-	QLabel* TextLabel2;
-	QLabel* TextLabel3;
-	QLabel* TextLabel4;
-	QLabel* TextLabel1_2;
-	QLabel* TextLabel1_3;
-	QLabel* pageCountLabel;
-	QLabel* TextLabel2_2;
-	QLabel* unitOfMeasureLabel;
-	QComboBox* pageSizeComboBox;
-	QComboBox* pageOrientationComboBox;
-	QComboBox* unitOfMeasureComboBox;
-	QCheckBox* startUpDialog;
-	QCheckBox* autoTextFrame;
-	QCheckBox* startDocSetup;
-	ScrSpinBox* Distance;
-	QSpinBox* numberOfCols;
-	QSpinBox* pageCountSpinBox;
-	ScrSpinBox* widthSpinBox;
-	ScrSpinBox* heightSpinBox;
-	QFrame* openDocFrame;
-	QFileDialog *fileDialog;
-	QFrame* newFromTempFrame;
-	nftwidget *nftGui;
-	QFrame* recentDocFrame;
-	QListWidget* recentDocListBox;
-	QPushButton* OKButton;
-	QPushButton* CancelB;
+
+	QTabWidget* tabWidget {nullptr};
+	QFrame* newDocFrame {nullptr};
+	PageLayoutsWidget* layoutsView {nullptr};
+	QLabel* layoutLabel1 {nullptr};
+	QComboBox* firstPage {nullptr};
+	QGroupBox* pageSizeGroupBox {nullptr};
+	MarginWidget* marginGroup {nullptr};
+	QGroupBox* optionsGroupBox {nullptr};
+	QLabel* TextLabel1 {nullptr};
+	QLabel* TextLabel2 {nullptr};
+	QLabel* TextLabel3 {nullptr};
+	QLabel* TextLabel4 {nullptr};
+	QLabel* TextLabel1_2 {nullptr};
+	QLabel* TextLabel1_3 {nullptr};
+	QLabel* pageCountLabel {nullptr};
+	QLabel* TextLabel2_2 {nullptr};
+	QLabel* unitOfMeasureLabel {nullptr};
+	QComboBox* pageSizeComboBox {nullptr};
+	QComboBox* pageOrientationComboBox {nullptr};
+	QComboBox* unitOfMeasureComboBox {nullptr};
+	QCheckBox* startUpDialog {nullptr};
+	QCheckBox* autoTextFrame {nullptr};
+	QCheckBox* startDocSetup {nullptr};
+	ScrSpinBox* Distance {nullptr};
+	QSpinBox* numberOfCols {nullptr};
+	QSpinBox* pageCountSpinBox {nullptr};
+	ScrSpinBox* widthSpinBox {nullptr};
+	ScrSpinBox* heightSpinBox {nullptr};
+	QFrame* openDocFrame {nullptr};
+	QFileDialog *fileDialog {nullptr};
+	QFrame* newFromTempFrame {nullptr};
+	nftwidget *nftGui {nullptr};
+	QFrame* recentDocFrame {nullptr};
+	QListWidget* recentDocListBox {nullptr};
+	QPushButton* OKButton {nullptr};
+	QPushButton* CancelB {nullptr};
 
 	bool onStartup() const { return m_onStartup;}
 	int  tabSelected() const { return m_tabSelected;}
@@ -120,7 +120,6 @@
 	double unitRatio()   const { return m_unitRatio; }
 
 	int    orientation() const { return m_orientation;}
-	int    precision() const { return m_precision;}
 	int    choosenLayout() const { return m_choosenLayout;}
 	double pageWidth() const { return m_pageWidth;}
 	double pageHeight() const { return m_pageHeight;}
@@ -156,33 +155,32 @@
 	void openFileDialogFileClicked(const QString &path);
 
 protected:
-	QVBoxLayout* TabbedNewDocLayout;
-	QHBoxLayout* Layout1;
-	QGridLayout* NewDocLayout;
-	QGridLayout* pageSizeGroupBoxLayout;
-	QFormLayout* optionsGroupBoxLayout;
-	QVBoxLayout* openDocLayout;
-	QVBoxLayout* recentDocLayout;
-	QVBoxLayout *verticalLayout;
+	QVBoxLayout* TabbedNewDocLayout {nullptr};
+	QHBoxLayout* Layout1 {nullptr};
+	QGridLayout* NewDocLayout {nullptr};
+	QGridLayout* pageSizeGroupBoxLayout {nullptr};
+	QGridLayout* optionsGroupBoxLayout {nullptr};
+	QVBoxLayout* openDocLayout {nullptr};
+	QVBoxLayout* recentDocLayout {nullptr};
+	QVBoxLayout *verticalLayout {nullptr};
 	PrefsManager& prefsManager;
 	QStringList recentDocList;
 
-	double m_unitRatio;
-	int m_orientation;
-	int m_precision;
-	int m_choosenLayout;
+	double m_unitRatio { 1.0 };
+	int m_orientation { 0 };
+	int m_choosenLayout { 0 };
 	double m_pageWidth;
 	double m_pageHeight;
-	double m_distance;
+	double m_distance { 11.0 };
 	QString m_unitSuffix;
 	QString m_selectedFile;
-	int m_unitIndex;
-	int m_tabSelected;
+	int m_unitIndex { 0 };
+	int m_tabSelected { 0 };
 	bool m_onStartup;
-	double m_bleedBottom;
-	double m_bleedTop;
-	double m_bleedLeft;
-	double m_bleedRight;
+	double m_bleedBottom { 0.0 };
+	double m_bleedTop { 0.0 };
+	double m_bleedLeft { 0.0 };
+	double m_bleedRight { 0.0 };
 };
 
 #endif // NEWDOC_H




More information about the scribus-commit mailing list