Results 1 to 4 of 4

Thread: Regarding syntax

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2009
    Posts
    72
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows
    Thanked 10 Times in 10 Posts

    Default Re: Regarding syntax

    Hi,

    the lines 4 and 5, does the construtor of class FileItem inherit the constructor of class QListViewItem??
    Clearly you have to review ur c++ basics here.


    the syntax is confusing.. I think the constructors are overloaded. Or is it the way of overloading.
    In c++, constructors can be overloaded.
    Ex.
    Qt Code:
    1. class TEST_CLASS_FOR_YOU
    2. {
    3. TEST_CLASS_FOR_YOU();
    4. TEST_CLASS_FOR_YOU(int a);
    5. TEST_CLASS_FOR_YOU(int a,int b);
    6. }
    To copy to clipboard, switch view to plain text mode 

    for furthur please refer this link http://www.cplusplus.com/doc/tutorial/



    No going back the example.

    4. FileItem( QListViewItem *parent, const QString &s1, const QString &s2 )
    5. : QListViewItem( parent, s1, s2 ), pix( 0 ) {}
    This is defination of constructor FileItem which is derived from QListViewItem class. QListViewItem class has overloaded constructor QListViewItem( parent, s1, s2 ) which is called at initillization. this is not a defination of QListViewItem( parent, s1, s2 ) class remember.

  2. The following user says thank you to vishwajeet.dusane for this useful post:

    Yayati.Ekbote (27th January 2010)

Similar Threads

  1. QListWidget syntax highlight
    By Ken_Afford in forum Qt Programming
    Replies: 1
    Last Post: 22nd January 2010, 15:54
  2. Need help getting QAbstractItemView syntax correct
    By Hookem in forum Qt Programming
    Replies: 3
    Last Post: 4th December 2008, 09:34
  3. Odd Syntax
    By acxdotfm in forum Qt Programming
    Replies: 2
    Last Post: 24th October 2008, 20:23
  4. StyleSheet syntax checking
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 30th June 2008, 10:09
  5. QPaintEvent syntax question
    By last2kn0 in forum Newbie
    Replies: 5
    Last Post: 25th January 2008, 20:36

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.