Typica is a free program for professional coffee roasters. https://typica.us
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

daterangeselector.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*655:*/
  2. #line 30 "./daterangeselector.w"
  3. #include <QComboBox>
  4. #include <QPushButton>
  5. #include <QCalendarWidget>
  6. #ifndef TypicaDateRangeSelectorHeader
  7. #define TypicaDateRangeSelectorHeader
  8. /*657:*/
  9. #line 91 "./daterangeselector.w"
  10. class CustomDateRangePopup:public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. CustomDateRangePopup(QWidget*parent= NULL);
  15. public slots:
  16. void applyRange();
  17. signals:
  18. void hidingPopup();
  19. protected:
  20. virtual void hideEvent(QHideEvent*event);
  21. private slots:
  22. void validateRange();
  23. private:
  24. QCalendarWidget*startDateSelector;
  25. QCalendarWidget*endDateSelector;
  26. QPushButton*applyButton;
  27. };
  28. /*:657*/
  29. #line 39 "./daterangeselector.w"
  30. class DateRangeSelector:public QWidget
  31. {
  32. Q_OBJECT
  33. Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
  34. public:
  35. DateRangeSelector(QWidget*parent= NULL);
  36. void setCustomRange(QVariant range);
  37. Q_INVOKABLE QVariant currentRange();
  38. int currentIndex();
  39. public slots:
  40. void setCurrentIndex(int index);
  41. void setLifetimeRange(QString startDate,QString endDate);
  42. void removeIndex(int index);
  43. signals:
  44. void rangeUpdated(QVariant);
  45. private slots:
  46. void toggleCustom();
  47. void popupHidden();
  48. void updateRange(int index);
  49. private:
  50. QComboBox*quickSelector;
  51. CustomDateRangePopup*customRangeSelector;
  52. int lastIndex;
  53. };
  54. #endif
  55. /*:655*/