Skip to content
Permalink
Browse files

[FEATURE] Style manager opens non-modally

Allows style manager dialog to be used alongside main QGIS window,
just like the layout manager.
  • Loading branch information
nyalldawson committed Sep 5, 2018
1 parent ca1c655 commit 41e2892af79355d2cfa8e0c3865668d668e631f6
Showing with 17 additions and 2 deletions.
  1. +11 −2 src/app/qgisapp.cpp
  2. +3 −0 src/app/qgisapp.h
  3. +3 −0 src/gui/symbology/qgsstylemanagerdialog.cpp
@@ -318,6 +318,7 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsnewnamedialog.h"
#include "qgsgui.h"
#include "qgsdatasourcemanagerdialog.h"
#include "qgsstylemanagerdialog.h"

#include "qgsuserprofilemanager.h"
#include "qgsuserprofile.h"
@@ -1511,6 +1512,9 @@ QgisApp::~QgisApp()
delete mVectorLayerTools;
delete mWelcomePage;

if ( mStyleManagerDialog )
delete mStyleManagerDialog;

deleteLayoutDesigners();
removeAnnotationItems();

@@ -2265,8 +2269,13 @@ void QgisApp::createActions()

void QgisApp::showStyleManager()
{
QgsStyleManagerDialog dlg( QgsStyle::defaultStyle(), this );
dlg.exec();
if ( !mStyleManagerDialog )
{
mStyleManagerDialog = new QgsStyleManagerDialog( QgsStyle::defaultStyle(), this, Qt::Window );
mStyleManagerDialog->setAttribute( Qt::WA_DeleteOnClose );
}
mStyleManagerDialog->show();
mStyleManagerDialog->activate();
}

void QgisApp::showPythonDialog()
@@ -65,6 +65,7 @@ class QgsLayoutCustomDropHandler;
class QgsLayoutDesignerDialog;
class QgsLayoutDesignerInterface;
class QgsLayoutManagerDialog;
class QgsStyleManagerDialog;
class QgsMapCanvas;
class QgsMapCanvasDockWidget;
class QgsMapLayer;
@@ -2198,6 +2199,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsLayerStylingWidget *mMapStyleWidget = nullptr;

QPointer< QgsLayoutManagerDialog > mLayoutManagerDialog;
QPointer< QgsStyleManagerDialog > mStyleManagerDialog;

//! Persistent tile scale slider
QgsTileScaleWidget *mpTileScaleWidget = nullptr;
@@ -2254,6 +2256,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

QHash< QgsPrintLayout *, QgsMapLayerAction * > mAtlasFeatureActions;


std::unique_ptr<QgsMapLayerAction> mDuplicateFeatureAction;
std::unique_ptr<QgsMapLayerAction> mDuplicateFeatureDigitizeAction;

@@ -186,6 +186,9 @@ QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle *style, QWidget *parent,
mGroupTreeContextMenu->addAction( actnRemoveGroup );

tabItemType_currentChanged( 0 );

connect( mStyle, &QgsStyle::symbolSaved, this, &QgsStyleManagerDialog::populateList );
connect( mStyle, &QgsStyle::groupsModified, this, &QgsStyleManagerDialog::populateGroups );
}

void QgsStyleManagerDialog::onFinished()

1 comment on commit 41e2892

@mbernasocchi

This comment has been minimized.

Copy link
Member

@mbernasocchi mbernasocchi commented on 41e2892 Sep 6, 2018

Great!

Please sign in to comment.
You can’t perform that action at this time.