QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QgsExtentGroupBox Class Reference

Collapsible group box for configuration of extent, typically for a save operation. More...

#include <qgsextentgroupbox.h>

Inheritance diagram for QgsExtentGroupBox:
Inheritance graph
[legend]
Collaboration diagram for QgsExtentGroupBox:
Collaboration graph
[legend]

Public Types

enum  ExtentState { OriginalExtent, CurrentExtent, UserExtent }
 

Public Slots

void setOutputExtentFromOriginal ()
 set output extent to be the same as original extent (may be transformed to output CRS) More...
 
void setOutputExtentFromCurrent ()
 set output extent to be the same as current extent (may be transformed to output CRS) More...
 
void setOutputExtentFromUser (const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs)
 set output extent to custom extent (may be transformed to outut CRS) More...
 
- Public Slots inherited from QgsCollapsibleGroupBoxBasic
void checkToggled (bool ckd)
 
void checkClicked (bool ckd)
 
void toggleCollapsed ()
 

Signals

void extentChanged (const QgsRectangle &r)
 emitted when extent is changed More...
 
- Signals inherited from QgsCollapsibleGroupBoxBasic
void collapsedStateChanged (bool collapsed)
 Signal emitted when groupbox collapsed/expanded state is changed, and when first shown. More...
 

Public Member Functions

 QgsExtentGroupBox (QWidget *parent=0)
 
void setOriginalExtent (const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs)
 Setup original extent - should be called as part of initialization. More...
 
QgsRectangle originalExtent () const
 
const
QgsCoordinateReferenceSystem
originalCrs () const
 
void setCurrentExtent (const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs)
 Setup current extent - should be called as part of initialization (or whenever current extent changes) More...
 
QgsRectangle currentExtent () const
 
const
QgsCoordinateReferenceSystem
currentCrs () const
 
void setOutputCrs (const QgsCoordinateReferenceSystem &outputCrs)
 Set the output CRS - may need to be used for transformation from original/current extent. More...
 
QgsRectangle outputExtent () const
 Get the resulting extent - in output CRS coordinates. More...
 
ExtentState extentState () const
 
- Public Member Functions inherited from QgsCollapsibleGroupBox
 QgsCollapsibleGroupBox (QWidget *parent=0, QSettings *settings=0)
 
 QgsCollapsibleGroupBox (const QString &title, QWidget *parent=0, QSettings *settings=0)
 
 ~QgsCollapsibleGroupBox ()
 
void setSettings (QSettings *settings)
 
void setSaveCollapsedState (bool save)
 set this to false to not save/restore collapsed state More...
 
void setSaveCheckedState (bool save)
 set this to true to save/restore checked state More...
 
bool saveCollapsedState ()
 
bool saveCheckedState ()
 
void setSettingGroup (const QString &group)
 set this to a defined string to share save/restore states across different parent dialogs More...
 
QString settingGroup () const
 
- Public Member Functions inherited from QgsCollapsibleGroupBoxBasic
 QgsCollapsibleGroupBoxBasic (QWidget *parent=0)
 
 QgsCollapsibleGroupBoxBasic (const QString &title, QWidget *parent=0)
 
 ~QgsCollapsibleGroupBoxBasic ()
 
bool isCollapsed () const
 
void setCollapsed (bool collapse)
 
QString syncGroup () const
 Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key. More...
 
void setSyncGroup (QString grp)
 
void setScrollOnExpand (bool scroll)
 set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded More...
 
bool scrollOnExpand ()
 

Protected Slots

void on_mXMinLineEdit_textEdited (const QString &)
 
void on_mXMaxLineEdit_textEdited (const QString &)
 
void on_mYMinLineEdit_textEdited (const QString &)
 
void on_mYMaxLineEdit_textEdited (const QString &)
 
- Protected Slots inherited from QgsCollapsibleGroupBox
void loadState ()
 
void saveState ()
 

Protected Member Functions

void setOutputExtent (const QgsRectangle &r, const QgsCoordinateReferenceSystem &srcCrs, ExtentState state)
 
void setOutputExtentFromLineEdit ()
 
void updateTitle ()
 
- Protected Member Functions inherited from QgsCollapsibleGroupBox
void init ()
 
void showEvent (QShowEvent *event)
 
QString saveKey () const
 
- Protected Member Functions inherited from QgsCollapsibleGroupBoxBasic
void init ()
 
void collapseExpandFixes ()
 Visual fixes for when group box is collapsed/expanded. More...
 
void showEvent (QShowEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void changeEvent (QEvent *event)
 
void updateStyle ()
 
QRect titleRect () const
 
void clearModifiers ()
 

Protected Attributes

ExtentState mExtentState
 
QgsCoordinateReferenceSystem mOutputCrs
 
QgsRectangle mCurrentExtent
 
QgsCoordinateReferenceSystem mCurrentCrs
 
QgsRectangle mOriginalExtent
 
QgsCoordinateReferenceSystem mOriginalCrs
 
- Protected Attributes inherited from QgsCollapsibleGroupBox
QPointer< QSettings > mSettings
 
bool mDelSettings
 
bool mSaveCollapsedState
 
bool mSaveCheckedState
 
QString mSettingGroup
 
- Protected Attributes inherited from QgsCollapsibleGroupBoxBasic
bool mCollapsed
 
bool mInitFlat
 
bool mInitFlatChecked
 
bool mScrollOnExpand
 
bool mShown
 
QScrollArea * mParentScrollArea
 
QgsGroupBoxCollapseButtonmCollapseButton
 
QWidget * mSyncParent
 
QString mSyncGroup
 
bool mAltDown
 
bool mShiftDown
 
bool mTitleClicked
 

Additional Inherited Members

- Static Protected Attributes inherited from QgsCollapsibleGroupBoxBasic
static QIcon mCollapseIcon
 
static QIcon mExpandIcon
 
- Properties inherited from QgsCollapsibleGroupBox
bool collapsed
 
bool saveCollapsedState
 
bool saveCheckedState
 
QString syncGroup
 
bool scrollOnExpand
 
- Properties inherited from QgsCollapsibleGroupBoxBasic
bool collapsed
 
QString syncGroup
 
bool scrollOnExpand
 

Detailed Description

Collapsible group box for configuration of extent, typically for a save operation.

Besides allowing the user to enter the extent manually, it comes with options to use original extent or extent defined by the current view in map canvas.

When using the widget, make sure to call setOriginalExtent(), setCurrentExtent() and setOutputCrs() during initialization.

Note
added in 2.4

Definition at line 23 of file qgsextentgroupbox.h.

Member Enumeration Documentation

Enumerator
OriginalExtent 

layer's extent

CurrentExtent 

map canvas extent

UserExtent 

extent manually entered/modified by the user

Definition at line 29 of file qgsextentgroupbox.h.

Constructor & Destructor Documentation

QgsExtentGroupBox::QgsExtentGroupBox ( QWidget *  parent = 0)
explicit

Member Function Documentation

const QgsCoordinateReferenceSystem& QgsExtentGroupBox::currentCrs ( ) const
inline

Definition at line 46 of file qgsextentgroupbox.h.

Referenced by setCurrentExtent().

QgsRectangle QgsExtentGroupBox::currentExtent ( ) const
inline

Definition at line 45 of file qgsextentgroupbox.h.

Referenced by setCurrentExtent().

void QgsExtentGroupBox::extentChanged ( const QgsRectangle r)
signal

emitted when extent is changed

Referenced by setOutputExtent(), and setOutputExtentFromLineEdit().

ExtentState QgsExtentGroupBox::extentState ( ) const
inline

Definition at line 55 of file qgsextentgroupbox.h.

void QgsExtentGroupBox::on_mXMaxLineEdit_textEdited ( const QString &  )
inlineprotectedslot

Definition at line 74 of file qgsextentgroupbox.h.

void QgsExtentGroupBox::on_mXMinLineEdit_textEdited ( const QString &  )
inlineprotectedslot

Definition at line 73 of file qgsextentgroupbox.h.

void QgsExtentGroupBox::on_mYMaxLineEdit_textEdited ( const QString &  )
inlineprotectedslot

Definition at line 76 of file qgsextentgroupbox.h.

void QgsExtentGroupBox::on_mYMinLineEdit_textEdited ( const QString &  )
inlineprotectedslot

Definition at line 75 of file qgsextentgroupbox.h.

const QgsCoordinateReferenceSystem& QgsExtentGroupBox::originalCrs ( ) const
inline

Definition at line 40 of file qgsextentgroupbox.h.

Referenced by setOriginalExtent().

QgsRectangle QgsExtentGroupBox::originalExtent ( ) const
inline

Definition at line 39 of file qgsextentgroupbox.h.

Referenced by setOriginalExtent().

QgsRectangle QgsExtentGroupBox::outputExtent ( ) const

Get the resulting extent - in output CRS coordinates.

Definition at line 117 of file qgsextentgroupbox.cpp.

Referenced by setOutputExtentFromLineEdit().

void QgsExtentGroupBox::setCurrentExtent ( const QgsRectangle currentExtent,
const QgsCoordinateReferenceSystem currentCrs 
)

Setup current extent - should be called as part of initialization (or whenever current extent changes)

Definition at line 28 of file qgsextentgroupbox.cpp.

References currentCrs(), currentExtent(), mCurrentCrs, and mCurrentExtent.

void QgsExtentGroupBox::setOriginalExtent ( const QgsRectangle originalExtent,
const QgsCoordinateReferenceSystem originalCrs 
)

Setup original extent - should be called as part of initialization.

Definition at line 21 of file qgsextentgroupbox.cpp.

References mOriginalCrs, mOriginalExtent, originalCrs(), and originalExtent().

void QgsExtentGroupBox::setOutputCrs ( const QgsCoordinateReferenceSystem outputCrs)

Set the output CRS - may need to be used for transformation from original/current extent.

Should be called as part of initialization and whenever the the output CRS is changed

Definition at line 34 of file qgsextentgroupbox.cpp.

References mOutputCrs.

void QgsExtentGroupBox::setOutputExtent ( const QgsRectangle r,
const QgsCoordinateReferenceSystem srcCrs,
ExtentState  state 
)
protected
void QgsExtentGroupBox::setOutputExtentFromCurrent ( )
slot

set output extent to be the same as current extent (may be transformed to output CRS)

Definition at line 99 of file qgsextentgroupbox.cpp.

References CurrentExtent, mCurrentCrs, mCurrentExtent, and setOutputExtent().

Referenced by QgsExtentGroupBox().

void QgsExtentGroupBox::setOutputExtentFromLineEdit ( )
protected
void QgsExtentGroupBox::setOutputExtentFromOriginal ( )
slot

set output extent to be the same as original extent (may be transformed to output CRS)

Definition at line 105 of file qgsextentgroupbox.cpp.

References mOriginalCrs, mOriginalExtent, OriginalExtent, and setOutputExtent().

Referenced by QgsExtentGroupBox().

void QgsExtentGroupBox::setOutputExtentFromUser ( const QgsRectangle extent,
const QgsCoordinateReferenceSystem crs 
)
slot

set output extent to custom extent (may be transformed to outut CRS)

Definition at line 111 of file qgsextentgroupbox.cpp.

References setOutputExtent(), and UserExtent.

void QgsExtentGroupBox::updateTitle ( )
protected

Member Data Documentation

QgsCoordinateReferenceSystem QgsExtentGroupBox::mCurrentCrs
protected

Definition at line 88 of file qgsextentgroupbox.h.

Referenced by setCurrentExtent(), and setOutputExtentFromCurrent().

QgsRectangle QgsExtentGroupBox::mCurrentExtent
protected

Definition at line 87 of file qgsextentgroupbox.h.

Referenced by setCurrentExtent(), and setOutputExtentFromCurrent().

ExtentState QgsExtentGroupBox::mExtentState
protected

Definition at line 83 of file qgsextentgroupbox.h.

Referenced by setOutputExtent(), setOutputExtentFromLineEdit(), and updateTitle().

QgsCoordinateReferenceSystem QgsExtentGroupBox::mOriginalCrs
protected

Definition at line 91 of file qgsextentgroupbox.h.

Referenced by setOriginalExtent(), and setOutputExtentFromOriginal().

QgsRectangle QgsExtentGroupBox::mOriginalExtent
protected

Definition at line 90 of file qgsextentgroupbox.h.

Referenced by setOriginalExtent(), and setOutputExtentFromOriginal().

QgsCoordinateReferenceSystem QgsExtentGroupBox::mOutputCrs
protected

Definition at line 85 of file qgsextentgroupbox.h.

Referenced by setOutputCrs(), and setOutputExtent().


The documentation for this class was generated from the following files: