Skip to content
Permalink
Browse files

handle composer window differently (partly reverts a30eb37)

  • Loading branch information
jef-n committed Jan 26, 2012
1 parent 6afdd35 commit e39e76653a9e1532b85801300b4ab6d44beb0d47
Showing with 24 additions and 5 deletions.
  1. +16 −2 src/app/composer/qgscomposer.cpp
  2. +1 −0 src/app/composer/qgscomposer.h
  3. +7 −3 src/app/qgisapp.cpp
18 src/app/composer/qgscomposer.cpp 100644 → 100755
@@ -69,12 +69,21 @@
#include <QPaintEngine>


QgsComposer::QgsComposer( QgisApp *qgis, const QString& title ): QMainWindow( qgis ), mTitle( title ), mUndoView( 0 )
QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
: QMainWindow()
, mTitle( title )
, mUndoView( 0 )
{
setupUi( this );
setWindowTitle( mTitle );
setupTheme();
QObject::connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );

QSettings settings;
int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt();
setIconSize( QSize( size, size ) );

setFontSize( settings.value( "/fontPointSize", QGIS_DEFAULT_FONTSIZE ).toInt() );

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
@@ -309,6 +318,11 @@ void QgsComposer::setIconSizes( int size )
}
}

void QgsComposer::setFontSize( int fontSize )
{
setStyleSheet( QString( "font-size: %1pt; " ).arg( fontSize ) );
}

void QgsComposer::connectSlots()
{
connect( mView, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) );
1 src/app/composer/qgscomposer.h 100644 → 100755
@@ -57,6 +57,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
void setupTheme();

void setIconSizes( int size );
void setFontSize( int size );

//! Open and show, set defaults if first time
void open();
@@ -1026,6 +1026,11 @@ void QgisApp::createActionGroups()
void QgisApp::setFontSize( int fontSize )
{
setStyleSheet( QString( "font-size: %1pt; " ).arg( fontSize ) );

foreach( QgsComposer *c, mPrintComposers )
{
c->setFontSize( fontSize );
}
}

void QgisApp::createMenus()
@@ -1403,10 +1408,9 @@ void QgisApp::setIconSizes( int size )
toolbar->setIconSize( QSize( size, size ) );
}

QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
for ( ; composerIt != mPrintComposers.end(); ++composerIt )
foreach( QgsComposer *c, mPrintComposers )
{
( *composerIt )->setIconSizes( size );
c->setIconSizes( size );
}
}

0 comments on commit e39e766

Please sign in to comment.
You can’t perform that action at this time.