DialogEditComment.cpp 583 B

1234567891011121314151617181920212223242526272829303132
  1. #include "DialogEditComment.h"
  2. DialogEditComment::DialogEditComment(const QString& strComm, QWidget *parent)
  3. : QDialog(parent)
  4. {
  5. ui.setupUi(this);
  6. m_strComment = strComm;
  7. ui.textComment->setText(m_strComment);
  8. // 槽函数
  9. connect(ui.okButton, SIGNAL(clicked()), this, SLOT(onButtonOkClicked()));
  10. connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  11. }
  12. DialogEditComment::~DialogEditComment()
  13. {
  14. }
  15. /// <summary>
  16. /// OK按钮
  17. /// </summary>
  18. void DialogEditComment::onButtonOkClicked()
  19. {
  20. m_strComment = ui.textComment->toPlainText();
  21. this->accept();
  22. }