#include "DialogEditComment.h" DialogEditComment::DialogEditComment(const QString& strComm, QWidget *parent) : QDialog(parent) { ui.setupUi(this); m_strComment = strComm; ui.textComment->setText(m_strComment); // 槽函数 connect(ui.okButton, SIGNAL(clicked()), this, SLOT(onButtonOkClicked())); connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject())); } DialogEditComment::~DialogEditComment() { } /// /// OK按钮 /// void DialogEditComment::onButtonOkClicked() { m_strComment = ui.textComment->toPlainText(); this->accept(); }