Results 1 to 2 of 2

Thread: How to create pop up widgets in designer.

  1. #1
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default How to create pop up widgets in designer.

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create pop up widgets in designer.

    Quote Originally Posted by gsQT4
    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.

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

Similar Threads

  1. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28
  2. How to movable dock widgets?
    By becond in forum Qt Tools
    Replies: 3
    Last Post: 21st February 2006, 19:57
  3. Replies: 2
    Last Post: 14th February 2006, 15:28
  4. Creating Widgets
    By hylke in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2006, 08:37
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.