Skip to content

Commit

Permalink
Expose addTabifiedDockWidget through QgisInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor authored and nyalldawson committed May 3, 2020
1 parent 4629f83 commit 76a8f82
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/gui/auto_generated/qgisinterface.sip.in
Expand Up @@ -1057,7 +1057,25 @@ Remove action from the Web menu
%Docstring
Adds a ``dock`` widget to the main window, in the specified dock ``area``.

.. seealso:: :py:func:`addTabifiedDockWidget`

.. seealso:: :py:func:`removeDockWidget`
%End

virtual void addTabifiedDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget, const QStringList &tabifyWith = QStringList(), bool raiseTab = false ) = 0;
%Docstring
Add a dock widget to the given area and tabify it (if other dock widgets
exist in the same ``area``). The new tab will be below other tabs unless
``raiseTab`` is passed as true.

``tabifyWith`` is a list of dock widget object names, ordered by
priority, with which the new dock widget should be tabified. Only the
first matching object name will be picked. If none of the given object
names is found in that ``area`` (or if ``tabifyWith`` is not given at
all), the new dock widget will be created anyways, but its location
within that ``area`` will be unpredictable.

.. versionadded:: 3.14
%End

virtual void removeDockWidget( QDockWidget *dockwidget ) = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -470,6 +470,11 @@ void QgisAppInterface::addDockWidget( Qt::DockWidgetArea area, QDockWidget *dock
qgis->addDockWidget( area, dockwidget );
}

void QgisAppInterface::addTabifiedDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget, const QStringList &tabifyWith, bool raiseTab )
{
qgis->addTabifiedDockWidget( area, dockwidget, tabifyWith, raiseTab );
}

void QgisAppInterface::removeDockWidget( QDockWidget *dockwidget )
{
qgis->removeDockWidget( dockwidget );
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -132,6 +132,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
void insertAddLayerAction( QAction *action ) override;
void removeAddLayerAction( QAction *action ) override;
void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget ) override;
void addTabifiedDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget, const QStringList &tabifyWith = QStringList(), bool raiseTab = false ) override;
void removeDockWidget( QDockWidget *dockwidget ) override;
QgsAdvancedDigitizingDockWidget *cadDockWidget() override;
void showLayerProperties( QgsMapLayer *l ) override;
Expand Down
17 changes: 17 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -889,10 +889,27 @@ class GUI_EXPORT QgisInterface : public QObject
/**
* Adds a \a dock widget to the main window, in the specified dock \a area.
*
* \see addTabifiedDockWidget()
* \see removeDockWidget()
*/
virtual void addDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget ) = 0;

/**
* Add a dock widget to the given area and tabify it (if other dock widgets
* exist in the same \a area). The new tab will be below other tabs unless
* \a raiseTab is passed as true.
*
* \a tabifyWith is a list of dock widget object names, ordered by
* priority, with which the new dock widget should be tabified. Only the
* first matching object name will be picked. If none of the given object
* names is found in that \a area (or if \a tabifyWith is not given at
* all), the new dock widget will be created anyways, but its location
* within that \a area will be unpredictable.
*
* \since QGIS 3.14
*/
virtual void addTabifiedDockWidget( Qt::DockWidgetArea area, QDockWidget *dockwidget, const QStringList &tabifyWith = QStringList(), bool raiseTab = false ) = 0;

/**
* Removes the specified \a dock widget from main window (without deleting it).
*
Expand Down

0 comments on commit 76a8f82

Please sign in to comment.