[solved] QDateEdit Calendar PoP Up issue.
-
Hi All,
Is there any way to pop up the calendar with out using mouse? What i was trying to do is, A form in which user fills his data. While filling the date, the calendar automatically pops up. I am not able to do this.
However, when DateEdit is clicked, it pops up, but not just with keys.
-
Guessing here; please consult the Qt sources to verify:
QDateEdit shows a line edit with a small button inside it, right? And pressing that button, will show the popup, very much like a QCombobox.
My guess is, that QDateEdit actually uses a button widget for the button. If so, are able to get a pointer to the button: it will be the only QAbstractButton type child of the QDateEdit. Once you have that one, you can use it's click() method... That should popup the calendar, I think.
-
bq. very much like a QCombobox.
Thanks andre, Looks like it is "QAbstractSpinBox":http://doc.qt.nokia.com/latest/qabstractspinbox.html
-
Looks like you are right; QAbstractSpinBox is the base class. And, that one does draw the up and down buttons itself. So, my idea above is not going to work out for you. Sorry!
-
it has some slots:
*void stepDown ()
- void stepUp ()
Which you could try to use programatically.
-
bq. it has some slots:
*void stepDown ()
void stepUp ()so as stepBy(int). Thank you. Will try with this.
-
@Rahul:
I am also working on the same requirement. Can you provide me with the snap shot of your code so that I can also implement the same.Thanks in Advance
-
you could also do this like i "posted here":http://qt-project.org/forums/viewthread/27361#123861.