Skip to content

Commit

Permalink
qtmateriallistitem
Browse files Browse the repository at this point in the history
  • Loading branch information
fperillo committed Feb 9, 2018
1 parent 6bd1c6e commit 3e1074a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
19 changes: 14 additions & 5 deletions components/qtmateriallistitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,23 @@ int QtMaterialListItem::size() const

return d->size;
}

void QtMaterialListItem::setLetter(const QString &firstLine, const QString &secondLine = 0, const QString &thirdLine = 0)
//void QtMaterialListItem::setLetter(QString *firstLine)
//{
// setLetter( firstLine, NULL, NULL);
//}
//void QtMaterialListItem::setLetter(QString *firstLine, QString *secondLine )
//{
// setLetter( firstLine, secondLine, NULL );
//}

// void QtMaterialListItem::setLetter(const QString &firstLine, const QString &secondLine = 0, const QString &thirdLine = 0)
void QtMaterialListItem::setLetter(const QString &firstLine ) // , QString *secondLine = QString() , QString *thirdLine = QString())
{
Q_D(QtMaterialListItem);

d->firstLine = firstLine;
d->secondLine = secondLine
d->thirdLine = thirdLine
//d->secondLine = secondLine;
//d->thirdLine = thirdLine;
d->type = Material::LetterListItem;
update();
}
Expand Down Expand Up @@ -251,6 +260,6 @@ void QtMaterialListItem::paintEvent(QPaintEvent *event)
painter.setFont( font );
painter.setPen(QtMaterialStyle::instance().themeColor("text"));

painter.drawText(textRect, Qt::AlignLeft + Qt::AlignVCenter, QString(d->letter));
painter.drawText(textRect, Qt::AlignLeft + Qt::AlignVCenter, QString(d->firstLine));

}
5 changes: 4 additions & 1 deletion components/qtmateriallistitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class QtMaterialListItem : public QWidget
void setSize(int size);
int size() const;

void setLetter(const QString &firstLine, const QString &secondLine = 0, const QString &thirdLine = 0);
// void setLetter(const QString &firstLine, const QString &secondLine = 0, const QString &thirdLine = 0);
void setLetter(const QString &firstLine);
//void setLetter(QString *firstLine, QString *secondLine);
//void setLetter(QString *firstLine, QString *secondLine, QString *thirdLine);
void setImage(const QImage &image);
void setIcon(const QIcon &icon);

Expand Down

0 comments on commit 3e1074a

Please sign in to comment.