This repository has been archived on 2020-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
FediPotato/gui/src/widget_post.hpp

67 lines
1.4 KiB
C++

#ifndef FEDIPOTATO_GUI_WIDGET_POST_HPP
#define FEDIPOTATO_GUI_WIDGET_POST_HPP
#include "../ui/ui_widget_post.h"
#include <QWidget>
#include <QResizeEvent>
#include <QString>
#include <QDebug>
#include <QTreeWidget>
namespace FediPotato
{
class PostWidget : public QWidget, private Ui::PostWidget
{
public:
//! Default constructor
explicit PostWidget(QWidget *parent = nullptr)
: QWidget{parent}
{
setupUi(this);
}
//! Copy constructor
PostWidget(const PostWidget &other) = delete;
//! Move constructor
PostWidget(PostWidget &&other) noexcept = delete;
//! Destructor
~PostWidget() noexcept override = default;
//! Copy assignment operator
PostWidget& operator=(const PostWidget &other) = delete;
//! Move assignment operator
PostWidget& operator=(PostWidget &&other) noexcept = delete;
public:
inline void set_user(const QString &user)
{
label_user->setText(user);
}
inline void set_avatar(const QString &avatar)
{
label_avatar->setPixmap(QIcon(avatar).pixmap(QSize(50, 50)));
}
inline void set_subject(const QString &subject)
{
label_subject->setText(subject);
}
inline void set_content(const QString &content)
{
label_content->setText(content);
}
void show_hide_elements();
};
} // namespace FediPotato
#endif // FEDIPOTATO_GUI_WIDGET_POST_HPP