SL100_FactoryTestTool/FactoryTestTool/SourceCode/Network/DelUserWindows.h

45 lines
1.1 KiB
C++

#ifndef DELUSERWINDOW_H
#define DELUSERWINDOW_H
#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QLabel>
#include <QDebug>
class DelUserWindow : public QDialog {
Q_OBJECT
public:
explicit DelUserWindow(QWidget* parent = nullptr) : QDialog(parent) {
setWindowTitle("Delete User");
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* label = new QLabel("输入要删除的用户ID:", this);
layout->addWidget(label);
userInput = new QLineEdit(this);
layout->addWidget(userInput);
QPushButton* deleteButton = new QPushButton("删除用户", this);
layout->addWidget(deleteButton);
qDebug() << "------------- DelUserWindow";
connect(deleteButton, &QPushButton::clicked, this, &DelUserWindow::onDeleteButtonClicked);
}
QString getUserInput() const
{
return userInput->text();
}
private slots:
void onDeleteButtonClicked() {
accept();
}
private:
QLineEdit* userInput;
};
#endif // DELUSERWINDOW_H