Results 1 to 5 of 5

Thread: what is type?

Hybrid View

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

    Default Re: what is type?

    Quote Originally Posted by 3dch
    I'd say that the type identifies the data type contained in the item which gets interpreted by the related XXView classes for operations such as sorting or filtering.
    Unfortunately it isn't true. If it had something to do with QVariant::Type, the Trolls would use QVariant::Type instead of defining new types. Note also that QVariant object knows exactly what is the type of the value it holds and there is no need to duplicate that information. Furthermore xxxView classes use models, not xxxItems.

    Qt Code:
    1. class Q_GUI_EXPORT QListWidgetItem
    2. {
    3. friend class QListModel;
    4. public:
    5. enum { Type = 0, UserType = 1000 }; // <- note that there are only two values defined
    6. ...
    To copy to clipboard, switch view to plain text mode 

    As Chcken Blood Machine said, it's used for RTTI:
    Qt Code:
    1. : rtti(type), ... // <--
    2. ...
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Aug 2006
    Location
    Zürich, Switzerland
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: what is type?

    You're absolutely right. Mea culpa!

Similar Threads

  1. Replies: 3
    Last Post: 4th August 2006, 13:05
  2. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 20:11
  3. When itemChanged is emitted, can the change type be detected?
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 7th April 2006, 18:29
  4. Type and User Type
    By campana in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2006, 00:22
  5. use libs under qt4
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 27th February 2006, 18:59

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
  •  
Qt is a trademark of The Qt Company.