QGIS API Documentation 3.41.0-Master (3440c17df1d)
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" ),
24 this, QgsDockableWidgetHelper::sOwnerWindow, Qt::BottomDockWidgetArea, QStringList(), true, windowGeometrySettingsKey, usePersistentWidget );
25
26 mDockToggleButton = mDockableWidgetHelper->createDockUndockToolButton();
27 mDockToggleButton->setToolTip( tr( "Dock Code Editor" ) );
28 connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::closed, this, [ = ]()
29 {
30 close();
31 } );
32
33 connect( mDockableWidgetHelper, &QgsDockableWidgetHelper::visibilityChanged, this, &QgsCodeEditorDockWidget::visibilityChanged );
34}
35
37{
38 delete mDockableWidgetHelper;
39}
40
41void QgsCodeEditorDockWidget::setTitle( const QString &title )
42{
43 mDockableWidgetHelper->setWindowTitle( title );
44}
45
47{
48 return mDockToggleButton;
49}
50
52{
53 mDockableWidgetHelper->setDockObjectName( name );
54}
55
57{
58 return mDockableWidgetHelper->isUserVisible();
59}
60
62{
63 mDockableWidgetHelper->setUserVisible( visible );
64}
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...