QGIS API Documentation
3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
src
gui
editorwidgets
core
qgseditorwidgetfactory.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgseditorwidgetfactory.cpp
3
--------------------------------------
4
Date : 21.4.2013
5
Copyright : (C) 2013 Matthias Kuhn
6
Email : matthias at opengis dot ch
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
#include "
qgseditorwidgetfactory.h
"
17
18
#include "
qgsdefaultsearchwidgetwrapper.h
"
19
#include "
qgsfields.h
"
20
#include "
qgssearchwidgetwrapper.h
"
21
#include "
qgsvectordataprovider.h
"
22
23
#include <QSettings>
24
25
class
QgsDefaultSearchWidgetWrapper
;
26
27
QgsEditorWidgetFactory::QgsEditorWidgetFactory
(
const
QString &
name
,
const
QIcon &
icon
)
28
: mName(
name
)
29
, mIcon(
icon
)
30
{
31
}
32
37
QgsSearchWidgetWrapper
*
QgsEditorWidgetFactory::createSearchWidget
(
QgsVectorLayer
*vl,
int
fieldIdx, QWidget *parent )
const
38
{
39
return
new
QgsDefaultSearchWidgetWrapper
( vl, fieldIdx, parent );
40
}
41
42
QString
QgsEditorWidgetFactory::name
()
const
43
{
44
return
mName;
45
}
46
47
QIcon
QgsEditorWidgetFactory::icon
()
const
48
{
49
return
mIcon;
50
}
51
52
unsigned
int
QgsEditorWidgetFactory::fieldScore
(
const
QgsVectorLayer
*vl,
int
fieldIdx )
const
53
{
54
Q_UNUSED( vl )
55
Q_UNUSED( fieldIdx )
56
return
5;
57
}
QgsDefaultSearchWidgetWrapper
Wraps a search widget.
Definition
qgsdefaultsearchwidgetwrapper.h:34
QgsEditorWidgetFactory::fieldScore
virtual unsigned int fieldScore(const QgsVectorLayer *vl, int fieldIdx) const
This method allows disabling this editor widget type for a certain field.
Definition
qgseditorwidgetfactory.cpp:52
QgsEditorWidgetFactory::createSearchWidget
virtual QgsSearchWidgetWrapper * createSearchWidget(QgsVectorLayer *vl, int fieldIdx, QWidget *parent) const
By default a simple QgsFilterLineEdit is returned as search widget.
Definition
qgseditorwidgetfactory.cpp:37
QgsEditorWidgetFactory::QgsEditorWidgetFactory
QgsEditorWidgetFactory(const QString &name, const QIcon &icon=QIcon())
Constructor.
Definition
qgseditorwidgetfactory.cpp:27
QgsEditorWidgetFactory::icon
QIcon icon() const
Returns the icon of this widget type.
Definition
qgseditorwidgetfactory.cpp:47
QgsEditorWidgetFactory::name
QString name() const
Returns the human readable identifier name of this widget type.
Definition
qgseditorwidgetfactory.cpp:42
QgsSearchWidgetWrapper
Shows a search widget on a filter form.
Definition
qgssearchwidgetwrapper.h:42
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:406
qgsdefaultsearchwidgetwrapper.h
qgseditorwidgetfactory.h
qgsfields.h
qgssearchwidgetwrapper.h
qgsvectordataprovider.h
Generated on
for QGIS API Documentation by
1.15.0