QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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 "moc_qgsspacerwidgetwrapper.cpp"
19#include "qframe.h"
20
21
22QgsSpacerWidgetWrapper::QgsSpacerWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent )
23 : QgsWidgetWrapper( layer, editor, parent )
24{
25
26}
27
29{
30 return true;
31}
32
33QWidget *QgsSpacerWidgetWrapper::createWidget( QWidget *parent )
34{
35 QFrame *hFrame = new QFrame( parent );
36 hFrame->setFrameShape( mDrawLine ? QFrame::HLine : QFrame::NoFrame );
37 return hFrame;
38}
39
41{
42 Q_UNUSED( feature );
43}
44
46{
47 return mDrawLine;
48}
49
51{
52 mDrawLine = drawLine;
53}
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
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.