mirror-chatterino2/src/widgets/helper/EditableModelView.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
760 B
C++
Raw Normal View History

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