QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgsspacerwidgetwrapper.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsspacerwidgetwrapper.cpp - QgsSpacerWidgetWrapper
3
4 ---------------------
5 begin : 16.1.2023
6 copyright : (C) 2023 by Alessandro Pasotti
7 email : elpaso at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
18#include "qframe.h"
19
20
21QgsSpacerWidgetWrapper::QgsSpacerWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent )
22 : QgsWidgetWrapper( layer, editor, parent )
23{
24
25}
26
28{
29 return true;
30}
31
32QWidget *QgsSpacerWidgetWrapper::createWidget( QWidget *parent )
33{
34 QFrame *hFrame = new QFrame( parent );
35 hFrame->setFrameShape( mDrawLine ? QFrame::HLine : QFrame::NoFrame );
36 return hFrame;
37}
38
40{
41 Q_UNUSED( feature );
42}
43
45{
46 return mDrawLine;
47}
48
50{
51 mDrawLine = drawLine;
52}
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
void setFeature(const QgsFeature &feature) override
bool drawLine() const
Returns true if the spacer element will contain an horizontal line.
void setDrawLine(bool drawLine)
Sets a flag to define if the spacer element will contain an horizontal line.
QWidget * createWidget(QWidget *parent) override
This method should create a new widget with the provided parent.
bool valid() const override
Returns true if the widget has been properly initialized.
QgsSpacerWidgetWrapper(QgsVectorLayer *layer, QWidget *editor=nullptr, QWidget *parent=nullptr)
Create a new widget wrapper.
Represents a vector layer which manages a vector based data sets.
Manages an editor widget Widget and wrapper share the same parent.