gotolinewin.cpp 396 B

1234567891011121314151617181920212223
  1. #include "gotolinewin.h"
  2. GoToLineWin::GoToLineWin(QWidget *parent)
  3. : QWidget(parent)
  4. {
  5. ui.setupUi(this);
  6. }
  7. GoToLineWin::~GoToLineWin()
  8. {
  9. }
  10. void GoToLineWin::slot_ok()
  11. {
  12. bool ok;
  13. int lineNums = ui.lineEditNum->text().toInt(&ok);
  14. if (ok && lineNums>=1)
  15. {
  16. int dire = (ui.radioButton->isChecked() ? 0 : 1);
  17. emit sign_gotoLine(dire, lineNums-1);
  18. close();
  19. }
  20. }