QGIS/python/gui/qgsunitselectionwidget.sip.in

238 lines
6.0 KiB
Plaintext
Raw Normal View History

2017-06-08 11:26:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsunitselectionwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapUnitScaleWidget : QgsPanelWidget
{
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A widget which allows the user to choose the minimum and maximum scale of an object in map units
and millimeters. This widget is designed to allow users to edit the properties of a
QgsMapUnitScale object.
2017-06-08 11:26:03 +02:00
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapUnitScaleDialog`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsUnitSelectionWidget`
2017-06-08 11:26:03 +02:00
%End
%TypeHeaderCode
2017-06-08 11:26:03 +02:00
#include "qgsunitselectionwidget.h"
%End
public:
QgsMapUnitScaleWidget( QWidget *parent /TransferThis/ = 0 );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsMapUnitScaleWidget.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parent: parent widget
2017-06-08 11:26:03 +02:00
%End
QgsMapUnitScale mapUnitScale() const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a QgsMapUnitScale representing the settings shown in the
widget.
.. seealso:: :py:func:`setMapUnitScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`mapUnitScaleChanged`
2017-06-08 11:26:03 +02:00
%End
void setMapUnitScale( const QgsMapUnitScale &scale );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Updates the widget to reflect the settings from the specified
QgsMapUnitScale object.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scale: map unit scale to show in widget
.. seealso:: :py:func:`mapUnitScale`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`mapUnitScaleChanged`
2017-06-08 11:26:03 +02:00
%End
void setMapCanvas( QgsMapCanvas *canvas );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map canvas associated with the widget. This allows the
widget to retrieve the current map scale from the canvas.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param canvas: map canvas
2017-06-08 11:26:03 +02:00
%End
signals:
void mapUnitScaleChanged( const QgsMapUnitScale &scale );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the settings in the widget are modified.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scale: QgsMapUnitScale reflecting new settings from the widget
2017-06-08 11:26:03 +02:00
%End
};
class QgsMapUnitScaleDialog : QDialog
{
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A dialog which allows the user to choose the minimum and maximum scale of an object in map units
and millimeters. This dialog is designed to allow users to edit the properties of a
QgsMapUnitScale object.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapUnitScaleWidget`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsUnitSelectionWidget`
%End
2017-06-08 11:26:03 +02:00
%TypeHeaderCode
#include "qgsunitselectionwidget.h"
%End
public:
2017-06-08 11:26:03 +02:00
QgsMapUnitScaleDialog( QWidget *parent /TransferThis/ = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsMapUnitScaleDialog.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parent: parent widget
2017-06-08 11:26:03 +02:00
%End
QgsMapUnitScale getMapUnitScale() const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a QgsMapUnitScale representing the settings shown in the
dialog.
.. seealso:: :py:func:`setMapUnitScale`
2017-06-08 11:26:03 +02:00
%End
void setMapUnitScale( const QgsMapUnitScale &scale );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Updates the dialog to reflect the settings from the specified
QgsMapUnitScale object.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scale: map unit scale to show in dialog
.. seealso:: :py:func:`mapUnitScale`
2017-06-08 11:26:03 +02:00
%End
void setMapCanvas( QgsMapCanvas *canvas );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map canvas associated with the dialog. This allows the dialog to retrieve the current
map scale from the canvas.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param canvas: map canvas
2017-06-08 11:26:03 +02:00
.. versionadded:: 2.12
%End
};
class QgsUnitSelectionWidget : QWidget
{
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A widget displaying a combobox allowing the user to choose between various display units,
such as millimeters or map unit. If the user chooses map units, a button appears allowing
adjustment of minimum and maximum scaling.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapUnitScaleWidget`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsMapUnitScaleDialog`
%End
2017-06-08 11:26:03 +02:00
%TypeHeaderCode
#include "qgsunitselectionwidget.h"
%End
public:
QgsUnitSelectionWidget( QWidget *parent /TransferThis/ = 0 );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsUnitSelectionWidget.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param parent: parent widget
2017-06-08 11:26:03 +02:00
%End
void setUnits( const QStringList &units, int mapUnitIdx );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units which the user can choose from in the combobox.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param units: list of strings for custom units to display in the widget
:param mapUnitIdx: specifies which entry corresponds to the map units, or -1 if none
2017-06-08 11:26:03 +02:00
%End
void setUnits( const QgsUnitTypes::RenderUnitList &units );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units which the user can choose from in the combobox. Clears any existing units.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param units: list of valid units
2017-06-08 11:26:03 +02:00
.. versionadded:: 2.9
%End
int getUnit() const;
2017-06-08 11:26:03 +02:00
%Docstring
Get the selected unit index
%End
QgsUnitTypes::RenderUnit unit() const;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the current predefined selected unit (if applicable).
:return: selected output unit, or QgsUnitTypes.RenderUnknownUnit if the widget was populated with custom unit types
2017-06-08 11:26:03 +02:00
.. versionadded:: 2.9
%End
void setUnit( int unitIndex ) /PyName=setUnitIndex/;
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the selected unit index
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unitIndex: index of unit to set as current
2017-06-08 11:26:03 +02:00
.. note::
available in Python bindings as setUnitIndex
%End
void setUnit( QgsUnitTypes::RenderUnit unit );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the selected unit
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: predefined unit to set as current
2017-06-08 11:26:03 +02:00
%End
QgsMapUnitScale getMapUnitScale() const;
2017-06-08 11:26:03 +02:00
%Docstring
Returns the map unit scale
%End
void setMapUnitScale( const QgsMapUnitScale &scale );
2017-06-08 11:26:03 +02:00
%Docstring
Sets the map unit scale
%End
void setMapCanvas( QgsMapCanvas *canvas );
2017-06-08 11:26:03 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map canvas associated with the widget. This allows the widget to retrieve the current
map scale from the canvas.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param canvas: map canvas
2017-06-08 11:26:03 +02:00
.. versionadded:: 2.12
%End
signals:
void changed();
};
2017-06-08 11:26:03 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsunitselectionwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/