Results 1 to 18 of 18

Thread: pass "this" as parameter

Threaded View

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

    Default Re: pass "this" as parameter

    Quote Originally Posted by incapacitant
    Qt Code:
    1. ApplicationWindow::ApplicationWindow()
    2. : QMainWindow( 0 )
    3. {
    4.  
    5. // set background and size it correctly
    6. ( this )->resize( 569, 458 );
    To copy to clipboard, switch view to plain text mode 
    You don't have to use "this" in above code. You can simply write:
    Qt Code:
    1. ApplicationWindow::ApplicationWindow()
    2. : QMainWindow( 0 )
    3. {
    4.  
    5. // set background and size it correctly
    6. resize( 569, 458 );
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by incapacitant
    What is the the type of "this" ?
    In this case "this" is this: ApplicationWindow*

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

    incapacitant (23rd April 2006)

Similar Threads

  1. How to declare SLOT as a parameter to member function?
    By QPlace in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2018, 00:41
  2. Error: BadMatch --> what's it?
    By mattia in forum Newbie
    Replies: 4
    Last Post: 9th June 2008, 12:20

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.