Results 1 to 6 of 6

Thread: Multiple Forms Handling

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    105
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11
    Thanked 4 Times in 2 Posts

    Default Re: Multiple Forms Handling

    Try like this...
    create a pointer to form2 in form1 class. allocate memory in constructor.
    inside button_on_click slot

    call pointer->show();

  2. #2
    Join Date
    Jan 2010
    Posts
    39
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Multiple Forms Handling

    It works. I also found out the I did a mistake. there is no on clicked events.

    Anway I am one more doubt on multiple forms. How can I pass variables of one forms to another.

    ie form 1->label 1->text (lbl1) to form 2's->QString str

  3. #3
    Join Date
    Mar 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Multiple Forms Handling

    I have the same problem.
    Have you found the way to access to form1 variables from form2?

  4. #4
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Multiple Forms Handling

    To pass a variable you should create a public pointer of the same tipe as the widget from the form you want to get the data from, and, in the constructor of the class you initialize them to the ui element.
    Qt Code:
    1. pt = ui->widget
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Multiple Forms and vertical layout in forms
    By eva2002 in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2010, 05:05
  2. Handling multiple forms
    By msmihai in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2008, 13:41
  3. PyQt - Mapping multiple forms to a database
    By peterjb31 in forum Qt Programming
    Replies: 4
    Last Post: 2nd May 2008, 21:31
  4. Layouting "Windows.Forms" like Qt forms
    By Boron in forum Qt Tools
    Replies: 1
    Last Post: 29th April 2008, 22:01
  5. Handling multiple UDP sockets
    By ecphora in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:01

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.