QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsstylesavedialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbolsavedialog.cpp
3  ---------------------------------------
4  begin : November 2016
5  copyright : (C) 2016 by Mathieu Pellerin
6  email : nirvn dot asia at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "qgsstylesavedialog.h"
19 
20 #include "qgis.h"
21 #include "qgsstyle.h"
22 #include "qgsgui.h"
23 
24 #include <QLineEdit>
25 #include <QCheckBox>
26 
28  : QDialog( parent )
29 {
30  setupUi( this );
31 
33 
34  if ( type == QgsStyle::SymbolEntity )
35  {
36  this->setWindowTitle( tr( "Save New Symbol" ) );
37  }
38  else if ( type == QgsStyle::ColorrampEntity )
39  {
40  this->setWindowTitle( tr( "Save New Color Ramp" ) );
41  }
42 }
43 
44 QString QgsStyleSaveDialog::name() const
45 {
46  return mName->text();
47 }
48 
49 QString QgsStyleSaveDialog::tags() const
50 {
51  return mTags->text();
52 }
53 
55 {
56  return mFavorite->isChecked();
57 }
bool isFavorite() const
returns whether the favorite element is checked
StyleEntity
Enum for Entities involved in a style.
Definition: qgsstyle.h:95
QgsStyleSaveDialog(QWidget *parent=nullptr, QgsStyle::StyleEntity type=QgsStyle::SymbolEntity)
Constructor for QgsSymbolSaveDialog.
QString name() const
returns the text value of the name element
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition: qgsgui.cpp:98
QString tags() const
returns the text value of the tags element