2019-09-08 22:27:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
class QAbstractTableModel;
|
|
|
|
class QTableView;
|
|
|
|
class QHBoxLayout;
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class EditableModelView : public QWidget
|
|
|
|
{
|
|
|
|
public:
|
2020-10-22 20:02:14 +02:00
|
|
|
EditableModelView(QAbstractTableModel *model, bool movable = true);
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
void setTitles(std::initializer_list<QString> titles);
|
|
|
|
|
|
|
|
QTableView *getTableView();
|
|
|
|
QAbstractTableModel *getModel();
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal addButtonPressed;
|
|
|
|
|
|
|
|
void addCustomButton(QWidget *widget);
|
|
|
|
void addRegexHelpLink();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTableView *tableView_{};
|
|
|
|
QAbstractTableModel *model_{};
|
|
|
|
QHBoxLayout *buttons_{};
|
2020-09-26 15:11:45 +02:00
|
|
|
|
|
|
|
void moveRow(int dir);
|
|
|
|
void selectRow(int row);
|
2019-09-08 22:27:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|