mirror-chatterino2/src/widgets/helper/EditableModelView.hpp
Mm2PL 703f3717e2
Add custom hotkeys. (#2340)
Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
Co-authored-by: Paweł <zneix@zneix.eu>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2021-11-21 17:46:21 +00:00

40 lines
742 B
C++

#pragma once
#include <QWidget>
#include <pajlada/signals/signal.hpp>
class QAbstractTableModel;
class QTableView;
class QHBoxLayout;
namespace chatterino {
class EditableModelView : public QWidget
{
public:
EditableModelView(QAbstractTableModel *model, bool movable = true);
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_{};
void moveRow(int dir);
public:
void selectRow(int row);
};
} // namespace chatterino