QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsscalerangewidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsscalerangewidget.h
3  --------------------------------------
4  Date : 25.04.2014
5  Copyright : (C) 2014 Denis Rouzaud
6  Email : [email protected]
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15 
16 #ifndef QGSSCALERANGEWIDGET_H
17 #define QGSSCALERANGEWIDGET_H
18 
19 #include <QGridLayout>
20 #include <QLabel>
21 #include <QPushButton>
22 
23 
24 #include "qgscollapsiblegroupbox.h"
25 #include "qgsmaplayer.h"
26 #include "qgsmapcanvas.h"
27 #include "qgsscalecombobox.h"
28 
29 
30 class GUI_EXPORT QgsScaleRangeWidget : public QWidget
31 {
32  Q_OBJECT
33 
34  public:
35  explicit QgsScaleRangeWidget( QWidget *parent = 0 );
37 
39 
43  void setMapCanvas( QgsMapCanvas* mapCanvas );
44 
46  double minimumScale();
47 
49  double maximumScale();
50 
52  double minimumScaleDenom();
53 
55  double maximumScaleDenom();
56 
58  void reloadProjectScales();
59 
60  public slots:
61  void setMinimumScale( double scale );
62 
63  void setMaximumScale( double scale );
64 
65  void setScaleRange( double min, double max );
66 
67  private slots:
68  void setMaxScaleFromCanvas();
69  void setMinScaleFromCanvas();
70 
71  private:
73  QgsMapCanvas* mCanvas;
74 
75  // ui
76  QGridLayout* mLayout;
77  QLabel* mMaximumScaleIconLabel;
78  QLabel* mMinimumScaleIconLabel;
79  QPushButton* mMaximumScaleSetCurrentPushButton;
80  QPushButton* mMinimumScaleSetCurrentPushButton;
81  QgsScaleComboBox* mMaximumScaleComboBox;
82  QgsScaleComboBox* mMinimumScaleComboBox;
83 };
84 
85 #endif // QGSSCALERANGEWIDGET_H