Results 1 to 2 of 2

Thread: Change Widgets in the center of MainWindow.

  1. #1
    Join Date
    May 2010
    Posts
    21
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Change Widgets in the center of MainWindow.

    Hi guys,

    I need your help!!! Attached is my project, I have 2 Widget Forms that open in the center of MainWindow, I have two problems:

    1) when I change (using the icons in QToolBar) from one Widget to another repeatedly, get an error: Microsoft Visual C + + Runtime Library.

    2) on Form mainwindow.ui, I can’t set correctly the layout Widget Forms to which they are displayed without changing the layout of MainWindow.

    Please, thank you for any help.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Change Widgets in the center of MainWindow.

    1) when I change (using the icons in QToolBar) from one Widget to another repeatedly, get an error: Microsoft Visual C + + Runtime Library.
    I have always considered this an error also

    Seriously though...

    Your widget1 and widget2 objects are being deleted by the QMainWindow::setCentralWidget() when you set another widget to be the central one.

    Have a look a QStackedWidget if you are just flipping between widgets. This should also help with your layout issues.

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

    Trader (24th July 2010)

Similar Threads

  1. How to put 2 Widgets in a MainWindow ?
    By gen_mass in forum Newbie
    Replies: 13
    Last Post: 1st July 2010, 12:01
  2. resizing widgets when user resizes mainwindow
    By Mystical Groovy in forum Qt Programming
    Replies: 13
    Last Post: 21st December 2009, 00:03
  3. Child Widgets In MainWindow
    By RY in forum Newbie
    Replies: 3
    Last Post: 4th October 2008, 08:39
  4. Replies: 5
    Last Post: 10th April 2008, 09:52
  5. scrolled widgets containers in Mainwindow
    By antonio.r.tome in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2006, 14:40

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.