Results 1 to 11 of 11

Thread: plz teach inheritance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: plz teach inheritance

    Qt is not a language. Qt is C++. Anything that goes in C++, goes in Qt. Thus you can't use the "super" keyword in Qt because there is no such keyword in C++. If you understand inheritance in C++, there is nothing else you need to learn about it to be able to use it with Qt.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    Default Re: plz teach inheritance

    Anything that goes in C++, goes in Qt. Thus you can't use the "super" keyword in Qt because there is no such keyword in C++.
    I agree that Anything that goes in C++, goes in Qt, but I don't completely agree with later statement

    Thus you can't use the "super" keyword in Qt because there is no such keyword in C++
    There are keywords (at-least I call them so) in Qt which C++ does not support like "signals", "slots" (who knows in future versions of Qt "super" may also is supported (may be with different meaning)).

    Yes, I still agree with the overall meaning of the post, that there is no such keyword "super" in Qt (implied in C++)

  3. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: plz teach inheritance

    There is nothing to agree or disagree here, the list of C++ keywords (reserved identifiers) is clearly defined: C++ keywords

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: plz teach inheritance

    Calling words like 'signals' keywords is incorrect IMO, they are just macros. Words like 'emit' are completely optional (they are syntactic sugar). Other words are only needed by moc and are removed by the C++ preprocessor.

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

    Default Re: plz teach inheritance

    Quote Originally Posted by Santosh Reddy View Post
    There are keywords (at-least I call them so) in Qt which C++ does not support like "signals", "slots" (who knows in future versions of Qt "super" may also is supported (may be with different meaning)).
    A "keyword" is something related to syntax of the language and interpreted by the compiler of that language. Since Qt is not a language, it can't introduce keywords for the C++ compiler. I can agree that things like "signals:" and "slots:" can be treated as keywords of moc.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. WizBang - Learn and Teach Procedural Programming Languages
    By chadkeck in forum Qt-based Software
    Replies: 1
    Last Post: 9th October 2009, 17:38
  2. inheritance
    By steiner in forum Qt Programming
    Replies: 4
    Last Post: 30th October 2007, 20:17
  3. inheritance
    By mickey in forum General Programming
    Replies: 11
    Last Post: 28th September 2007, 21:54
  4. How much inheritance do you use?
    By Michiel in forum General Programming
    Replies: 8
    Last Post: 1st August 2006, 22:29
  5. QSA and inheritance
    By jwintz in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2006, 14:05

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.