summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlineedit.cpp
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-05 12:13:26 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-06 14:39:40 (GMT)
commit15a21652d178e4a298bb522d777602620cbd9938 (patch)
tree862636dae0389ab0e04d4f34a6a85544bae5e100 /src/gui/widgets/qlineedit.cpp
parent4ad6343be52b757fd354cd92874bca944d2ede49 (diff)
downloadQt-15a21652d178e4a298bb522d777602620cbd9938.zip
Qt-15a21652d178e4a298bb522d777602620cbd9938.tar.gz
Qt-15a21652d178e4a298bb522d777602620cbd9938.tar.bz2
API review: Add convenience functions using QMargins
We added the class QMargins, so we should use it wherever we deal with margins, as a convenience to the users. Reviewed-by: Andreas Aardal Hanssen
Diffstat (limited to 'src/gui/widgets/qlineedit.cpp')
-rw-r--r--src/gui/widgets/qlineedit.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index e4252b5..f5dbe1c 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1102,6 +1102,17 @@ void QLineEdit::setTextMargins(int left, int top, int right, int bottom)
}
/*!
+ \since 4.6
+ Sets the \a margins around the text inside the frame.
+
+ See also textMargins().
+*/
+void QLineEdit::setTextMargins(const QMargins &margins)
+{
+ setTextMargins(margins.left(), margins.top(), margins.right(), margins.bottom());
+}
+
+/*!
Returns the widget's text margins for \a left, \a top, \a right, and \a bottom.
\since 4.5
@@ -1121,6 +1132,18 @@ void QLineEdit::getTextMargins(int *left, int *top, int *right, int *bottom) con
}
/*!
+ \since 4.6
+ Returns the widget's text margins.
+
+ \sa setTextMargins()
+*/
+QMargins QLineEdit::textMargins() const
+{
+ Q_D(const QLineEdit);
+ return QMargins(d->leftTextMargin, d->topTextMargin, d->rightTextMargin, d->bottomTextMargin);
+}
+
+/*!
\property QLineEdit::inputMask
\brief The validation input mask