Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge remote-tracking branch 'denis/scalevisiblayers_newlegend' into …
…legend-refactoring
- Loading branch information
Showing
9 changed files
with
256 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class QgsScaleVisibilityDialog : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsscalevisibilitydialog.h> | ||
%End | ||
|
||
public: | ||
explicit QgsScaleVisibilityDialog( QWidget *parent = 0, QString title = QString(), QgsMapCanvas* mapCanvas = 0 ); | ||
|
||
//! return if scale visibilty is enabled | ||
bool hasScaleVisibility(); | ||
|
||
//! return minimum scale (true scale, not scale denominator) | ||
double minimumScale(); | ||
|
||
//! return maximum scale (true scale, not scale denominator) | ||
double maximumScale(); | ||
|
||
|
||
public slots: | ||
//! set if scale visibility is enabled | ||
void setScaleVisiblity( bool hasScaleVisibility ); | ||
|
||
//! set minimum scale (true scale, not scale denominator) | ||
void setMinimumScale( double minScale ); | ||
|
||
//! set maximum scale (true scale, not scale denominator) | ||
void setMaximumScale( double maxScale ); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/*************************************************************************** | ||
qgsscalevisibilitydialog.cpp | ||
-------------------------------------- | ||
Date : 20.05.2014 | ||
Copyright : (C) 2014 Denis Rouzaud | ||
Email : denis.rouzaud@gmail.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 <QGridLayout> | ||
#include <QDialogButtonBox> | ||
|
||
|
||
#include "qgsscalevisibilitydialog.h" | ||
|
||
|
||
|
||
QgsScaleVisibilityDialog::QgsScaleVisibilityDialog( QWidget *parent, QString title, QgsMapCanvas* mapCanvas ) : | ||
QDialog( parent ) | ||
{ | ||
if ( !title.isEmpty() ) | ||
{ | ||
setWindowTitle( title ); | ||
} | ||
|
||
QGridLayout* dlgLayout = new QGridLayout( this ); | ||
//dlgLayout->setContentsMargins( 0, 0, 0, 0 ); | ||
|
||
mGroupBox = new QGroupBox( this ); | ||
mGroupBox->setCheckable( true ); | ||
mGroupBox->setTitle( tr( "Scale visibility " ) ); | ||
|
||
QGridLayout* gbLayout = new QGridLayout( this ); | ||
//gbLayout->setContentsMargins( 0, 0, 0, 0 ); | ||
|
||
mScaleWidget = new QgsScaleRangeWidget( this ); | ||
if ( mapCanvas ) | ||
{ | ||
mScaleWidget->setMapCanvas( mapCanvas ); | ||
} | ||
gbLayout->addWidget( mScaleWidget, 0, 0 ); | ||
mGroupBox->setLayout( gbLayout ); | ||
|
||
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok, Qt::Horizontal, this ); | ||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); | ||
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); | ||
|
||
dlgLayout->addWidget( mGroupBox, 0, 0 ); | ||
dlgLayout->addWidget( buttonBox, 1, 0 ); | ||
} | ||
|
||
void QgsScaleVisibilityDialog::setScaleVisiblity( bool hasScaleVisibility ) | ||
{ | ||
mGroupBox->setChecked( hasScaleVisibility ); | ||
} | ||
|
||
bool QgsScaleVisibilityDialog::hasScaleVisibility() | ||
{ | ||
return mGroupBox->isChecked(); | ||
} | ||
|
||
void QgsScaleVisibilityDialog::setMinimumScale( double minScale ) | ||
{ | ||
mScaleWidget->setMinimumScale( minScale ); | ||
} | ||
|
||
double QgsScaleVisibilityDialog::minimumScale() | ||
{ | ||
return mScaleWidget->minimumScale(); | ||
} | ||
|
||
void QgsScaleVisibilityDialog::setMaximumScale( double maxScale ) | ||
{ | ||
mScaleWidget->setMaximumScale( maxScale ); | ||
} | ||
|
||
double QgsScaleVisibilityDialog::maximumScale() | ||
{ | ||
return mScaleWidget->maximumScale(); | ||
} |
Oops, something went wrong.