Results 1 to 5 of 5

Thread: call form 1 from form 2

  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Default call form 1 from form 2

    How do I call the first form from the second form?

    saff

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

    Default Re: call form 1 from form 2

    In what way? You want to open the first form? Call some method if it? Access some ui element?

    Regardless, it's just standard C++, access the object and use the public methods you disclosed. Note that by default ui elements are private and so can not be accessed from another class.

  3. #3
    Join Date
    Dec 2010
    Posts
    3

    Default Re: call form 1 from form 2

    its a login form, so i want to show the login form (which is the main form) from form 2 once a button is clicked

    saff


    Added after 9 minutes:


    the main form loads but then exits straight away.
    Last edited by saff; 13th December 2010 at 13:27.

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

    Default Re: call form 1 from form 2

    what is your login form supposed to be? a modal dialog?

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

    Default Re: call form 1 from form 2

    try loginForm->exec()

Similar Threads

  1. Pass variable from a form to another form
    By dark1988 in forum Qt Programming
    Replies: 5
    Last Post: 8th February 2011, 18:19
  2. How to call to variables of another form
    By matulik in forum Newbie
    Replies: 3
    Last Post: 14th May 2010, 18:32
  3. Replies: 5
    Last Post: 12th March 2010, 21:43
  4. Help me to load one form over another form PushButton
    By wagmare in forum Qt Programming
    Replies: 7
    Last Post: 26th November 2008, 16:11
  5. Replies: 1
    Last Post: 28th July 2006, 14:10

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.