Results 1 to 8 of 8

Thread: Y is className a member function rather than a static one ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: Why is className a member function rather than a static one ?

    Quote Originally Posted by jacek
    Please, don't use such ugly abbreviations.
    Beauty lies in the eyes of the viewer . Anyway I will take care.


    Quote Originally Posted by jacek
    Because it wouldn't make sense. You need className() when you don't know the class name.


    With inheritance mechanism, you can have a pointer that points to an instance of some class derived from a base class, but you not necessarily have to know which one and that's when you have to invoke className()
    That makes sense.
    But I did not find the virual keyword in the assistant. That would have given the clue...
    We can't solve problems by using the same kind of thinking we used when we created them

  2. #2
    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: Why is className a member function rather than a static one ?

    Quote Originally Posted by sunil.thaha
    But I did not find the virual keyword in the assistant.
    It isn't virtual in Qt4, because it's a part of Qt3 Support module and a shorthand for "metaObject()->className()".

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

    sunil.thaha (18th September 2006)

Similar Threads

  1. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  2. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55
  3. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  4. Qt 4.1 and KDE 3.5.1 on OSX 10.2.8
    By Ptero-4 in forum Installation and Deployment
    Replies: 6
    Last Post: 6th February 2006, 02:44
  5. Replies: 25
    Last Post: 15th January 2006, 00:53

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.