Skip to content

Commit 643db0e

Browse files
committed
Added missing composer label alignment bindings to python api and better api docs.
1 parent c0cf1ab commit 643db0e

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

python/core/qgscomposerlabel.sip

+28-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,38 @@ class QgsComposerLabel: QgsComposerItem
2525
/**Returns the text as it appears on screen (with replaced data field)
2626
@note this function was added in version 1.2*/
2727
QString displayText() const;
28+
29+
/** Accessor for the vertical alignment of the label
30+
* @param none
31+
* @returns Qt::AlignmentFlag
32+
*/
33+
Qt::AlignmentFlag vAlign() const;
34+
/** Accessor for the horizontal alignment of the label
35+
* @param none
36+
* @returns Qt::AlignmentFlag
37+
*/
38+
Qt::AlignmentFlag hAlign() const;
39+
/** Mutator for the horizontal alignment of the label
40+
* @param Qt::AlignmentFlag
41+
* @returns void
42+
*/
43+
void setHAlign( Qt::AlignmentFlag a );
44+
/** Mutator for the vertical alignment of the label
45+
* @param QQt::AlignmentFlag
46+
* @returns void
47+
*/
48+
void setVAlign( Qt::AlignmentFlag a );
49+
50+
//!brief Accessor for the margin of the label
51+
double margin();
52+
//!brief Mutator for the margin of the label
53+
void setMargin( double m );
54+
55+
2856
/**Get font color
2957
@note: this function was added in version 1.4*/
3058
QFont font() const;
3159
void setFont( const QFont& f );
32-
double margin();
33-
void setMargin( double m );
3460

3561
/**Sets text color
3662
@note: this function was added in version 1.4*/

src/core/composer/qgscomposerlabel.h

+18
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,29 @@ class CORE_EXPORT QgsComposerLabel: public QgsComposerItem
4646

4747
QFont font() const;
4848
void setFont( const QFont& f );
49+
/** Accessor for the vertical alignment of the label
50+
* @param none
51+
* @returns Qt::AlignmentFlag
52+
*/
4953
Qt::AlignmentFlag vAlign() const { return mVAlignment; }
54+
/** Accessor for the horizontal alignment of the label
55+
* @param none
56+
* @returns Qt::AlignmentFlag
57+
*/
5058
Qt::AlignmentFlag hAlign() const { return mHAlignment; }
59+
/** Mutator for the horizontal alignment of the label
60+
* @param Qt::AlignmentFlag
61+
* @returns void
62+
*/
5163
void setHAlign( Qt::AlignmentFlag a ) {mHAlignment = a;}
64+
/** Mutator for the vertical alignment of the label
65+
* @param QQt::AlignmentFlag
66+
* @returns void
67+
*/
5268
void setVAlign( Qt::AlignmentFlag a ) {mVAlignment = a;}
69+
//!brief Accessor for the margin of the label
5370
double margin() {return mMargin;}
71+
//!brief Mutator for the margin of the label
5472
void setMargin( double m ) {mMargin = m;}
5573

5674
/**Sets text color

0 commit comments

Comments
 (0)