longinputdialog.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "longinputdialog.h"
  2. #include "ui_longinputdialog.h"
  3. LongInputDialog::LongInputDialog(const QString & title,
  4. const QString & labelText,
  5. const QString & contentText,
  6. QWidget * parent) :
  7. QDialog(parent),
  8. ui(new Ui::LongInputDialog)
  9. {
  10. ui->setupUi(this);
  11. this->setWindowTitle(title);
  12. ui->m_label->setText(labelText);
  13. ui->m_longInput->setPlainText(contentText);
  14. connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  15. connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  16. }
  17. QString LongInputDialog::contentText() const
  18. {
  19. return ui->m_longInput->toPlainText();
  20. }
  21. LongInputDialog::~LongInputDialog()
  22. {
  23. delete ui;
  24. }
  25. void LongInputDialog::changeEvent(QEvent *e)
  26. {
  27. QDialog::changeEvent(e);
  28. switch (e->type()) {
  29. case QEvent::LanguageChange:
  30. ui->retranslateUi(this);
  31. break;
  32. default:
  33. break;
  34. }
  35. }