QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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#include <QString>
22#include <QIcon>
23
25class QWidget;
26
34{
35 public:
39 QgsDevToolWidgetFactory( const QString &title = QString(), const QIcon &icon = QIcon() );
40
41 virtual ~QgsDevToolWidgetFactory() = default;
42
47 virtual QIcon icon() const { return mIcon; }
48
53 void setIcon( const QIcon &icon ) { mIcon = icon; }
54
59 virtual QString title() const { return mTitle; }
60
64 void setTitle( const QString &title ) { mTitle = title; }
65
71 virtual QgsDevToolWidget *createWidget( QWidget *parent = nullptr ) const = 0 SIP_FACTORY;
72
73 private:
74 QIcon mIcon;
75 QString mTitle;
76};
77
78#endif // QGSDEVTOOLWIDGETFACTORY_H
Factory class for creating custom developer/debugging tool pages.
virtual ~QgsDevToolWidgetFactory()=default
virtual QString title() const
Returns the (translated) title of the tool.
void setTitle(const QString &title)
Set the translated title for the tool.
virtual QgsDevToolWidget * createWidget(QWidget *parent=nullptr) const =0
Factory function to create the widget on demand as needed by the dock.
virtual QIcon icon() const
Returns the icon that will be shown in the tool in the panel.
void setIcon(const QIcon &icon)
Sets the icon for the factory object, which will be shown for the tool in the panel.
A panel widget that can be shown in the developer tools panel.
#define SIP_FACTORY
Definition qgis_sip.h:76