forked from MrBesen/soundboard
43 lines
728 B
C++
43 lines
728 B
C++
#ifndef EDITBUTTON_H
|
|
#define EDITBUTTON_H
|
|
|
|
#include <QDialog>
|
|
#include <QLineEdit>
|
|
|
|
namespace Ui {
|
|
class EditButton;
|
|
}
|
|
|
|
class EditButton : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit EditButton(QWidget *parent = nullptr);
|
|
~EditButton();
|
|
|
|
const std::string& getName() const;
|
|
const std::string& getKey() const;
|
|
uint8_t getWidth() const;
|
|
|
|
void setName(const std::string& name);
|
|
void setKey(const std::string& key);
|
|
void setWidth(uint8_t w);
|
|
|
|
private slots:
|
|
void editName(const QString& text);
|
|
void editShortcut(const QString& text);
|
|
|
|
private:
|
|
Ui::EditButton *ui;
|
|
|
|
std::string name;
|
|
std::string key;
|
|
|
|
bool validShortcut = true;
|
|
|
|
bool setTextValid(QLineEdit* box, QString& newtext) const;
|
|
};
|
|
|
|
#endif // EDITBUTTON_H
|