cutter/src/dialogs/EditMethodDialog.h

51 lines
1.2 KiB
C
Raw Normal View History

#ifndef EDITMETHODDIALOG_H
#define EDITMETHODDIALOG_H
#include <QDialog>
2019-02-02 10:59:58 +00:00
#include <QComboBox>
#include <memory>
#include "Cutter.h"
namespace Ui {
class EditMethodDialog;
}
class EditMethodDialog : public QDialog
{
Q_OBJECT
public:
2019-02-02 10:59:58 +00:00
explicit EditMethodDialog(bool classFixed, QWidget *parent = nullptr);
~EditMethodDialog();
void setClass(const QString &className);
void setMethod(const AnalMethodDescription &desc);
QString getClass();
AnalMethodDescription getMethod();
static bool showDialog(const QString &title, QString *className, AnalMethodDescription *desc, QWidget *parent = nullptr);
static void newMethod(QString className = nullptr, const QString &meth = QString(), QWidget *parent = nullptr);
static void editMethod(const QString &className, const QString &meth, QWidget *parent = nullptr);
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void updateVirtualUI();
void validateInput();
private:
std::unique_ptr<Ui::EditMethodDialog> ui;
2019-02-02 10:59:58 +00:00
QComboBox *classComboBox = nullptr;
QLabel *classLabel = nullptr;
QString fixedClass;
bool inputValid();
};
#endif // EDITMETHODDIALOG_H