QGIS API Documentation  3.2.0-Bonn (bc43194)
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 
23 #include <QLineEdit>
24 #include <QCheckBox>
25 
27  : QDialog( parent )
28 {
29  setupUi( this );
30 
31  if ( type == QgsStyle::SymbolEntity )
32  {
33  this->setWindowTitle( tr( "Save New Symbol" ) );
34  }
35  else if ( type == QgsStyle::ColorrampEntity )
36  {
37  this->setWindowTitle( tr( "Save New Color Ramp" ) );
38  }
39 }
40 
41 QString QgsStyleSaveDialog::name() const
42 {
43  return mName->text();
44 }
45 
46 QString QgsStyleSaveDialog::tags() const
47 {
48  return mTags->text();
49 }
50 
52 {
53  return mFavorite->isChecked();
54 }
QString tags() const
returns the text value of the tags element
QString name() const
returns the text value of the name element
StyleEntity
Enum for Entities involved in a style.
Definition: qgsstyle.h:95
QgsStyleSaveDialog(QWidget *parent=nullptr, QgsStyle::StyleEntity type=QgsStyle::SymbolEntity)
Constructor for QgsSymbolSaveDialog.
bool isFavorite() const
returns whether the favorite element is checked