Add size grip so Composer window can be resized by Mac OS X. Also delete rather than hide the status bar since it isn't used at all.

The size grip was previously provided by the status bar which was recently hidden to make room for buttons.


git-svn-id: http://svn.osgeo.org/qgis/trunk@6283 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
telwertowski 2006-12-19 08:19:28 +00:00
parent 7c5e9af681
commit ec8f060c1f
4 changed files with 19 additions and 4 deletions

View File

@ -40,6 +40,7 @@
#include <QToolBar>
#include <QImageWriter>
#include <QCheckBox>
#include <QSizeGrip>
#include <iostream>
@ -74,6 +75,11 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
mComposition = new QgsComposition( this, 1 );
mComposition->setActive ( true );
// Create size grip (needed by Mac OS X for QMainWindow if QStatusBar is not visible)
mSizeGrip = new QSizeGrip(this);
mSizeGrip->resize(mSizeGrip->sizeHint());
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());
if ( ! connect( mQgis, SIGNAL( projectRead() ), this, SLOT( projectRead()) ) ) {
qDebug( "unable to connect to projectRead" );
}
@ -87,8 +93,6 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
restoreWindowState();
selectItem(); // Set selection tool
statusBar()->setHidden(true);
}
QgsComposer::~QgsComposer()
@ -858,7 +862,14 @@ void QgsComposer::on_mActionAddImage_activated(void)
}
void QgsComposer::moveEvent ( QMoveEvent *e ) { saveWindowState(); }
void QgsComposer::resizeEvent ( QResizeEvent *e ) { saveWindowState(); }
void QgsComposer::resizeEvent ( QResizeEvent *e )
{
// Move size grip when window is resized
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());
saveWindowState();
}
void QgsComposer::saveWindowState()
{

View File

@ -31,6 +31,7 @@ class QDomDocument;
class QMoveEvent;
class QResizeEvent;
class QFile;
class QSizeGrip;
/* The constructor creates empty composer, without compositions and mFirstTime set to true.
* - if signal projectRead() is recieved all old compositions are deleted and
@ -193,6 +194,9 @@ private:
//! Layout
QGridLayout *mItemOptionsLayout;
//! Size grip
QSizeGrip *mSizeGrip;
//! Help context id
static const int context_id = 985715179;

View File

@ -52,6 +52,7 @@
#include <QProgressBar>
#include <QSettings>
#include <QSplashScreen>
#include <QStatusBar>
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>

View File

@ -221,7 +221,6 @@
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>