mirror-chatterino2/src/widgets/helper/EditableModelView.hpp
kornes 07dd8c560b
Prevent user from entering incorrect characters in Live Notifications channels list (#3715)
Co-authored-by: Sidd <iProdigy@users.noreply.github.com>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2022-05-08 10:27:25 +00:00

41 lines
799 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);
void setValidationRegexp(QRegularExpression regexp);
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