Skip to content

Commit

Permalink
[geometry-checker-gui] add scroll area and save geometry dialog to se…
Browse files Browse the repository at this point in the history
…ttings
  • Loading branch information
slarosa committed Sep 28, 2015
1 parent 2fa916d commit 7e61616
Show file tree
Hide file tree
Showing 5 changed files with 916 additions and 1,015 deletions.
10 changes: 10 additions & 0 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.cpp
Expand Up @@ -20,6 +20,7 @@

#include <QCloseEvent>
#include <QVBoxLayout>
#include <QSettings>

QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidget *parent )
: QDialog( parent )
Expand All @@ -28,6 +29,9 @@ QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidge

setWindowTitle( tr( "Check Geometries" ) );

QSettings s;
restoreGeometry( s.value( "/Plugin-GeometryChecker/Window/geometry" ).toByteArray() );

mTabWidget = new QTabWidget();
mButtonBox = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal );

Expand All @@ -44,6 +48,12 @@ QgsGeometryCheckerDialog::QgsGeometryCheckerDialog( QgisInterface *iface, QWidge
connect( mTabWidget->widget( 0 ), SIGNAL( checkerFinished( bool ) ), this, SLOT( onCheckerFinished( bool ) ) );
}

QgsGeometryCheckerDialog::~QgsGeometryCheckerDialog()
{
QSettings s;
s.setValue( "/Plugin-GeometryChecker/Window/geometry", saveGeometry() );
}

void QgsGeometryCheckerDialog::onCheckerStarted( QgsGeometryChecker *checker, QgsFeaturePool *featurePool )
{
delete mTabWidget->widget( 1 );
Expand Down
1 change: 1 addition & 0 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.h
Expand Up @@ -31,6 +31,7 @@ class QgsGeometryCheckerDialog : public QDialog
Q_OBJECT
public:
QgsGeometryCheckerDialog( QgisInterface* iface, QWidget* parent = 0 );
~QgsGeometryCheckerDialog();

private:
QgisInterface* mIface;
Expand Down
Expand Up @@ -537,6 +537,8 @@ void QgsGeometryCheckerResultTab::setDefaultResolutionMethods()
QVBoxLayout* layout = new QVBoxLayout( &dialog );

QScrollArea* scrollArea = new QScrollArea( &dialog );
scrollArea->setFrameShape( QFrame::NoFrame );
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( scrollArea );

QWidget* scrollAreaContents = new QWidget( scrollArea );
Expand Down

0 comments on commit 7e61616

Please sign in to comment.