Results 1 to 4 of 4

Thread: connections between two forms

  1. #1
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Post connections between two forms

    hi,
    how should i open a form(2) by clicking the button on the form(1)

    i had made this in qt3.3 easily like ( form2 dialog1( this );
    dialog1.exec();
    )

    but it is little confusing in qt4.3.2

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connections between two forms

    That code is valid in 4.x too. What problems did you encounter?

  3. #3
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy Re: connections between two forms

    this is my problem, i am also attaching my program
    /************************************************** *****
    test5.cpp: In member function `void test5:peninternet()':
    test5.cpp:21: error: `dialog1' undeclared (first use this function)
    test5.cpp:21: error: (Each undeclared identifier is reported only once for each function it appears in.)
    test5.cpp:21: error: expected `;' before "inter1"
    test5.cpp:22: error: `inter1' undeclared (first use this function)
    */
    in header file i have included form2 header file, but though it giving error
    Attached Files Attached Files
    Last edited by marcel; 21st December 2007 at 10:11. Reason: reformatted to look better

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connections between two forms

    Who is dialog1? You haven't declared it anywhere. I assume you want to show the dialog defined by dialog1.ui. You have to implement it - do as you did for the main window.

    Since you use exec() to show the dialog, you can create the dialog on the stack(declare it as variable in that function).

Similar Threads

  1. Custom shaped forms and controls
    By AlbertGoodwill in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2007, 06:35
  2. Saving state of connections
    By Chuk in forum Qt Programming
    Replies: 11
    Last Post: 26th August 2007, 17:01
  3. QTcpServer limit for incoming connections
    By mdecandia in forum Qt Programming
    Replies: 9
    Last Post: 5th May 2007, 22:09
  4. OT : QSql - connections fail after a while.
    By Harvey West in forum Qt Programming
    Replies: 6
    Last Post: 19th January 2007, 13:46
  5. Communication 2 Forms
    By cristiano in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2006, 06:32

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.