QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgscodeeditordockwidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgscodeeditordockwidget.cpp
3 --------------------------------------
4 Date : March 2023
5 Copyright : (C) 2023 by 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
17#include "moc_qgscodeeditordockwidget.cpp"
19
20QgsCodeEditorDockWidget::QgsCodeEditorDockWidget( const QString &windowGeometrySettingsKey, bool usePersistentWidget )
21 : QWidget( nullptr )
22{
23 mDockableWidgetHelper = new QgsDockableWidgetHelper( true, tr( "Code Editor" ), this, QgsDockableWidgetHelper::sOwnerWindow, Qt::BottomDockWidgetArea, QStringList(), true, windowGeometrySettingsKey, usePersistentWidget );
24
25 mDockToggleButton = mDockableWidgetHelper->createDockUndockToolButton();
26 mDockToggleButton->setToolTip( tr( "Dock Code Editor" ) );
27 connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [=]() {
28 close();
29 } );
30
31 connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::visibilityChanged, this, &QgsCodeEditorDockWidget::visibilityChanged );
32}
33
35{
36 delete mDockableWidgetHelper;
37}
38
39void QgsCodeEditorDockWidget::setTitle( const QString &title )
40{
41 mDockableWidgetHelper->setWindowTitle( title );
42}
43
45{
46 return mDockToggleButton;
47}
48
50{
51 mDockableWidgetHelper->setDockObjectName( name );
52}
53
55{
56 return mDockableWidgetHelper->isUserVisible();
57}
58
60{
61 mDockableWidgetHelper->setUserVisible( visible );
62}
void setDockObjectName(const QString &name)
Sets the object name of the dock widget.
void visibilityChanged(bool isVisible)
Emitted when the editor's visibility is changed.
QgsCodeEditorDockWidget(const QString &windowGeometrySettingsKey=QString(), bool usePersistentWidget=false)
Constructor for QgsCodeEditorDockWidget, with the specified window geometry settings key.
void setTitle(const QString &title)
Sets the title to use for the code editor dock widget or window.
bool isUserVisible() const
Returns true if the widget is user visible.
void setUserVisible(bool visible)
Sets whether the editor is user visible.
QToolButton * dockToggleButton()
Returns the dock toggle button for the widget, which is used to toggle between dock or full window mo...