Skip to content

Commit

Permalink
Add a dialog for inserting new pages into a layout
Browse files Browse the repository at this point in the history
nyalldawson committed Jul 25, 2017
1 parent 3648308 commit 5cfc9cc
Showing 11 changed files with 612 additions and 33 deletions.
7 changes: 6 additions & 1 deletion python/core/layout/qgspagesizeregistry.sip
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ class QgsPageSize

QgsPageSize();

QgsPageSize( const QString &name, const QgsLayoutSize &size );
QgsPageSize( const QString &name, const QgsLayoutSize &size, const QString &displayName = QString() );
%Docstring
Constructor for QgsPageSize, accepting the ``name`` of the page size and
page ``size``.
@@ -42,6 +42,11 @@ Name of page size
QgsLayoutSize size;
%Docstring
Page size
%End

QString displayName;
%Docstring
Translated page name
%End

bool operator==( const QgsPageSize &other ) const;
2 changes: 2 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -155,6 +155,7 @@ SET(QGIS_APP_SRCS
composer/qgscompositionwidget.cpp
composer/qgsatlascompositionwidget.cpp

layout/qgslayoutaddpagesdialog.cpp
layout/qgslayoutdesignerdialog.cpp

locator/qgsinbuiltlocatorfilters.cpp
@@ -332,6 +333,7 @@ SET (QGIS_APP_MOC_HDRS
composer/qgscompositionwidget.h
composer/qgsatlascompositionwidget.h

layout/qgslayoutaddpagesdialog.h
layout/qgslayoutdesignerdialog.h

locator/qgsinbuiltlocatorfilters.h
145 changes: 145 additions & 0 deletions src/app/layout/qgslayoutaddpagesdialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/***************************************************************************
qgslayoutaddpagesdialog.cpp
---------------------------
Date : July 2017
Copyright : (C) 2017 Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgslayoutaddpagesdialog.h"
#include "qgspagesizeregistry.h"
#include "qgssettings.h"
#include "qgslayout.h"


QgsLayoutAddPagesDialog::QgsLayoutAddPagesDialog( QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
{
setupUi( this );

mPageOrientationComboBox->addItem( tr( "Portrait" ), QgsLayoutItemPage::Portrait );
mPageOrientationComboBox->addItem( tr( "Landscape" ), QgsLayoutItemPage::Landscape );
mPageOrientationComboBox->setCurrentIndex( 1 );

Q_FOREACH ( const QgsPageSize &size, QgsApplication::pageSizeRegistry()->entries() )
{
mPageSizeComboBox->addItem( size.displayName, size.name );
}
mPageSizeComboBox->addItem( tr( "Custom" ) );
mPageSizeComboBox->setCurrentIndex( mPageSizeComboBox->findData( QStringLiteral( "A4" ) ) );
pageSizeChanged( mPageSizeComboBox->currentIndex() );
orientationChanged( 1 );

mSizeUnitsComboBox->linkToWidget( mWidthSpin );
mSizeUnitsComboBox->linkToWidget( mHeightSpin );

mLockAspectRatio->setWidthSpinBox( mWidthSpin );
mLockAspectRatio->setHeightSpinBox( mHeightSpin );

connect( mPositionComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::positionChanged );
mExistingPageSpinBox->setEnabled( false );

connect( mPageSizeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::pageSizeChanged );
connect( mPageOrientationComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::orientationChanged );
}

void QgsLayoutAddPagesDialog::setLayout( QgsLayout *layout )
{
mSizeUnitsComboBox->setConverter( &layout->context().measurementConverter() );
mExistingPageSpinBox->setMaximum( layout->pageCollection()->pageCount() );
}

int QgsLayoutAddPagesDialog::numberPages() const
{
return mPagesSpinBox->value();
}

QgsLayoutAddPagesDialog::PagePosition QgsLayoutAddPagesDialog::pagePosition() const
{
return static_cast< PagePosition >( mPositionComboBox->currentIndex() );
}

int QgsLayoutAddPagesDialog::beforePage() const
{
return mExistingPageSpinBox->value();
}

QgsLayoutSize QgsLayoutAddPagesDialog::pageSize() const
{
return QgsLayoutSize( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
}

void QgsLayoutAddPagesDialog::positionChanged( int index )
{
mExistingPageSpinBox->setEnabled( index != 2 );
}

void QgsLayoutAddPagesDialog::pageSizeChanged( int )
{
if ( mPageSizeComboBox->currentData().toString().isEmpty() )
{
//custom size
mWidthSpin->setEnabled( true );
mHeightSpin->setEnabled( true );
mLockAspectRatio->setEnabled( true );
mSizeUnitsComboBox->setEnabled( true );
mPageOrientationComboBox->setEnabled( false );
}
else
{
mWidthSpin->setEnabled( false );
mHeightSpin->setEnabled( false );
mLockAspectRatio->setEnabled( false );
mLockAspectRatio->setLocked( false );
mSizeUnitsComboBox->setEnabled( false );
mPageOrientationComboBox->setEnabled( true );
QgsPageSize size = QgsApplication::pageSizeRegistry()->find( mPageSizeComboBox->currentData().toString() ).value( 0 );
switch ( mPageOrientationComboBox->currentData().toInt() )
{
case QgsLayoutItemPage::Landscape:
mWidthSpin->setValue( size.size.height() );
mHeightSpin->setValue( size.size.width() );
break;

case QgsLayoutItemPage::Portrait:
mWidthSpin->setValue( size.size.width() );
mHeightSpin->setValue( size.size.height() );
break;
}
mSizeUnitsComboBox->setUnit( size.size.units() );
}
}

void QgsLayoutAddPagesDialog::orientationChanged( int )
{
if ( mPageSizeComboBox->currentData().toString().isEmpty() )
return;

double width = mWidthSpin->value();
double height = mHeightSpin->value();
switch ( mPageOrientationComboBox->currentData().toInt() )
{
case QgsLayoutItemPage::Landscape:
if ( width < height )
{
whileBlocking( mWidthSpin )->setValue( height );
whileBlocking( mHeightSpin )->setValue( width );
}
break;

case QgsLayoutItemPage::Portrait:
if ( width > height )
{
whileBlocking( mWidthSpin )->setValue( height );
whileBlocking( mHeightSpin )->setValue( width );
}
break;
}
}
83 changes: 83 additions & 0 deletions src/app/layout/qgslayoutaddpagesdialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/***************************************************************************
qgslayoutaddpagesdialog.h
-------------------------
Date : July 2017
Copyright : (C) 2017 Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSLAYOUTADDPAGESDIALOG_H
#define QGSLAYOUTADDPAGESDIALOG_H

#include "qgis.h"
#include "qgis_gui.h"
#include "ui_qgslayoutnewpagedialog.h"

#include "qgslayoutsize.h"
#include "qgslayoutpoint.h"
#include "qgslayoutitem.h"

/**
* A dialog for configuring properties of new pages to be added to a layout
*/
class QgsLayoutAddPagesDialog : public QDialog, private Ui::QgsLayoutNewPageDialog
{
Q_OBJECT

public:

enum PagePosition
{
BeforePage,
AfterPage,
AtEnd
};

/**
* Constructor for QgsLayoutAddPagesDialog.
*/
QgsLayoutAddPagesDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = 0 );

/**
* Sets the \a layout associated with the dialog. This allows the dialog
* to retrieve properties from the layout and perform tasks like automatic
* conversion of units.
*/
void setLayout( QgsLayout *layout );

/**
* Returns the number of pages to insert.
*/
int numberPages() const;

/**
* Returns the position at which to insert the new pages.
*/
PagePosition pagePosition() const;

/**
* Returns the page number for which new pages should be inserted before/after.
*/
int beforePage() const;

/**
* Returns the desired page size.
*/
QgsLayoutSize pageSize() const;

private slots:

void positionChanged( int index );
void pageSizeChanged( int index );
void orientationChanged( int index );

};

#endif // QGSLAYOUTADDPAGESDIALOG_H
35 changes: 35 additions & 0 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
#include "qgsgui.h"
#include "qgslayoutitemguiregistry.h"
#include "qgslayoutruler.h"
#include "qgslayoutaddpagesdialog.h"
#include <QShortcut>
#include <QComboBox>
#include <QLineEdit>
@@ -155,6 +156,8 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
connect( mActionZoomActual, &QAction::triggered, mView, &QgsLayoutView::zoomActual );
connect( mActionZoomToWidth, &QAction::triggered, mView, &QgsLayoutView::zoomWidth );

connect( mActionAddPages, &QAction::triggered, this, &QgsLayoutDesignerDialog::addPages );

//create status bar labels
mStatusCursorXLabel = new QLabel( mStatusBar );
mStatusCursorXLabel->setMinimumWidth( 100 );
@@ -454,6 +457,38 @@ void QgsLayoutDesignerDialog::toggleFullScreen( bool enabled )
}
}

void QgsLayoutDesignerDialog::addPages()
{
QgsLayoutAddPagesDialog dlg( this );
dlg.setLayout( mLayout );

if ( dlg.exec() )
{
int firstPagePosition = dlg.beforePage() - 1;
switch ( dlg.pagePosition() )
{
case QgsLayoutAddPagesDialog::BeforePage:
break;

case QgsLayoutAddPagesDialog::AfterPage:
firstPagePosition = firstPagePosition + 1;
break;

case QgsLayoutAddPagesDialog::AtEnd:
firstPagePosition = mLayout->pageCollection()->pageCount();
break;

}

for ( int i = 0; i < dlg.numberPages(); ++i )
{
QgsLayoutItemPage *page = new QgsLayoutItemPage( mLayout );
page->setPageSize( dlg.pageSize() );
mLayout->pageCollection()->insertPage( page, firstPagePosition + i );
}
}
}

QgsLayoutView *QgsLayoutDesignerDialog::view()
{
return mView;
2 changes: 2 additions & 0 deletions src/app/layout/qgslayoutdesignerdialog.h
Original file line number Diff line number Diff line change
@@ -133,6 +133,8 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner

void toggleFullScreen( bool enabled );

void addPages();

private:

QgsAppLayoutDesignerInterface *mInterface = nullptr;
61 changes: 31 additions & 30 deletions src/core/layout/qgspagesizeregistry.cpp
Original file line number Diff line number Diff line change
@@ -22,35 +22,35 @@

QgsPageSizeRegistry::QgsPageSizeRegistry()
{
add( QgsPageSize( QStringLiteral( "A6" ), QgsLayoutSize( 105, 148 ) ) );
add( QgsPageSize( QStringLiteral( "A5" ), QgsLayoutSize( 148, 210 ) ) );
add( QgsPageSize( QStringLiteral( "A4" ), QgsLayoutSize( 210, 297 ) ) );
add( QgsPageSize( QStringLiteral( "A3" ), QgsLayoutSize( 297, 420 ) ) );
add( QgsPageSize( QStringLiteral( "A2" ), QgsLayoutSize( 420, 594 ) ) );
add( QgsPageSize( QStringLiteral( "A1" ), QgsLayoutSize( 594, 841 ) ) );
add( QgsPageSize( QStringLiteral( "A0" ), QgsLayoutSize( 841, 1189 ) ) );
add( QgsPageSize( QStringLiteral( "B6" ), QgsLayoutSize( 125, 176 ) ) );
add( QgsPageSize( QStringLiteral( "B5" ), QgsLayoutSize( 176, 250 ) ) );
add( QgsPageSize( QStringLiteral( "B4" ), QgsLayoutSize( 250, 353 ) ) );
add( QgsPageSize( QStringLiteral( "B3" ), QgsLayoutSize( 353, 500 ) ) );
add( QgsPageSize( QStringLiteral( "B2" ), QgsLayoutSize( 500, 707 ) ) );
add( QgsPageSize( QStringLiteral( "B1" ), QgsLayoutSize( 707, 1000 ) ) );
add( QgsPageSize( QStringLiteral( "B0" ), QgsLayoutSize( 1000, 1414 ) ) );
add( QgsPageSize( QStringLiteral( "Legal" ), QgsLayoutSize( 215.9, 355.6 ) ) );
add( QgsPageSize( QStringLiteral( "Letter" ), QgsLayoutSize( 215.9, 279.4 ) ) );
add( QgsPageSize( QStringLiteral( "ANSI A" ), QgsLayoutSize( 215.9, 279.4 ) ) );
add( QgsPageSize( QStringLiteral( "ANSI B" ), QgsLayoutSize( 279.4, 431.8 ) ) );
add( QgsPageSize( QStringLiteral( "ANSI C" ), QgsLayoutSize( 431.8, 558.8 ) ) );
add( QgsPageSize( QStringLiteral( "ANSI D" ), QgsLayoutSize( 558.8, 863.6 ) ) );
add( QgsPageSize( QStringLiteral( "ANSI E" ), QgsLayoutSize( 863.6, 1117.6 ) ) );
add( QgsPageSize( QStringLiteral( "Arch A" ), QgsLayoutSize( 228.6, 304.8 ) ) );
add( QgsPageSize( QStringLiteral( "Arch B" ), QgsLayoutSize( 304.8, 457.2 ) ) );
add( QgsPageSize( QStringLiteral( "Arch C" ), QgsLayoutSize( 457.2, 609.6 ) ) );
add( QgsPageSize( QStringLiteral( "Arch D" ), QgsLayoutSize( 609.6, 914.4 ) ) );
add( QgsPageSize( QStringLiteral( "Arch E" ), QgsLayoutSize( 914.4, 1219.2 ) ) );
add( QgsPageSize( QStringLiteral( "Arch E1" ), QgsLayoutSize( 762, 1066.8 ) ) );
add( QgsPageSize( QStringLiteral( "Arch E2" ), QgsLayoutSize( 660, 965 ) ) );
add( QgsPageSize( QStringLiteral( "Arch E3" ), QgsLayoutSize( 686, 991 ) ) );
add( QgsPageSize( QStringLiteral( "A6" ), QgsLayoutSize( 105, 148 ), QObject::tr( "A6" ) ) );
add( QgsPageSize( QStringLiteral( "A5" ), QgsLayoutSize( 148, 210 ), QObject::tr( "A5" ) ) );
add( QgsPageSize( QStringLiteral( "A4" ), QgsLayoutSize( 210, 297 ), QObject::tr( "A4" ) ) );
add( QgsPageSize( QStringLiteral( "A3" ), QgsLayoutSize( 297, 420 ), QObject::tr( "A3" ) ) );
add( QgsPageSize( QStringLiteral( "A2" ), QgsLayoutSize( 420, 594 ), QObject::tr( "A2" ) ) );
add( QgsPageSize( QStringLiteral( "A1" ), QgsLayoutSize( 594, 841 ), QObject::tr( "A1" ) ) );
add( QgsPageSize( QStringLiteral( "A0" ), QgsLayoutSize( 841, 1189 ), QObject::tr( "A0" ) ) );
add( QgsPageSize( QStringLiteral( "B6" ), QgsLayoutSize( 125, 176 ), QObject::tr( "B6" ) ) );
add( QgsPageSize( QStringLiteral( "B5" ), QgsLayoutSize( 176, 250 ), QObject::tr( "B5" ) ) );
add( QgsPageSize( QStringLiteral( "B4" ), QgsLayoutSize( 250, 353 ), QObject::tr( "B4" ) ) );
add( QgsPageSize( QStringLiteral( "B3" ), QgsLayoutSize( 353, 500 ), QObject::tr( "B3" ) ) );
add( QgsPageSize( QStringLiteral( "B2" ), QgsLayoutSize( 500, 707 ), QObject::tr( "B2" ) ) );
add( QgsPageSize( QStringLiteral( "B1" ), QgsLayoutSize( 707, 1000 ), QObject::tr( "B1" ) ) );
add( QgsPageSize( QStringLiteral( "B0" ), QgsLayoutSize( 1000, 1414 ), QObject::tr( "B0" ) ) );
add( QgsPageSize( QStringLiteral( "Legal" ), QgsLayoutSize( 215.9, 355.6 ), QObject::tr( "Legal" ) ) );
add( QgsPageSize( QStringLiteral( "Letter" ), QgsLayoutSize( 215.9, 279.4 ), QObject::tr( "Letter" ) ) );
add( QgsPageSize( QStringLiteral( "ANSI A" ), QgsLayoutSize( 215.9, 279.4 ), QObject::tr( "ANSI A" ) ) );
add( QgsPageSize( QStringLiteral( "ANSI B" ), QgsLayoutSize( 279.4, 431.8 ), QObject::tr( "ANSI B" ) ) );
add( QgsPageSize( QStringLiteral( "ANSI C" ), QgsLayoutSize( 431.8, 558.8 ), QObject::tr( "ANSI C" ) ) );
add( QgsPageSize( QStringLiteral( "ANSI D" ), QgsLayoutSize( 558.8, 863.6 ), QObject::tr( "ANSI D" ) ) );
add( QgsPageSize( QStringLiteral( "ANSI E" ), QgsLayoutSize( 863.6, 1117.6 ), QObject::tr( "ANSI E" ) ) );
add( QgsPageSize( QStringLiteral( "Arch A" ), QgsLayoutSize( 228.6, 304.8 ), QObject::tr( "Arch A" ) ) );
add( QgsPageSize( QStringLiteral( "Arch B" ), QgsLayoutSize( 304.8, 457.2 ), QObject::tr( "Arch B" ) ) );
add( QgsPageSize( QStringLiteral( "Arch C" ), QgsLayoutSize( 457.2, 609.6 ), QObject::tr( "Arch C" ) ) );
add( QgsPageSize( QStringLiteral( "Arch D" ), QgsLayoutSize( 609.6, 914.4 ), QObject::tr( "Arch D" ) ) );
add( QgsPageSize( QStringLiteral( "Arch E" ), QgsLayoutSize( 914.4, 1219.2 ), QObject::tr( "Arch E" ) ) );
add( QgsPageSize( QStringLiteral( "Arch E1" ), QgsLayoutSize( 762, 1066.8 ), QObject::tr( "Arch E1" ) ) );
add( QgsPageSize( QStringLiteral( "Arch E2" ), QgsLayoutSize( 660, 965 ), QObject::tr( "Arch E2" ) ) );
add( QgsPageSize( QStringLiteral( "Arch E3" ), QgsLayoutSize( 686, 991 ), QObject::tr( "Arch E3" ) ) );
}

void QgsPageSizeRegistry::add( const QgsPageSize &size )
@@ -103,9 +103,10 @@ QgsPageSize::QgsPageSize()
{
}

QgsPageSize::QgsPageSize( const QString &pageName, const QgsLayoutSize &pageSize )
QgsPageSize::QgsPageSize( const QString &pageName, const QgsLayoutSize &pageSize, const QString &displayName )
: name( pageName )
, size( pageSize )
, displayName( displayName )
{
}

5 changes: 4 additions & 1 deletion src/core/layout/qgspagesizeregistry.h
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class CORE_EXPORT QgsPageSize
* Constructor for QgsPageSize, accepting the \a name of the page size and
* page \a size.
*/
QgsPageSize( const QString &name, const QgsLayoutSize &size );
QgsPageSize( const QString &name, const QgsLayoutSize &size, const QString &displayName = QString() );

/**
* Constructor for QgsPageSize, accepting a page \a size.
@@ -53,6 +53,9 @@ class CORE_EXPORT QgsPageSize
//! Page size
QgsLayoutSize size;

//! Translated page name
QString displayName;

bool operator==( const QgsPageSize &other ) const;
bool operator!=( const QgsPageSize &other ) const;
};
2 changes: 1 addition & 1 deletion src/gui/layout/qgslayoutunitscombobox.cpp
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ void QgsLayoutUnitsComboBox::indexChanged( int )
Q_FOREACH ( const QPointer< QDoubleSpinBox > &widget, mLinkedSpinBoxes )
{
if ( widget )
widget->setValue( mConverter->convert( QgsLayoutMeasurement( widget->value(), mOldUnit ), newUnit ).length() );
whileBlocking( widget.data() )->setValue( mConverter->convert( QgsLayoutMeasurement( widget->value(), mOldUnit ), newUnit ).length() );
}
}
emit changed( newUnit );
10 changes: 10 additions & 0 deletions src/ui/layout/qgslayoutdesignerbase.ui
Original file line number Diff line number Diff line change
@@ -90,6 +90,7 @@
<property name="title">
<string>&amp;Layout</string>
</property>
<addaction name="mActionAddPages"/>
<addaction name="mActionClose"/>
</widget>
<widget class="QMenu" name="mItemMenu">
@@ -291,6 +292,15 @@
<string>F11</string>
</property>
</action>
<action name="mActionAddPages">
<property name="icon">
<iconset resource="../../../images/images.qrc">
<normaloff>:/images/themes/default/mActionFileNew.svg</normaloff>:/images/themes/default/mActionFileNew.svg</iconset>
</property>
<property name="text">
<string>Add Pages…</string>
</property>
</action>
</widget>
<resources>
<include location="../../../images/images.qrc"/>
293 changes: 293 additions & 0 deletions src/ui/layout/qgslayoutnewpagedialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsLayoutNewPageDialog</class>
<widget class="QDialog" name="QgsLayoutNewPageDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>415</width>
<height>321</height>
</rect>
</property>
<property name="windowTitle">
<string>New Item Properties</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0" colspan="4">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Page size</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mWidthLabel">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mPageOrientationComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Orientation</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mPageSizeComboBox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mHeightLabel">
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout_3" columnstretch="1,0,0,0,1">
<item row="0" column="4" rowspan="2">
<widget class="QgsLayoutUnitsComboBox" name="mSizeUnitsComboBox"/>
</item>
<item row="0" column="3" rowspan="2">
<layout class="QHBoxLayout" name="_2">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QgsRatioLockButton" name="mLockAspectRatio">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Lock aspect ratio (including while drawing extent onto canvas)</string>
</property>
<property name="leftMargin" stdset="0">
<number>13</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" colspan="3">
<widget class="QgsDoubleSpinBox" name="mWidthSpin">
<property name="suffix">
<string/>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>9999999.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
<property name="showClearButton" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QgsDoubleSpinBox" name="mHeightSpin">
<property name="suffix">
<string/>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>9999999.000000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
<property name="showClearButton" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,1,0,1">
<item row="0" column="1">
<widget class="QSpinBox" name="mPagesSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>page(s)</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Insert</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="mPositionComboBox">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>Before Page</string>
</property>
</item>
<item>
<property name="text">
<string>After Page</string>
</property>
</item>
<item>
<property name="text">
<string>At End</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="mExistingPageSpinBox">
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="4" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsRatioLockButton</class>
<extends>QToolButton</extends>
<header>qgsratiolockbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qgsdoublespinbox.h</header>
</customwidget>
<customwidget>
<class>QgsLayoutUnitsComboBox</class>
<extends>QComboBox</extends>
<header>qgslayoutunitscombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mPagesSpinBox</tabstop>
<tabstop>mPositionComboBox</tabstop>
<tabstop>mExistingPageSpinBox</tabstop>
<tabstop>mPageSizeComboBox</tabstop>
<tabstop>mPageOrientationComboBox</tabstop>
<tabstop>mWidthSpin</tabstop>
<tabstop>mHeightSpin</tabstop>
<tabstop>mLockAspectRatio</tabstop>
<tabstop>mSizeUnitsComboBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>QgsLayoutNewPageDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QgsLayoutNewPageDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

0 comments on commit 5cfc9cc

Please sign in to comment.