|
@@ -41,10 +41,12 @@ access to the ISO 8601 string representation of these dates is provided.
|
41
|
41
|
class DateRangeSelector : public QWidget
|
42
|
42
|
{
|
43
|
43
|
@[Q_OBJECT@]@;
|
|
44
|
+ Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)@/
|
44
|
45
|
public:@/
|
45
|
46
|
DateRangeSelector(QWidget *parent = NULL);
|
46
|
47
|
void setCustomRange(QVariant range);
|
47
|
|
- Q_INVOKABLE QVariant currentRange();@/
|
|
48
|
+ Q_INVOKABLE QVariant currentRange();
|
|
49
|
+ int currentIndex();@/
|
48
|
50
|
@[public slots@]:@/
|
49
|
51
|
void setCurrentIndex(int index);
|
50
|
52
|
void setLifetimeRange(QString startDate, QString endDate);
|
|
@@ -79,7 +81,9 @@ class DateRangeSelector : public QWidget
|
79
|
81
|
@<CustomDateRangePopup implementation@>
|
80
|
82
|
@<DateRangeSelector implementation@>
|
81
|
83
|
|
|
84
|
+#if 0
|
82
|
85
|
#include "moc_daterangeselector.cpp"
|
|
86
|
+#endif
|
83
|
87
|
|
84
|
88
|
@ The custom range pop up is represented as a separate class which is not to be
|
85
|
89
|
instantiated except by |DateRangeSelector|.
|
|
@@ -403,7 +407,7 @@ QVariant DateRangeSelector::currentRange()
|
403
|
407
|
return quickSelector->itemData(lastIndex);
|
404
|
408
|
}
|
405
|
409
|
|
406
|
|
-@ Similarly, a method is provided to set the current index of the combo box.
|
|
410
|
+@ Methods are provided to get and set the current index of the combo box.
|
407
|
411
|
|
408
|
412
|
@<DateRangeSelector implementation@>=
|
409
|
413
|
void DateRangeSelector::setCurrentIndex(int index)
|
|
@@ -411,6 +415,11 @@ void DateRangeSelector::setCurrentIndex(int index)
|
411
|
415
|
quickSelector->setCurrentIndex(index);
|
412
|
416
|
}
|
413
|
417
|
|
|
418
|
+int DateRangeSelector::currentIndex()
|
|
419
|
+{
|
|
420
|
+ return quickSelector->currentIndex();
|
|
421
|
+}
|
|
422
|
+
|
414
|
423
|
@ The Lifetime range is handled somewhat differently from other ranges as there
|
415
|
424
|
is no general way to know what that range should be without making unsafe
|
416
|
425
|
assumptions. As such, reports are expected to remove the option, provide a
|