Results 1 to 3 of 3

Thread: new design of QDateTimeEdit

  1. #1
    Join Date
    Jul 2007
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default new design of QDateTimeEdit

    Hello.
    I need a widget like QDateTimeEdit by functionality but a little bit more interesting by design (f.e. like QLCDNumber). I tried to create a new widget based on these classes:
    Qt Code:
    1. class TLCDDateTimeEdit : public QDateTimeEdit, public QLCDNumber
    To copy to clipboard, switch view to plain text mode 
    and get the following message: 'Warning: Class TLCDDateTimeEdit inherits from two QObject subclasses QDateTimeEdit and QLCDNumber. This is not supported!'.
    So I wonder if there is any other path to get such a widget?
    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: new design of QDateTimeEdit

    Hmm... possible ways:
    1. Derive from QLCDNumber and implement everything yourself
    2. Subclass QDateTimeEdit and reimplement its paint event to do custom painting
    3. Subclass QAbstractSpinBox, make QLCDNumber its child and implement everything that needs to be implemented.

    In other words - lots of work, so you should consider using stylesheets or forgetting about it instead

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

    Ursa (12th December 2007)

  4. #3
    Join Date
    Jul 2007
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: new design of QDateTimeEdit

    thank for answer.... and I think I'll forget... it's too long for me to realize that...

Similar Threads

  1. Highlighting selected section on QDateTimeEdit
    By Yorma in forum Qt Programming
    Replies: 4
    Last Post: 3rd May 2013, 12:03
  2. Design Patterns in Qt
    By bits in forum General Discussion
    Replies: 11
    Last Post: 11th May 2007, 09:13
  3. A question of style and design
    By Kumosan in forum General Programming
    Replies: 7
    Last Post: 16th March 2007, 09:34
  4. Design problem/question
    By Valheru in forum Qt Programming
    Replies: 2
    Last Post: 27th September 2006, 21:45
  5. Dialog and code design issue
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2006, 17:54

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.