QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
editorwidgets
qgsdatetimesearchwidgetwrapper.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdatetimesearchwidgetwrapper.h
3
-------------------------------
4
Date : 2016-05-23
5
Copyright : (C) 2016 Nyall Dawson
6
Email : nyall dot dawson 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 QGSDATETIMESEARCHWIDGETWRAPPER_H
17
#define QGSDATETIMESEARCHWIDGETWRAPPER_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgssearchwidgetwrapper.h
"
22
23
#include <QComboBox>
24
#include <QLineEdit>
25
#include <QListWidget>
26
27
class
QgsDateTimeEditFactory
;
28
class
QgsDateTimeEdit
;
29
35
36
class
GUI_EXPORT
QgsDateTimeSearchWidgetWrapper
:
public
QgsSearchWidgetWrapper
37
{
38
Q_OBJECT
39
40
public
:
47
explicit
QgsDateTimeSearchWidgetWrapper
(
QgsVectorLayer
*vl,
int
fieldIdx, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
48
53
QVariant
value
()
const
;
54
55
bool
applyDirectly
()
override
;
56
QString
expression
()
const override
;
57
bool
valid
()
const override
;
58
QgsSearchWidgetWrapper::FilterFlags
supportedFlags
()
const override
;
59
QgsSearchWidgetWrapper::FilterFlags
defaultFlags
()
const override
;
60
QString
createExpression
(
QgsSearchWidgetWrapper::FilterFlags
flags )
const override
;
61
62
public
slots:
63
64
void
clearWidget
()
override
;
65
void
setEnabled
(
bool
enabled )
override
;
66
67
protected
:
68
QWidget *
createWidget
( QWidget *parent )
override
;
69
void
initWidget
( QWidget *editor )
override
;
70
71
protected
slots:
72
void
setExpression
(
const
QString &exp )
override
;
73
74
private
slots:
75
void
dateTimeChanged(
const
QDateTime &date );
76
77
private
:
78
QgsDateTimeEdit
*mDateTimeEdit =
nullptr
;
79
80
friend
class
QgsDateTimeEditFactory
;
81
};
82
83
#endif
// QGSDATETIMESEARCHWIDGETWRAPPER_H
QgsDateTimeEditFactory
Editor widget factory for datetime widgets.
Definition
qgsdatetimeeditfactory.h:31
QgsDateTimeEdit
A QDateTimeEdit with the capability of setting/reading null date/times.
Definition
qgsdatetimeedit.h:38
QgsDateTimeSearchWidgetWrapper::QgsDateTimeEditFactory
friend class QgsDateTimeEditFactory
Definition
qgsdatetimesearchwidgetwrapper.h:80
QgsDateTimeSearchWidgetWrapper::value
QVariant value() const
Returns a variant representing the current state of the widget, respecting the editor widget's config...
Definition
qgsdatetimesearchwidgetwrapper.cpp:48
QgsDateTimeSearchWidgetWrapper::QgsDateTimeSearchWidgetWrapper
QgsDateTimeSearchWidgetWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *parent=nullptr)
Constructor for QgsDateTimeSearchWidgetWrapper.
Definition
qgsdatetimesearchwidgetwrapper.cpp:33
QgsSearchWidgetWrapper::setEnabled
void setEnabled(bool enabled) override
Toggles whether the search widget is enabled or disabled.
Definition
qgssearchwidgetwrapper.h:180
QgsSearchWidgetWrapper::createExpression
virtual QString createExpression(FilterFlags flags) const
Creates a filter expression based on the current state of the search widget and the specified filter ...
Definition
qgssearchwidgetwrapper.h:135
QgsSearchWidgetWrapper::expression
virtual QString expression() const =0
Will be used to access the widget's value.
QgsSearchWidgetWrapper::QgsSearchWidgetWrapper
QgsSearchWidgetWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *parent=nullptr)
Create a new widget wrapper.
Definition
qgssearchwidgetwrapper.cpp:92
QgsSearchWidgetWrapper::defaultFlags
virtual FilterFlags defaultFlags() const
Returns the filter flags which should be set by default for the search widget.
Definition
qgssearchwidgetwrapper.cpp:103
QgsSearchWidgetWrapper::setExpression
virtual void setExpression(const QString &expression)=0
Set the expression which is currently used as filter for this widget.
QgsSearchWidgetWrapper::supportedFlags
virtual FilterFlags supportedFlags() const
Returns filter flags supported by the search widget.
Definition
qgssearchwidgetwrapper.cpp:98
QgsSearchWidgetWrapper::applyDirectly
virtual bool applyDirectly()=0
If this is true, then this search widget should take effect directly when its expression changes.
QgsSearchWidgetWrapper::clearWidget
virtual void clearWidget()
Clears the widget's current value and resets it back to the default state.
Definition
qgssearchwidgetwrapper.h:174
QgsSearchWidgetWrapper::FilterFlags
QFlags< FilterFlag > FilterFlags
Definition
qgssearchwidgetwrapper.h:69
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
QgsWidgetWrapper::valid
virtual bool valid() const =0
Returns true if the widget has been properly initialized.
QgsWidgetWrapper::initWidget
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Definition
qgswidgetwrapper.cpp:109
QgsWidgetWrapper::createWidget
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgssearchwidgetwrapper.h
Generated on
for QGIS API Documentation by
1.17.0