Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flip all scale based widgets to use scale denominators instead of actual scales (ie 100.0 instead of 0.01 for 1:100). This is done for consistency with the rest of the API, which predominantly uses scale denominators. It also helps precision loss as a result of multiple 1.0 / scale conversions throughout the code. Refs #15337
- Loading branch information
1 parent
9f71156
commit 08a9bcb
Showing
28 changed files
with
648 additions
and
269 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,49 +1,104 @@ | |||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/qgsscalerangewidget.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ | |||
|
|||
|
|||
|
|||
|
|
||
class QgsScaleRangeWidget : QWidget | class QgsScaleRangeWidget : QWidget | ||
{ | { | ||
%Docstring | |||
A widget allowing entry of a range of map scales, e.g. minimum scale and maximum scale. | |||
%End | |||
|
|||
%TypeHeaderCode | %TypeHeaderCode | ||
#include "qgsscalerangewidget.h" | #include "qgsscalerangewidget.h" | ||
%End | %End | ||
|
|||
public: | public: | ||
explicit QgsScaleRangeWidget( QWidget *parent /TransferThis/ = 0 ); | |||
~QgsScaleRangeWidget(); | |||
|
|||
//! set the map canvas which will be used for the current scale buttons | |||
/** | |||
* @brief setMapCanvas set the map canvas which will be used for the current scale buttons | |||
* if not set, the buttons are hidden. | |||
*/ | |||
void setMapCanvas( QgsMapCanvas *mapCanvas ); | |||
|
|
||
//! return the minimum scale | explicit QgsScaleRangeWidget( QWidget *parent /TransferThis/ = 0 ); | ||
double minimumScale(); | %Docstring | ||
Constructor for QgsScaleRangeWidget. | |||
%End | |||
|
|
||
//! return the maximum scale | void setMapCanvas( QgsMapCanvas *canvas ); | ||
double maximumScale(); | %Docstring | ||
Sets the map ``canvas`` which will be used for the current scale buttons. | |||
If not set, the buttons are hidden. | |||
%End | |||
|
|
||
//! return the minimum scale denominator ( = 1 / maximum scale ) | double minimumScale() const; | ||
double minimumScaleDenom(); | %Docstring | ||
Returns the selected minimum scale, or 0 if minimum scale is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: maximumScale() | |||
.. seealso:: setMinimumScale() | |||
:rtype: float | |||
%End | |||
|
|
||
//! return the maximum scale denominator ( = 1 / minimum scale ) | double maximumScale() const; | ||
double maximumScaleDenom(); | %Docstring | ||
Returns the selected maximum scale, or 0 if maximum scale is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: minimumScale() | |||
.. seealso:: setMaximumScale() | |||
:rtype: float | |||
%End | |||
|
|
||
//! call to reload the project scales and apply them to the 2 scales combo boxes | |||
void reloadProjectScales(); | void reloadProjectScales(); | ||
%Docstring | |||
Call to reload the preset scales from the current project and apply them to the 2 scales combo boxes. | |||
%End | |||
|
|
||
public slots: | public slots: | ||
|
|||
void setMinimumScale( double scale ); | void setMinimumScale( double scale ); | ||
%Docstring | |||
Set the minimum ``scale``, or 0 to indicate the minimum is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: minimumScale() | |||
.. seealso:: setMaximumScale() | |||
.. seealso:: setScaleRange() | |||
%End | |||
|
|
||
void setMaximumScale( double scale ); | void setMaximumScale( double scale ); | ||
%Docstring | |||
Set the maximum ``scale``, or 0 to indicate the minimum is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: maximumScale() | |||
.. seealso:: setMinimumScale() | |||
.. seealso:: setScaleRange() | |||
%End | |||
|
|
||
void setScaleRange( double min, double max ); | void setScaleRange( double min, double max ); | ||
%Docstring | |||
Sets the scale range, from ``min`` scale to ``max`` scale. | |||
The scale values indicates the scale denominator, e.g. 1000.0 for a 1:1000 map, | |||
or 0 to indicate not set. | |||
.. seealso:: setMinimumScale() | |||
.. seealso:: setMaximumScale() | |||
%End | |||
|
|
||
signals: | signals: | ||
|
|
||
/** Emitted when the scale range set in the widget is changed. | |||
* @param min minimum scale | |||
* @param max maximum scale | |||
* @note added in QGIS 2.16 | |||
*/ | |||
void rangeChanged( double min, double max ); | void rangeChanged( double min, double max ); | ||
%Docstring | |||
Emitted when the scale range set in the widget is changed. | |||
The scale values indicates the scale denominator, e.g. 1000.0 for a 1:1000 map, | |||
or 0 to indicate not set. | |||
.. versionadded:: 2.16 | |||
%End | |||
|
|||
}; | }; | ||
|
|||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/qgsscalerangewidget.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,30 +1,87 @@ | |||
class QgsScaleVisibilityDialog : QObject | /************************************************************************ | ||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/qgsscalevisibilitydialog.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ | |||
|
|||
|
|||
|
|||
|
|||
class QgsScaleVisibilityDialog : QDialog | |||
{ | { | ||
%TypeHeaderCode | %Docstring | ||
#include <qgsscalevisibilitydialog.h> | A dialog allowing users to enter a scale visibility range. | ||
%End | %End | ||
|
|
||
%TypeHeaderCode | |||
#include "qgsscalevisibilitydialog.h" | |||
%End | |||
public: | public: | ||
explicit QgsScaleVisibilityDialog( QWidget *parent /TransferThis/ = 0, const QString &title = QString(), QgsMapCanvas *mapCanvas = 0 ); | |||
|
|
||
//! return if scale visibilty is enabled | explicit QgsScaleVisibilityDialog( QWidget *parent /TransferThis/ = 0, const QString &title = QString(), QgsMapCanvas *mapCanvas = 0 ); | ||
bool hasScaleVisibility(); | %Docstring | ||
Constructor for QgsScaleVisibilityDialog, with specified dialog ``title``. The ``mapCanvas`` argument | |||
can be used to associate the dialog with a map canvas, allowing use of the current map scale | |||
within the dialog. | |||
%End | |||
|
|
||
//! return minimum scale (true scale, not scale denominator) | bool hasScaleVisibility() const; | ||
double minimumScale(); | %Docstring | ||
Return true if scale based visibilty is enabled. | |||
:rtype: bool | |||
%End | |||
|
|
||
//! return maximum scale (true scale, not scale denominator) | double minimumScale() const; | ||
double maximumScale(); | %Docstring | ||
Returns the selected minimum scale, or 0 if minimum scale is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: maximumScale() | |||
.. seealso:: setMinimumScale() | |||
:rtype: float | |||
%End | |||
|
|
||
double maximumScale() const; | |||
%Docstring | |||
Returns the selected maximum scale, or 0 if maximum scale is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: minimumScale() | |||
.. seealso:: setMaximumScale()) | |||
:rtype: float | |||
%End | |||
|
|
||
public slots: | public slots: | ||
//! set if scale visibility is enabled |
|
||
void setScaleVisiblity( bool hasScaleVisibility ); | void setScaleVisiblity( bool hasScaleVisibility ); | ||
%Docstring | |||
Set whether scale based visibility is enabled. | |||
.. seealso:: hasScaleVisibility() | |||
%End | |||
|
|
||
//! set minimum scale (true scale, not scale denominator) | void setMinimumScale( double scale ); | ||
void setMinimumScale( double minScale ); | %Docstring | ||
Set the minimum ``scale``, or 0 to indicate the minimum is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: minimumScale() | |||
.. seealso:: setMaximumScale() | |||
%End | |||
|
|||
void setMaximumScale( double scale ); | |||
%Docstring | |||
Set the maximum ``scale``, or 0 to indicate the minimum is not set. | |||
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. | |||
.. seealso:: maximumScale() | |||
.. seealso:: setMinimumScale() | |||
%End | |||
|
|
||
//! set maximum scale (true scale, not scale denominator) | |||
void setMaximumScale( double maxScale ); | |||
|
|
||
}; | }; | ||
|
|||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/qgsscalevisibilitydialog.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ |
Oops, something went wrong.