-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start on classes for dev tool widgets and dev tool widget factory
- Loading branch information
1 parent
c10f39f
commit bab86e9
Showing
13 changed files
with
285 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
python/gui/auto_generated/devtools/qgsdevtoolwidget.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,36 @@ | |||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/devtools/qgsdevtoolwidget.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ | |||
|
|||
|
|||
class QgsDevToolWidget : QgsPanelWidget | |||
{ | |||
%Docstring | |||
A panel widget that can be shown in the developer tools panel. | |||
|
|||
.. versionadded:: 3.14 | |||
%End | |||
|
|||
%TypeHeaderCode | |||
#include "qgsdevtoolwidget.h" | |||
%End | |||
public: | |||
|
|||
QgsDevToolWidget( QWidget *parent /TransferThis/ = 0 ); | |||
%Docstring | |||
Constructor for QgsDevToolWidget, with the specified ``parent`` widget. | |||
%End | |||
|
|||
}; | |||
|
|||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/devtools/qgsdevtoolwidget.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ |
73 changes: 73 additions & 0 deletions
73
python/gui/auto_generated/devtools/qgsdevtoolwidgetfactory.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,73 @@ | |||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/devtools/qgsdevtoolwidgetfactory.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ | |||
|
|||
|
|||
|
|||
|
|||
class QgsDevToolWidgetFactory | |||
{ | |||
%Docstring | |||
Factory class for creating custom developer/debugging tool pages | |||
|
|||
.. versionadded:: 3.14 | |||
%End | |||
|
|||
%TypeHeaderCode | |||
#include "qgsdevtoolwidgetfactory.h" | |||
%End | |||
public: | |||
|
|||
QgsDevToolWidgetFactory( const QString &title = QString(), const QIcon &icon = QIcon() ); | |||
%Docstring | |||
Constructor for a QgsDevToolWidgetFactory with the specified ``title`` and ``icon``. | |||
%End | |||
|
|||
virtual ~QgsDevToolWidgetFactory(); | |||
|
|||
virtual QIcon icon() const; | |||
%Docstring | |||
Returns the icon that will be shown in the tool in the panel. | |||
|
|||
.. seealso:: :py:func:`setIcon` | |||
%End | |||
|
|||
void setIcon( const QIcon &icon ); | |||
%Docstring | |||
Sets the ``icon`` for the factory object, which will be shown for the tool in the panel. | |||
|
|||
.. seealso:: :py:func:`icon` | |||
%End | |||
|
|||
virtual QString title() const; | |||
%Docstring | |||
Returns the (translated) title of the tool. | |||
|
|||
.. seealso:: :py:func:`setTitle` | |||
%End | |||
|
|||
void setTitle( const QString &title ); | |||
%Docstring | |||
Set the translated ``title`` for the tool. | |||
%End | |||
|
|||
virtual QgsDevToolWidget *createWidget( QWidget *parent = 0 ) const = 0 /Factory/; | |||
%Docstring | |||
Factory function to create the widget on demand as needed by the dock. | |||
|
|||
The ``parent`` argument gives the correct parent for the newly created widget. | |||
%End | |||
|
|||
}; | |||
|
|||
/************************************************************************ | |||
* This file has been generated automatically from * | |||
* * | |||
* src/gui/devtools/qgsdevtoolwidgetfactory.h * | |||
* * | |||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | |||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
/*************************************************************************** | |||
qgsdevtoolwidget.cpp | |||
-------------------- | |||
Date : March 2020 | |||
Copyright : (C) 2020 Nyall Dawson | |||
Email : nyall dot dawson at gmail dot com | |||
*************************************************************************** | |||
* * | |||
* This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | |||
* * | |||
***************************************************************************/ | |||
#include "qgsdevtoolwidget.h" | |||
|
|||
QgsDevToolWidget::QgsDevToolWidget( QWidget *parent ) | |||
: QgsPanelWidget( parent ) | |||
{ | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
/*************************************************************************** | |||
qgsdevtoolwidget.h | |||
------------------ | |||
Date : March 2020 | |||
Copyright : (C) 2020 Nyall Dawson | |||
Email : nyall dot dawson at gmail dot com | |||
*************************************************************************** | |||
* * | |||
* This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | |||
* * | |||
***************************************************************************/ | |||
#ifndef QGSDEVTOOLWIDGET_H | |||
#define QGSDEVTOOLWIDGET_H | |||
|
|||
#include "qgspanelwidget.h" | |||
#include "qgis_sip.h" | |||
#include "qgis_gui.h" | |||
|
|||
/** | |||
* \ingroup gui | |||
* \class QgsDevToolWidget | |||
* \brief A panel widget that can be shown in the developer tools panel. | |||
* \since QGIS 3.14 | |||
*/ | |||
class GUI_EXPORT QgsDevToolWidget : public QgsPanelWidget | |||
{ | |||
Q_OBJECT | |||
public: | |||
|
|||
/** | |||
* Constructor for QgsDevToolWidget, with the specified \a parent widget. | |||
*/ | |||
QgsDevToolWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr ); | |||
|
|||
}; | |||
|
|||
#endif // QGSDEVTOOLWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
/*************************************************************************** | |||
qgsdevtoolwidgetfactory.cpp | |||
-------------------------- | |||
Date : March 2020 | |||
Copyright : (C) 2020 Nyall Dawson | |||
Email : nyall dot dawson at gmail dot com | |||
*************************************************************************** | |||
* * | |||
* This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | |||
* * | |||
***************************************************************************/ | |||
|
|||
#include "qgsdevtoolwidgetfactory.h" | |||
|
|||
QgsDevToolWidgetFactory::QgsDevToolWidgetFactory( const QString &title, const QIcon &icon ) | |||
: mIcon( icon ) | |||
, mTitle( title ) | |||
{ | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,79 @@ | |||
/*************************************************************************** | |||
qgsdevtoolwidgetfactory.h | |||
------------------------ | |||
Date : March 2020 | |||
Copyright : (C) 2020 Nyall Dawson | |||
Email : nyall dot dawson at gmail dot com | |||
*************************************************************************** | |||
* * | |||
* This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | |||
* * | |||
***************************************************************************/ | |||
|
|||
#ifndef QGSDEVTOOLWIDGETFACTORY_H | |||
#define QGSDEVTOOLWIDGETFACTORY_H | |||
|
|||
#include "qgis_gui.h" | |||
#include "qgis_sip.h" | |||
#include <QString> | |||
#include <QIcon> | |||
|
|||
class QgsDevToolWidget; | |||
class QWidget; | |||
|
|||
/** | |||
* \ingroup gui | |||
* \class QgsDevToolWidgetFactory | |||
* Factory class for creating custom developer/debugging tool pages | |||
* \since QGIS 3.14 | |||
*/ | |||
class GUI_EXPORT QgsDevToolWidgetFactory | |||
{ | |||
public: | |||
|
|||
/** | |||
* Constructor for a QgsDevToolWidgetFactory with the specified \a title and \a icon. | |||
*/ | |||
QgsDevToolWidgetFactory( const QString &title = QString(), const QIcon &icon = QIcon() ); | |||
|
|||
virtual ~QgsDevToolWidgetFactory() = default; | |||
|
|||
/** | |||
* Returns the icon that will be shown in the tool in the panel. | |||
* \see setIcon() | |||
*/ | |||
virtual QIcon icon() const { return mIcon; } | |||
|
|||
/** | |||
* Sets the \a icon for the factory object, which will be shown for the tool in the panel. | |||
* \see icon() | |||
*/ | |||
void setIcon( const QIcon &icon ) { mIcon = icon; } | |||
|
|||
/** | |||
* Returns the (translated) title of the tool. | |||
* \see setTitle() | |||
*/ | |||
virtual QString title() const { return mTitle; } | |||
|
|||
/** | |||
* Set the translated \a title for the tool. | |||
*/ | |||
void setTitle( const QString &title ) { mTitle = title; } | |||
|
|||
/** | |||
* Factory function to create the widget on demand as needed by the dock. | |||
* | |||
* The \a parent argument gives the correct parent for the newly created widget. | |||
*/ | |||
virtual QgsDevToolWidget *createWidget( QWidget *parent = nullptr ) const = 0 SIP_FACTORY; | |||
|
|||
private: | |||
QIcon mIcon; | |||
QString mTitle; | |||
}; | |||
|
|||
#endif // QGSDEVTOOLWIDGETFACTORY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters