Typica is a free program for professional coffee roasters. https://typica.us
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

MainWindow.cpp 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @file MainWindow.cpp
  3. * @brief MainWindow Implementation.
  4. * @see MainWindow.h
  5. * @author Micha? Policht
  6. */
  7. #include <QMessageBox>
  8. #include <QMenuBar>
  9. #include "MainWindow.h"
  10. #include "MessageWindow.h"
  11. #include "QespTest.h"
  12. MainWindow::MainWindow()
  13. {
  14. //central widget
  15. QespTest *qespTest = new QespTest();
  16. setCentralWidget(qespTest);
  17. //bottom dock widget
  18. MessageWindow *msgWindow = new MessageWindow();
  19. addDockWidget(Qt::BottomDockWidgetArea, msgWindow);
  20. createActions();
  21. createMenus();
  22. setWindowTitle(tr("QextSerialPort Test Application"));
  23. }
  24. void MainWindow::about()
  25. {
  26. QMessageBox::about(this, tr("About "),
  27. tr("<B>""</B><BR>"
  28. "author: Michal Policht<br>"
  29. "<a href='mailto:xpolik@users.sourceforge.net'>xpolik@users.sourceforge.net</a>"));
  30. }
  31. void MainWindow::createActions()
  32. {
  33. //File actions
  34. exitAct = new QAction(tr("E&xit"), this);
  35. exitAct->setShortcut(tr("CTRL+D"));
  36. exitAct->setStatusTip(tr("Exit the application"));
  37. connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
  38. //Help actions
  39. aboutAct = new QAction(tr("&About"), this);
  40. aboutAct->setShortcut(tr("CTRL+A"));
  41. aboutAct->setStatusTip(tr("About application"));
  42. connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
  43. }
  44. void MainWindow::createMenus()
  45. {
  46. fileMenu = menuBar()->addMenu(tr("&File"));
  47. fileMenu->addAction(exitAct);
  48. helpMenu = menuBar()->addMenu(tr("&Help"));
  49. helpMenu->addAction(aboutAct);
  50. }