Results 1 to 2 of 2

Thread: show form2 from form1( form1 will hide)

  1. #1
    Join Date
    Jun 2011
    Posts
    35
    Thanks
    16
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60

    Default show form2 from form1( form1 will hide)

    i have 2 form(design by UI) . i want that when iclick button from form1 then form 2 will show and form1 hide

    i try thid code but it is not work

    Qt Code:
    1. QWidget * widgt= new QWidget();
    2. Ui::Form2 ui;
    3. ui.setupUi(widgt);
    4.  
    5. Form2 *detail = new Form2 (urlImage,index,widgt);
    6. detail->show();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: show form2 from form1( form1 will hide)

    Typically, if you want something to be done on button click, you use signals & slots. I can't see anything like that in your code. Did you connect the "button from form1" to any slot ?

Similar Threads

  1. how to show and hide frames?
    By rambo83 in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2010, 09:53
  2. transfer graphicsscene on form1 to graphicsscene on form2
    By rogerholmes in forum Qt Programming
    Replies: 2
    Last Post: 25th September 2009, 20:37
  3. Hide and Show QMenu
    By febil in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2009, 09:31
  4. Replies: 1
    Last Post: 7th November 2007, 08:39
  5. accessing form1's objects from form2
    By Philip_Anselmo in forum Newbie
    Replies: 5
    Last Post: 4th May 2006, 22:54

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.