RenameWidget.h 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef RENAMEWIDGET_H
  2. #define RENAMEWIDGET_H
  3. #include <QDialog>
  4. class LineEdit;
  5. class PushButton;
  6. class QHBoxLayout;
  7. class QVBoxLayout;
  8. class QLabel;
  9. class RenameWidget : public QDialog
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit RenameWidget(QWidget *parent = nullptr);
  14. void clearInputs();
  15. signals:
  16. void signalRename();
  17. private:
  18. void initWindow();
  19. void initialize();
  20. void initLayout();
  21. void connectSignalsAndSlots();
  22. void updateRenameButtonState();
  23. private slots:
  24. void slotTextChanged(const QString &text);
  25. void slotConfirmClicked();
  26. void slotCancelClicked();
  27. private:
  28. QVBoxLayout *m_vBoxLayout = nullptr;
  29. QHBoxLayout *m_oldNameLayout = nullptr;
  30. QLabel *m_oldNameLabel = nullptr;
  31. QLabel *m_oldNameValueLabel = nullptr;
  32. LineEdit *m_nameLineEdit = nullptr;
  33. QHBoxLayout *m_buttonLayout = nullptr;
  34. PushButton *m_confirmButton = nullptr;
  35. PushButton *m_cancelButton = nullptr;
  36. };
  37. #endif // RENAMEWIDGET_H