Skip to content

Commit 014b040

Browse files
authoredJul 6, 2017
Merge pull request #4736 from nyalldawson/text_button
New gui widget QgsFontButton
2 parents 536f643 + e2acf53 commit 014b040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2406
-313
lines changed
 

‎python/core/qgsfontutils.sip

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111

12+
1213
class QgsFontUtils
1314
{
1415

@@ -136,6 +137,24 @@ class QgsFontUtils
136137
:rtype: bool
137138
%End
138139

140+
static QMimeData *toMimeData( const QFont &font ) /Factory/;
141+
%Docstring
142+
Returns new mime data representing the specified ``font`` settings.
143+
Caller takes responsibility for deleting the returned object.
144+
.. seealso:: fromMimeData()
145+
.. versionadded:: 3.0
146+
:rtype: QMimeData
147+
%End
148+
149+
static QFont fromMimeData( const QMimeData *data, bool *ok /Out/ = 0 );
150+
%Docstring
151+
Attempts to parse the provided mime ``data`` as a QFont.
152+
If data can be parsed as a QFont, ``ok`` will be set to true.
153+
.. seealso:: toMimeData()
154+
.. versionadded:: 3.0
155+
:rtype: QFont
156+
%End
157+
139158
static QString translateNamedStyle( const QString &namedStyle );
140159
%Docstring
141160
Returns the localized named style of a font, if such a translation is available.
@@ -168,6 +187,21 @@ class QgsFontUtils
168187
.. versionadded:: 2.16
169188
:rtype: str
170189
%End
190+
191+
static void addRecentFontFamily( const QString &family );
192+
%Docstring
193+
Adds a font ``family`` to the list of recently used font families.
194+
.. versionadded:: 3.0
195+
.. seealso:: recentFontFamilies()
196+
%End
197+
198+
static QStringList recentFontFamilies();
199+
%Docstring
200+
Returns a list of recently used font families.
201+
.. seealso:: addRecentFontFamily()
202+
.. versionadded:: 3.0
203+
:rtype: list of str
204+
%End
171205
};
172206

173207
/************************************************************************

‎python/core/qgstextrenderer.sip

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,22 @@ class QgsTextFormat
12311231
:rtype: QDomElement
12321232
%End
12331233

1234+
QMimeData *toMimeData() const /Factory/;
1235+
%Docstring
1236+
Returns new mime data representing the text format settings.
1237+
Caller takes responsibility for deleting the returned object.
1238+
.. seealso:: fromMimeData()
1239+
:rtype: QMimeData
1240+
%End
1241+
1242+
static QgsTextFormat fromMimeData( const QMimeData *data, bool *ok /Out/ = 0 );
1243+
%Docstring
1244+
Attempts to parse the provided mime ``data`` as a QgsTextFormat.
1245+
If data can be parsed as a text format, ``ok`` will be set to true.
1246+
.. seealso:: toMimeData()
1247+
:rtype: QgsTextFormat
1248+
%End
1249+
12341250
bool containsAdvancedEffects() const;
12351251
%Docstring
12361252
Returns true if any component of the font format requires advanced effects

0 commit comments

Comments
 (0)
Please sign in to comment.