querydialog.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef QUERYDIALOG_H
  2. #define QUERYDIALOG_H
  3. #include <QMessageBox>
  4. #include <QPixmap>
  5. class QueryDialog : public QObject
  6. {
  7. Q_OBJECT
  8. Q_CLASSINFO("Author", "Sebastiano Galazzo")
  9. Q_CLASSINFO("Email", "sebastiano.galazzo@gmail.com")
  10. Q_PROPERTY(QString message READ text WRITE setText)
  11. Q_PROPERTY(QString titleText READ titleText WRITE setTitleText)
  12. Q_PROPERTY(QString icon READ icon WRITE setIcon)
  13. Q_PROPERTY(QString acceptButtonText READ acceptButtonText WRITE setAcceptButtonText)
  14. Q_PROPERTY(QString rejectButtonText READ rejectButtonText WRITE setRejectButtonText)
  15. public:
  16. explicit QueryDialog(QObject *parent = 0);
  17. QString text();
  18. void setText(QString);
  19. QString titleText();
  20. void setTitleText(QString);
  21. QString icon();
  22. void setIcon(QString);
  23. QString acceptButtonText();
  24. void setAcceptButtonText(QString);
  25. QString rejectButtonText();
  26. void setRejectButtonText(QString);
  27. signals:
  28. void accepted();
  29. void rejected();
  30. public slots:
  31. void open();
  32. private:
  33. QString m_message;
  34. QString m_titleText;
  35. QString m_icon_path;
  36. QString m_acceptButtonText;
  37. QString m_rejectButtonText;
  38. QPixmap m_icon;
  39. QMessageBox mbox;
  40. };
  41. #endif // QUERYDIALOG_H