Skip to content

Commit

Permalink
Some docstring improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 8, 2017
1 parent 14e949b commit 5805cf9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
10 changes: 9 additions & 1 deletion python/core/qgslegendstyle.sip
Expand Up @@ -30,19 +30,27 @@ class QgsLegendStyle
Symbol,
SymbolLabel
};
enum Side //! margin side

enum Side
{
Top,
Bottom,
Left,
Right };

QgsLegendStyle();

QFont font() const;
%Docstring
The font for this style.
:rtype: QFont
%End

void setFont( const QFont &font );
%Docstring
The font for this style.
%End


double margin( Side side );
%Docstring
Expand Down
5 changes: 5 additions & 0 deletions python/gui/qgsmessagelogviewer.sip
Expand Up @@ -20,7 +20,12 @@ class QgsMessageLogViewer: QDialog
#include "qgsmessagelogviewer.h"
%End
public:

QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
%Docstring
Create a new message log viewer, it will automatically connect to the system's
QgsMessageLog.instance() singleton.
%End

public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
Expand Down
21 changes: 19 additions & 2 deletions src/core/qgslegendstyle.h
Expand Up @@ -43,19 +43,36 @@ class CORE_EXPORT QgsLegendStyle
Symbol, //!< Symbol without label
SymbolLabel
};
enum Side //! margin side

//! Margin side
enum Side
{
Top = 0,
Bottom = 1,
Left = 2,
Right = 3
};

QgsLegendStyle();

/**
* The font for this style.
*/
QFont font() const { return mFont; }
SIP_SKIP QFont &rfont() { return mFont; }

/**
* The font for this style.
*/
void setFont( const QFont &font ) { mFont = font; }

/**
* Modifiable reference to font.
*
* \see setFont()
* \note Not available in Python bindings
*/
SIP_SKIP QFont &rfont() { return mFont; }

double margin( Side side ) { return mMarginMap.value( side ); }
void setMargin( Side side, double margin ) { mMarginMap[side] = margin; }

Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsmessagelogviewer.h
Expand Up @@ -35,7 +35,13 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
{
Q_OBJECT
public:

/**
* Create a new message log viewer, it will automatically connect to the system's
* QgsMessageLog::instance() singleton.
*/
QgsMessageLogViewer( QStatusBar *statusBar = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
// TODO QGIS 3.0: remove statusBar (it's unused)

public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
Expand Down

0 comments on commit 5805cf9

Please sign in to comment.