QGIS API Documentation
3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
src
gui
devtools
qgsdevtoolwidgetfactory.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdevtoolwidgetfactory.h
3
------------------------
4
Date : March 2020
5
Copyright : (C) 2020 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 QGSDEVTOOLWIDGETFACTORY_H
17
#define QGSDEVTOOLWIDGETFACTORY_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
22
#include <QIcon>
23
#include <QString>
24
25
class
QgsDevToolWidget
;
26
class
QWidget;
27
34
class
GUI_EXPORT
QgsDevToolWidgetFactory
35
{
36
public
:
40
QgsDevToolWidgetFactory
(
const
QString &
title
= QString(),
const
QIcon &
icon
= QIcon() );
41
42
virtual
~QgsDevToolWidgetFactory
() =
default
;
43
48
virtual
QIcon
icon
()
const
{
return
mIcon; }
49
54
void
setIcon
(
const
QIcon &
icon
) { mIcon =
icon
; }
55
60
virtual
QString
title
()
const
{
return
mTitle; }
61
65
void
setTitle
(
const
QString &
title
) { mTitle =
title
; }
66
72
virtual
QgsDevToolWidget
*
createWidget
( QWidget *parent =
nullptr
)
const
= 0
SIP_FACTORY
;
73
74
private
:
75
QIcon mIcon;
76
QString mTitle;
77
};
78
79
#endif
// QGSDEVTOOLWIDGETFACTORY_H
QgsDevToolWidgetFactory::~QgsDevToolWidgetFactory
virtual ~QgsDevToolWidgetFactory()=default
QgsDevToolWidgetFactory::title
virtual QString title() const
Returns the (translated) title of the tool.
Definition
qgsdevtoolwidgetfactory.h:60
QgsDevToolWidgetFactory::QgsDevToolWidgetFactory
QgsDevToolWidgetFactory(const QString &title=QString(), const QIcon &icon=QIcon())
Constructor for a QgsDevToolWidgetFactory with the specified title and icon.
Definition
qgsdevtoolwidgetfactory.cpp:18
QgsDevToolWidgetFactory::setTitle
void setTitle(const QString &title)
Set the translated title for the tool.
Definition
qgsdevtoolwidgetfactory.h:65
QgsDevToolWidgetFactory::createWidget
virtual QgsDevToolWidget * createWidget(QWidget *parent=nullptr) const =0
Factory function to create the widget on demand as needed by the dock.
QgsDevToolWidgetFactory::icon
virtual QIcon icon() const
Returns the icon that will be shown in the tool in the panel.
Definition
qgsdevtoolwidgetfactory.h:48
QgsDevToolWidgetFactory::setIcon
void setIcon(const QIcon &icon)
Sets the icon for the factory object, which will be shown for the tool in the panel.
Definition
qgsdevtoolwidgetfactory.h:54
QgsDevToolWidget
A panel widget that can be shown in the developer tools panel.
Definition
qgsdevtoolwidget.h:29
qgis_sip.h
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:84
Generated on
for QGIS API Documentation by
1.15.0