Permalink
Browse files

Added appendText() convenience method to Label.

  • Loading branch information...
1 parent 7740acb commit 48706a5780390c044ccd016622715679fcce66d3 @tarmack committed Feb 12, 2011
Showing with 7 additions and 0 deletions.
  1. +6 −0 Label.cpp
  2. +1 −0 Label.h
View
@@ -16,13 +16,19 @@ Label::~Label()
void Label::setText(QString text)
{
+ text = text.remove('\n');
if (text != this->text())
{
QLabel::setText(text);
emit textChanged(text);
}
}
+void Label::appendText(QString text)
+{
+ this->setText(this->text() + text);
+}
+
QString Label::completion()
{
return this->completionText;
View
@@ -14,6 +14,7 @@ class Label : public QLabel
Label(QWidget* parent = 0);
virtual ~Label();
void setText(QString text);
+ void appendText(QString text);
QString completion();
void setCompletion(QString string);
QString preEdit();

0 comments on commit 48706a5

Please sign in to comment.