#include "newspiece.h" #include "ui_newspiece.h" #include NewsPiece::NewsPiece(QWidget *parent) : QWidget(parent), ui(new Ui::NewsPiece) { ui->setupUi(this); } void NewsPiece::setTitle(const QString &title, const QString &url) { _title = title; _url = url; ui->news_title->setText("" + QString(title).remove("\n") + ""); resize(sizeHint()); } void NewsPiece::setDate(const QString &date) { ui->news_date->setText(QString(date).remove("\n")); resize(sizeHint()); } QString NewsPiece::getTitle() { return _title; } QString NewsPiece::getUrl() { return _url; } QString NewsPiece::getDate() { return ui->news_date->text(); } NewsPiece::~NewsPiece() { delete ui; }