QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgsmeshvariablestrokewidthwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshvariablestrokewidthtwidget.h
3  -------------------------------------
4  begin : April 2020
5  copyright : (C) 2020 by Vincent Cloarec
6  email : vcloarec at gmail dot com
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 QGSMESHVARIABLESTROKEWIDTHWIDGET_H
17 #define QGSMESHVARIABLESTROKEWIDTHWIDGET_H
18 
19 #include "qgis_gui.h"
20 #include "ui_qgsmeshvariablestrokewidthwidgetbase.h"
21 #include "qgspanelwidget.h"
22 #include "qgsmeshlayerrenderer.h"
23 
25 
32 class QgsMeshVariableStrokeWidthButton: public QPushButton
33 {
34  Q_OBJECT
35  public:
37  QgsMeshVariableStrokeWidthButton( QWidget *parent = nullptr );
38 
41 
44 
46  void setDefaultMinMaxValue( double minimum, double maximum );
47 
48  signals:
49  void widgetChanged();
50 
51  private slots:
52  void openWidget();
53 
54  private:
55  void updateText();
56 
57  QgsInterpolatedLineWidth mVariableStrokeWidth;
58  double mMinimumDefaultValue;
59  double mMaximumDefaultValue;
60 };
61 
68 class QgsMeshVariableStrokeWidthWidget: public QgsPanelWidget, public Ui::QgsMeshVariableStrokeWidthWidget
69 {
70  Q_OBJECT
71  public:
74  double defaultMinimumvalue,
75  double defaultMaximumValue,
76  QWidget *parent = nullptr );
77 
80 
83 
84  private slots:
85  void defaultMinMax();
86  private:
87  double mDefaultMinimumValue = 0;
88  double mDefaultMaximumValue = 0;
89 
90  double lineEditValue( const QgsDoubleSpinBox *lineEdit ) const;
91 };
92 
93 #endif // QGSMESHVARIABLESTROKEWIDTHWIDGET_H
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
Represents a width than can vary depending on values.
A widget push button that store variable stroke width and call a widget to set parameters.
void setDefaultMinMaxValue(double minimum, double maximum)
Sets the default min/max values that will be reload if needed.
QgsMeshVariableStrokeWidthButton(QWidget *parent=nullptr)
Constructor.
void setVariableStrokeWidth(const QgsInterpolatedLineWidth &variableStrokeWidth)
Sets the variable stroke width.
QgsInterpolatedLineWidth variableStrokeWidth() const
Returns the variable stroke width.
A widget to set parameters of variable stroke width.
QgsMeshVariableStrokeWidthWidget(const QgsInterpolatedLineWidth &variableStrokeWidth, double defaultMinimumvalue, double defaultMaximumValue, QWidget *parent=nullptr)
Constructor.
QgsInterpolatedLineWidth variableStrokeWidth() const
Returns the variable stroke width.
void setVariableStrokeWidth(const QgsInterpolatedLineWidth &variableStrokeWidth)
Sets the variable stroke width.
Base class for any widget that can be shown as a inline panel.
#define SIP_NO_FILE