QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgssvgsourcelineedit.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssvgsourcelineedit.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 QGSSVGSOURCELINEEDIT_H
17 #define QGSSVGSOURCELINEEDIT_H
18 
19 #include "qgis_gui.h"
20 #include "qgis_sip.h"
21 #include <QWidget>
22 
23 class QLineEdit;
24 class QToolButton;
25 
32 class GUI_EXPORT QgsSvgSourceLineEdit : public QWidget
33 {
34  Q_OBJECT
35  Q_PROPERTY( QString source READ source WRITE setSource NOTIFY sourceChanged )
36 
37  public:
38 
42  QgsSvgSourceLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr );
43 
49  QString source() const;
50 
55  void setLastPathSettingsKey( const QString &key );
56 
57  public slots:
58 
64  void setSource( const QString &source );
65 
66  signals:
67 
71  void sourceChanged( const QString &source );
72 
73  private slots:
74  void selectFile();
75  void selectUrl();
76  void embedFile();
77  void extractFile();
78  void mFileLineEdit_textEdited( const QString &text );
79  void mFileLineEdit_editingFinished();
80 
81  private:
82 
83  QLineEdit *mFileLineEdit = nullptr;
84  QToolButton *mFileToolButton = nullptr;
85  QString mLastPathKey;
86  QString mBase64;
87 
88  QString defaultPath() const;
89  QString settingsKey() const;
90 
91 };
92 
93 #endif
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A line edit widget with toolbutton for setting an SVG image path.