Results 1 to 3 of 3

Thread: Multiple ui files and calling a variable from a different class

  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Multiple ui files and calling a variable from a different class

    Hello all

    If I have a program with multiple ui files
    how do i control which is shown, and when, using a function??


    also could anyone tell me a simple way to call a variable from a different class please?


    thanks

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiple ui files and calling a variable from a different class

    Quote Originally Posted by bmn View Post
    If I have a program with multiple ui files
    how do i control which is shown, and when, using a function??
    more details, please. What does "multiple ui files" mean? do you have several dialogs?

    Quote Originally Posted by bmn View Post
    also could anyone tell me a simple way to call a variable from a different class please?
    very simple:
    Qt Code:
    1. MyClass class;
    2. int outerVariable = class.innerVariable
    To copy to clipboard, switch view to plain text mode 

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

    bmn (9th December 2010)

  4. #3
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: Multiple ui files and calling a variable from a different class

    Quote Originally Posted by FelixB View Post
    more details, please. What does "multiple ui files" mean? do you have several dialogs?
    In Qt i have i project where i would like to use more than one ui file (i mean the files under forms) since i would like to split the pages in my stacked widget into two categories.
    How do i set up my class so that i can point to widgets in both ui files? As an example, i have a button in my main ui file that i would like to take me to a page in the stacked widget in the ot other ui files from the project.
    I'm not able to point to the widgets from the other ui file, i believe that i somehow have to include it, make an instance or something but i don't know how and where to do it.

    Quote Originally Posted by FelixB View Post
    very simple:
    Qt Code:
    1. MyClass class;
    2. int outerVariable = class.innerVariable
    To copy to clipboard, switch view to plain text mode 
    I will try this now, thanks

Similar Threads

  1. Replies: 2
    Last Post: 21st October 2010, 07:03
  2. Replies: 7
    Last Post: 2nd September 2010, 19:42
  3. class calling other class functions?
    By Hardstyle in forum Newbie
    Replies: 4
    Last Post: 2nd June 2010, 02:38
  4. Multiple definition of a variable?
    By T0bi4s in forum Newbie
    Replies: 5
    Last Post: 14th January 2010, 22:13
  5. Accessing to a static variable from the same class
    By xgoan in forum General Programming
    Replies: 6
    Last Post: 5th March 2007, 10:50

Tags for this Thread

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.