/usr/include/qgis/qgsunitselectionwidget.h is in libqgis-dev 2.8.6+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | /***************************************************************************
qgsunitselectionwidget.h
-------------------
begin : Mar 24, 2014
copyright : (C) 2014 Sandro Mani
email : smani@sourcepole.ch
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef QGSUNITSELECTIONWIDGET_H
#define QGSUNITSELECTIONWIDGET_H
#include <QWidget>
#include "qgssymbolv2.h"
#include "ui_qgsunitselectionwidget.h"
#include "ui_qgsmapunitscaledialog.h"
/** Dialog allowing the user to choose the minimum and maximum scale of an object in map units */
class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog, private Ui::QgsMapUnitScaleDialog
{
Q_OBJECT
public:
QgsMapUnitScaleDialog( QWidget* parent );
/** Returns the map unit scale */
QgsMapUnitScale getMapUnitScale() const;
/** Sets the map unit scale */
void setMapUnitScale( const QgsMapUnitScale& scale );
private slots:
void configureMinComboBox();
void configureMaxComboBox();
};
/** Widget displaying a combobox allowing the user to choose between millimeter and map units
* If the user chooses map units, a button appears allowing the specification of minimum and maximum scale */
class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSelectionWidget
{
Q_OBJECT
private:
QgsMapUnitScaleDialog* mUnitScaleDialog;
int mMapUnitIdx;
public:
QgsUnitSelectionWidget( QWidget* parent = 0 );
/** Sets the units which the user can choose from in the combobox. mapUnitIdx specifies which entry corresponds to the map units, or -1 if none */
void setUnits( const QStringList& units, int mapUnitIdx );
/** Get the selected unit index */
int getUnit() const { return mUnitCombo->currentIndex(); }
/** Sets the selected unit index */
void setUnit( int unitIndex );
/** Returns the map unit scale */
QgsMapUnitScale getMapUnitScale() const { return mUnitScaleDialog->getMapUnitScale(); }
/** Sets the map unit scale */
void setMapUnitScale( const QgsMapUnitScale& scale ) { mUnitScaleDialog->setMapUnitScale( scale ); }
signals:
void changed();
private slots:
void showDialog();
void toggleUnitRangeButton();
};
#endif // QGSUNITSELECTIONWIDGET_H
|