Results 1 to 4 of 4

Thread: access to mainForm from an ui.h

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default access to mainForm from an ui.h

    Hi, I created a dialog.ui.h from desinger (with some widgets); now I need, eg when I check a spinBox in this dialog, take some things in myMainForm; I'd like to obtain a pointer
    like this: "myMainForm* w" in dialog.ui.h, but how? Thanks
    Regards

  2. #2
    Join Date
    Apr 2006
    Posts
    20
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: access to mainForm from an ui.h

    Normally you don't need a pointer, just use myMainForm::yourWidget which is defined in window.ui.h... But maybe I did not understand your question correctly

  3. #3
    Join Date
    Jan 2006
    Location
    India
    Posts
    54
    Thanks
    1
    Thanked 7 Times in 6 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: access to mainForm from an ui.h

    you can access it by "this" pointer.

    "this" is available in ui.h file.

  4. #4
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: access to mainForm from an ui.h

    Quote Originally Posted by sumsin
    you can access it by "this" pointer.

    "this" is available in ui.h file.
    this is pointer on current used class . You always can write just someMethod() instead this->someMethod()

    2 mickey:
    Use subclassing method for using designer generated code instead use *ui.h ...and all problem will be clearly
    a life without programming is like an empty bottle

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.