Results 1 to 6 of 6

Thread: insert a QDateEdit in a QComboBox

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default insert a QDateEdit in a QComboBox

    Hi!
    I have a question:
    Is there a possibility to add a QDateEdit to a QComboBox?
    I want to add some Strings and at the end a QDateEdit?

    thank u!

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: insert a QDateEdit in a QComboBox

    Here look at this post

  3. The following user says thank you to Santosh Reddy for this useful post:

    Qiieha (27th June 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: insert a QDateEdit in a QComboBox

    thank u

    I use the code, but what I have to do with the paintEvent?

  5. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: insert a QDateEdit in a QComboBox

    Implement paintEvent if you want custom rending, else leave it.

  6. #5
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: insert a QDateEdit in a QComboBox

    ok, but there is no Content Type for a QDateEdit.
    Can you give me a hint?
    Qt Code:
    1. style->drawControl(QStyle::????,&opt,painter);
    To copy to clipboard, switch view to plain text mode 
    Last edited by Qiieha; 28th June 2011 at 09:56.

  7. #6
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: insert a QDateEdit in a QComboBox

    You may need to use drawComplexControl() using QStyle::CC_ComboBox, or QStyle::CC_SpinBox, based on type of style used

Similar Threads

  1. 2 QDateEdit with 1 QCalendarWidget ?
    By ouekah in forum Newbie
    Replies: 4
    Last Post: 26th April 2010, 10:24
  2. Null for QDateEdit
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2009, 22:54
  3. segmentation fault insert QString in QCombobox
    By regix in forum Qt Programming
    Replies: 16
    Last Post: 8th August 2006, 09:46
  4. Clearing QDateEdit
    By jpujolf in forum Qt Programming
    Replies: 3
    Last Post: 27th July 2006, 22:19
  5. Subclassing QDateEdit
    By jamadagni in forum Qt Programming
    Replies: 6
    Last Post: 4th February 2006, 14:26

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.