QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsfilecontentsourcelineedit.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfilecontentsourcelineedit.h
3
---------------------
4
begin : July 2018
5
copyright : (C) 2018 by 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 QGSFILECONTENTSOURCELINEEDIT_H
17
#define QGSFILECONTENTSOURCELINEEDIT_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
22
#include <QString>
23
#include <QWidget>
24
25
class
QgsFileDropEdit;
26
class
QToolButton;
27
class
QgsMessageBar
;
28
class
QgsPropertyOverrideButton
;
29
41
class
GUI_EXPORT
QgsAbstractFileContentSourceLineEdit
:
public
QWidget
SIP_ABSTRACT
42
{
43
Q_OBJECT
44
Q_PROPERTY( QString
source
READ
source
WRITE
setSource
NOTIFY
sourceChanged
)
45
46
public
:
50
QgsAbstractFileContentSourceLineEdit
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
51
57
void
setMessageBar
(
QgsMessageBar
*bar );
58
63
QgsMessageBar
*
messageBar
()
const
;
64
70
QString
source
()
const
;
71
76
void
setLastPathSettingsKey
(
const
QString &key );
77
82
QgsPropertyOverrideButton
*
propertyOverrideToolButton
()
const
{
return
mPropertyOverrideButton; }
83
88
void
setPropertyOverrideToolButtonVisible(
bool
visible );
89
90
public
slots:
91
97
void
setSource(
const
QString &source );
98
99
signals:
100
104
void
sourceChanged
(
const
QString &
source
);
105
106
private
:
107
#ifndef SIP_RUN
109
113
virtual
QString fileFilter(
bool
includeAllFiles )
const
= 0;
// cppcheck-suppress pureVirtualCall
114
118
virtual
QString selectFileTitle()
const
= 0;
// cppcheck-suppress pureVirtualCall
119
123
virtual
QString fileFromUrlTitle()
const
= 0;
// cppcheck-suppress pureVirtualCall
124
128
virtual
QString fileFromUrlText()
const
= 0;
// cppcheck-suppress pureVirtualCall
129
133
virtual
QString embedFileTitle()
const
= 0;
// cppcheck-suppress pureVirtualCall
134
138
virtual
QString extractFileTitle()
const
= 0;
// cppcheck-suppress pureVirtualCall
139
143
virtual
QString defaultSettingsKey()
const
= 0;
// cppcheck-suppress pureVirtualCall
144
146
#endif
147
148
protected
:
149
SIP_SKIP
QgsFileDropEdit *
mFileLineEdit
=
nullptr
;
150
151
private
slots:
152
void
selectFile();
153
void
selectUrl();
154
void
embedFile();
155
void
extractFile();
156
void
mFileLineEdit_textEdited(
const
QString &text );
157
158
private
:
159
enum
Mode
160
{
161
ModeFile,
162
ModeBase64,
163
};
164
165
Mode mMode = ModeFile;
166
bool
mPropertyOverrideButtonVisible =
false
;
167
168
QToolButton *mFileToolButton =
nullptr
;
169
QgsPropertyOverrideButton
*mPropertyOverrideButton =
nullptr
;
170
QString mLastPathKey;
171
QString mBase64;
172
QgsMessageBar
*mMessageBar =
nullptr
;
173
174
QString defaultPath()
const
;
175
QString settingsKey()
const
;
176
};
177
178
188
class
GUI_EXPORT
QgsPictureSourceLineEditBase
:
public
QgsAbstractFileContentSourceLineEdit
189
{
190
Q_OBJECT
191
public
:
195
enum
Format
196
{
197
Svg
,
198
Image
,
199
AnimatedImage
,
200
};
201
206
QgsPictureSourceLineEditBase
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
)
207
:
QgsAbstractFileContentSourceLineEdit
( parent )
208
{}
209
211
void
setMode
(
Format
format ) { mFormat = format; }
212
213
protected
:
217
QgsPictureSourceLineEditBase
(
Format
format, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
218
219
private
:
220
Format
mFormat =
Svg
;
221
222
#ifndef SIP_RUN
224
QString fileFilter(
bool
includeAllFiles )
const
final
;
225
QString selectFileTitle() const final;
226
QString fileFromUrlTitle() const final;
227
QString fileFromUrlText() const final;
228
QString embedFileTitle() const final;
229
QString extractFileTitle() const final;
230
QString defaultSettingsKey() const final;
232
#endif
233
};
234
235
247
class
GUI_EXPORT
QgsSvgSourceLineEdit
:
public
QgsPictureSourceLineEditBase
248
{
249
Q_OBJECT
250
public
:
254
QgsSvgSourceLineEdit
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
)
255
:
QgsPictureSourceLineEditBase
(
Svg
, parent )
256
{}
257
};
258
270
class
GUI_EXPORT
QgsImageSourceLineEdit
:
public
QgsPictureSourceLineEditBase
271
{
272
Q_OBJECT
273
public
:
277
QgsImageSourceLineEdit
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
)
278
:
QgsPictureSourceLineEditBase
(
Image
, parent )
279
{}
280
};
281
282
294
class
GUI_EXPORT
QgsAnimatedImageSourceLineEdit
:
public
QgsPictureSourceLineEditBase
295
{
296
Q_OBJECT
297
public
:
301
QgsAnimatedImageSourceLineEdit
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
)
302
:
QgsPictureSourceLineEditBase
(
AnimatedImage
, parent )
303
{}
304
};
305
306
#endif
// QGSFILECONTENTSOURCELINEEDIT_H
QgsAbstractFileContentSourceLineEdit::setLastPathSettingsKey
void setLastPathSettingsKey(const QString &key)
Sets a specific settings key to use when storing the last used path for the file source.
Definition
qgsfilecontentsourcelineedit.cpp:118
QgsAbstractFileContentSourceLineEdit::sourceChanged
void sourceChanged(const QString &source)
Emitted whenever the file source is changed in the widget.
QgsAbstractFileContentSourceLineEdit::setMessageBar
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
Definition
qgsfilecontentsourcelineedit.cpp:287
QgsAbstractFileContentSourceLineEdit::mFileLineEdit
QgsFileDropEdit * mFileLineEdit
Definition
qgsfilecontentsourcelineedit.h:149
QgsAbstractFileContentSourceLineEdit::source
QString source
Definition
qgsfilecontentsourcelineedit.h:44
QgsAbstractFileContentSourceLineEdit::messageBar
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
Definition
qgsfilecontentsourcelineedit.cpp:292
QgsAbstractFileContentSourceLineEdit::propertyOverrideToolButton
QgsPropertyOverrideButton * propertyOverrideToolButton() const
Returns the property override tool button.
Definition
qgsfilecontentsourcelineedit.h:82
QgsAbstractFileContentSourceLineEdit::setSource
void setSource(const QString &source)
Sets a new source to show in the widget.
Definition
qgsfilecontentsourcelineedit.cpp:129
QgsAbstractFileContentSourceLineEdit::QgsAbstractFileContentSourceLineEdit
QgsAbstractFileContentSourceLineEdit(QWidget *parent=nullptr)
Constructor for QgsAbstractFileContentSourceLineEdit, with the specified parent widget.
Definition
qgsfilecontentsourcelineedit.cpp:43
QgsAnimatedImageSourceLineEdit::QgsAnimatedImageSourceLineEdit
QgsAnimatedImageSourceLineEdit(QWidget *parent=nullptr)
Constructor for QgsAnimatedImageSourceLineEdit, with the specified parent widget.
Definition
qgsfilecontentsourcelineedit.h:301
QgsImageSourceLineEdit::QgsImageSourceLineEdit
QgsImageSourceLineEdit(QWidget *parent=nullptr)
Constructor for QgsImageSourceLineEdit, with the specified parent widget.
Definition
qgsfilecontentsourcelineedit.h:277
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition
qgsmessagebar.h:61
QgsPictureSourceLineEditBase::QgsPictureSourceLineEditBase
QgsPictureSourceLineEditBase(Format format, QWidget *parent=nullptr)
Constructor for QgsImageSourceLineEdit, with the specified parent widget.
QgsPictureSourceLineEditBase::setMode
void setMode(Format format)
Defines the mode of the source line edit.
Definition
qgsfilecontentsourcelineedit.h:211
QgsPictureSourceLineEditBase::Format
Format
Format of source image.
Definition
qgsfilecontentsourcelineedit.h:196
QgsPictureSourceLineEditBase::AnimatedImage
@ AnimatedImage
Animated image.
Definition
qgsfilecontentsourcelineedit.h:199
QgsPictureSourceLineEditBase::Svg
@ Svg
SVG image.
Definition
qgsfilecontentsourcelineedit.h:197
QgsPictureSourceLineEditBase::Image
@ Image
Raster image.
Definition
qgsfilecontentsourcelineedit.h:198
QgsPictureSourceLineEditBase::QgsPictureSourceLineEditBase
QgsPictureSourceLineEditBase(QWidget *parent=nullptr)
Constructor for QgsImageSourceLineEdit, with the specified parent widget.
Definition
qgsfilecontentsourcelineedit.h:206
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition
qgspropertyoverridebutton.h:50
QgsSvgSourceLineEdit::QgsSvgSourceLineEdit
QgsSvgSourceLineEdit(QWidget *parent=nullptr)
Constructor for QgsSvgSourceLineEdit, with the specified parent widget.
Definition
qgsfilecontentsourcelineedit.h:254
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
SIP_ABSTRACT
#define SIP_ABSTRACT
Definition
qgis_sip.h:225
Generated on
for QGIS API Documentation by
1.17.0