qspinputbox.h 559 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef QSPINPUTBOX_H
  2. #define QSPINPUTBOX_H
  3. #include <QWidget>
  4. #include <QPlainTextEdit>
  5. #include <QString>
  6. #include <QStringList>
  7. namespace Ui {
  8. class QspInputBox;
  9. }
  10. class QspInputBox : public QPlainTextEdit
  11. {
  12. Q_OBJECT
  13. signals:
  14. void InputTextEnter();
  15. public:
  16. explicit QspInputBox(QWidget *parent = 0);
  17. ~QspInputBox();
  18. // Accessors
  19. void SetText(const QString& text);
  20. QString GetText();
  21. private:
  22. void keyPressEvent(QKeyEvent *event);
  23. // Fields
  24. QStringList m_strings;
  25. int m_selIndex;
  26. };
  27. #endif // QSPINPUTBOX_H