/usr/include/qgis/qgsgraduatedhistogramwidget.h is in libqgis-dev 2.18.17+dfsg-1.
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | /***************************************************************************
qgsgraduatedhistogramwidget.h
-----------------------------
begin : May 2015
copyright : (C) 2015 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* 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 QGSGRADUATEDHISTOGRAMWIDGET_H
#define QGSGRADUATEDHISTOGRAMWIDGET_H
#include "qgshistogramwidget.h"
class QwtPlotPicker;
class QgsGraduatedHistogramEventFilter;
/** \ingroup gui
* \class QgsGraduatedHistogramWidget
* \brief Graphical histogram for displaying distribution of field values and
* editing range breaks for a QgsGraduatedSymbolRendererV2 renderer.
*
* \note Added in version 2.9
*/
class GUI_EXPORT QgsGraduatedHistogramWidget : public QgsHistogramWidget
{
Q_OBJECT
public:
/** QgsGraduatedHistogramWidget constructor
* @param parent parent widget
*/
QgsGraduatedHistogramWidget( QWidget *parent = nullptr );
~QgsGraduatedHistogramWidget();
/** Sets the QgsGraduatedSymbolRendererV2 renderer associated with the histogram.
* The histogram will fetch the ranges from the renderer before every refresh.
* @param renderer associated QgsGraduatedSymbolRendererV2
*/
void setRenderer( QgsGraduatedSymbolRendererV2* renderer );
signals:
/** Emitted when the user modifies the graduated ranges using the histogram widget.
* @param rangesAdded true if the user has added ranges, false if the user has just
* modified existing range breaks
*/
void rangesModified( bool rangesAdded );
protected:
virtual void drawHistogram() override;
private slots:
void mousePress( double value );
void mouseRelease( double value );
private:
QgsGraduatedSymbolRendererV2* mRenderer;
QwtPlotPicker* mHistoPicker;
QgsGraduatedHistogramEventFilter* mFilter;
double mPressedValue;
void findClosestRange( double value, int &closestRangeIndex, int &pixelDistance ) const;
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
QwtPlotHistogram* createPlotHistogram( const QString& title, const QColor& color ) const;
#else
HistogramItem* createHistoItem( const QString& title, const QColor& color ) const;
#endif
};
//
// NOTE:
// For private use by QgsGraduatedHistogramWidget only,
// not part of stable api or exposed to Python bindings
//
/// @cond PRIVATE
class GUI_EXPORT QgsGraduatedHistogramEventFilter: public QObject
{
Q_OBJECT
public:
QgsGraduatedHistogramEventFilter( QwtPlot *plot );
virtual ~QgsGraduatedHistogramEventFilter() {}
virtual bool eventFilter( QObject* object, QEvent* event ) override;
signals:
void mousePress( double );
void mouseRelease( double );
private:
QwtPlot* mPlot;
double posToValue( QPointF point ) const;
};
///@endcond
#endif //QGSGRADUATEDHISTOGRAMWIDGET_H
|