Skip to content

Commit ca1c655

Browse files
committed
Minor API improvements to QgsStyleManagerDialog
1 parent 0ed1628 commit ca1c655

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

python/gui/auto_generated/symbology/qgsstylemanagerdialog.sip.in

+22-2
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,40 @@
1212

1313
class QgsStyleManagerDialog : QDialog
1414
{
15+
%Docstring
16+
17+
A dialog allowing users to customise and populate a QgsStyle.
18+
%End
1519

1620
%TypeHeaderCode
1721
#include "qgsstylemanagerdialog.h"
1822
%End
1923
public:
20-
QgsStyleManagerDialog( QgsStyle *style, QWidget *parent /TransferThis/ = 0 );
24+
25+
QgsStyleManagerDialog( QgsStyle *style, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags() );
26+
%Docstring
27+
Constructor for QgsStyleManagerDialog, with the specified ``parent`` widget and window ``flags``.
28+
29+
The ``style`` argument specifies the linked QgsStyle database. Symbols and objects contained within
30+
this style will be shown in the dialog, and changes made within the dialog will be applied to ``style``.
31+
The ``style`` object must last for the lifetime of the dialog.
32+
%End
2133

2234
static QString addColorRampStatic( QWidget *parent, QgsStyle *style,
2335
QString RampType = QString() );
2436
%Docstring
25-
open add color ramp dialog, return color ramp's name if the ramp has been added
37+
Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added.
2638
%End
2739

2840
public slots:
41+
42+
void activate();
43+
%Docstring
44+
Raises, unminimizes and activates this window
45+
46+
.. versionadded:: 3.4
47+
%End
48+
2949
void addItem();
3050
void editItem();
3151
void removeItem();

src/gui/symbology/qgsstylemanagerdialog.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
#include "qgsapplication.h"
4444
#include "qgslogger.h"
4545

46-
QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle *style, QWidget *parent )
47-
: QDialog( parent )
46+
QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle *style, QWidget *parent, Qt::WindowFlags flags )
47+
: QDialog( parent, flags )
4848
, mStyle( style )
4949
{
5050
setupUi( this );
@@ -602,6 +602,12 @@ QString QgsStyleManagerDialog::addColorRampStatic( QWidget *parent, QgsStyle *st
602602
return name;
603603
}
604604

605+
void QgsStyleManagerDialog::activate()
606+
{
607+
raise();
608+
setWindowState( windowState() & ~Qt::WindowMinimized );
609+
activateWindow();
610+
}
605611

606612
bool QgsStyleManagerDialog::addColorRamp()
607613
{

src/gui/symbology/qgsstylemanagerdialog.h

+21-2
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,38 @@ class QgsStyle;
3030
/**
3131
* \ingroup gui
3232
* \class QgsStyleManagerDialog
33+
*
34+
* A dialog allowing users to customise and populate a QgsStyle.
3335
*/
3436
class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleManagerDialogBase
3537
{
3638
Q_OBJECT
3739

3840
public:
39-
QgsStyleManagerDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr );
4041

41-
//! open add color ramp dialog, return color ramp's name if the ramp has been added
42+
/**
43+
* Constructor for QgsStyleManagerDialog, with the specified \a parent widget and window \a flags.
44+
*
45+
* The \a style argument specifies the linked QgsStyle database. Symbols and objects contained within
46+
* this style will be shown in the dialog, and changes made within the dialog will be applied to \a style.
47+
* The \a style object must last for the lifetime of the dialog.
48+
*/
49+
QgsStyleManagerDialog( QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
50+
51+
/**
52+
* Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added.
53+
*/
4254
static QString addColorRampStatic( QWidget *parent, QgsStyle *style,
4355
QString RampType = QString() );
4456

4557
public slots:
58+
59+
/**
60+
* Raises, unminimizes and activates this window
61+
* \since QGIS 3.4
62+
*/
63+
void activate();
64+
4665
void addItem();
4766
void editItem();
4867
void removeItem();

0 commit comments

Comments
 (0)