2013-06-22 19:37:41 +02:00
|
|
|
class QgsSvgSelectorListModel : QAbstractListModel
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssvgselectorwidget.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsSvgSelectorListModel( QObject* parent );
|
|
|
|
|
|
|
|
// Constructor to create model for icons in a specific path
|
|
|
|
QgsSvgSelectorListModel( QObject* parent, QString path );
|
|
|
|
|
|
|
|
int rowCount( const QModelIndex & parent = QModelIndex() ) const;
|
|
|
|
|
|
|
|
QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsSvgSelectorGroupsModel : QStandardItemModel
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssvgselectorwidget.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsSvgSelectorGroupsModel( QObject* parent );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class QgsSvgSelectorWidget : QWidget
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssvgselectorwidget.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsSvgSelectorWidget( QWidget* parent = 0 );
|
|
|
|
~QgsSvgSelectorWidget();
|
|
|
|
|
|
|
|
static QgsSvgSelectorWidget* create( QWidget* parent = 0 ) /Factory/;
|
|
|
|
|
|
|
|
QString currentSvgPath() const;
|
|
|
|
QString currentSvgPathToName() const;
|
|
|
|
|
|
|
|
QTreeView* groupsTreeView();
|
|
|
|
QListView* imagesListView();
|
|
|
|
QLineEdit* filePathLineEdit();
|
|
|
|
QPushButton* filePathButton();
|
|
|
|
QCheckBox* relativePathCheckbox();
|
|
|
|
QLayout* selectorLayout();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
/** Accepts absolute and relative paths */
|
|
|
|
void setSvgPath( const QString& svgPath );
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void svgSelected( const QString& path );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void populateList();
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsSvgSelectorDialog : QDialog
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssvgselectorwidget.h>
|
|
|
|
%End
|
|
|
|
public:
|
2014-03-27 10:42:38 +01:00
|
|
|
QgsSvgSelectorDialog( QWidget* parent = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags,
|
2013-06-22 19:37:41 +02:00
|
|
|
QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Close | QDialogButtonBox::Ok,
|
|
|
|
Qt::Orientation orientation = Qt::Horizontal );
|
|
|
|
~QgsSvgSelectorDialog();
|
|
|
|
|
|
|
|
//! Returns the central layout. Widgets added to it must have this dialog as parent
|
|
|
|
QVBoxLayout* layout();
|
|
|
|
|
|
|
|
//! Returns the button box
|
|
|
|
QDialogButtonBox* buttonBox();
|
|
|
|
|
|
|
|
//! Returns pointer to the embedded SVG selector widget
|
|
|
|
QgsSvgSelectorWidget* svgSelector();
|
|
|
|
|
|
|
|
};
|