PDA

View Full Version : How to create pop up widgets in designer.



gsQT4
25th May 2006, 17:29
I'm creating a form that has a date field. I'm using QDate Edit for the field. But I want the user to be able to set the date using the datepicker widget that was mentioned a few days ago. The date picker should only pop-up when I click a tool button widget next to the QDate Edit widget. I can make all of this work in designer, but I cannot set the date picker widget to be hidden from designer. So, should pop up widgets be handled in designer and when the form is created the widget is hidden? Or should the widget be created and destroyed in code? Can a widget be instantiated without being part of a dialog or form?

Thanks.

jacek
25th May 2006, 17:40
So, should pop up widgets be handled in designer and when the form is created the widget is hidden? Or should the widget be created and destroyed in code?
You should do it in the code, but IMO the easiest way is to implement a custom widget plugin that will create a button which pops up the date picker, so that you would have to only place that button on the form and connect it to date edit.


Can a widget be instantiated without being part of a dialog or form?
Yes, QDialog is also a QWidget.