Results 1 to 2 of 2

Thread: QtDesigner: set centralWidget of QMainWindow

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QtDesigner: set centralWidget of QMainWindow

    Hi,
    I want to use QtDesigner to create a QMainWindow.
    But I can't set the centralWidget correctly: I want to have a TabWidget as my centralWidget, but in QtDesigner, it is always a QWidget and I cannot edit it. Simply dragging a QTabWidget onto the QMainWindow adds it as a child of the centralWidget, but I want t to be the centralWidget.
    What am I doing wrong?

    regards,
    Florian

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QtDesigner: set centralWidget of QMainWindow

    It doesn't matter. You use layouts.

    But... if you really really insist in having it as the central widget:
    Create a new widget, then in your main window constructor create a new object of your tab widget, then set it as the central widget.

Similar Threads

  1. QMainWindow/centralWidget question
    By graciano in forum Qt Programming
    Replies: 6
    Last Post: 15th April 2010, 22:49
  2. QMainWindow -> centralWidget size
    By lalesculiviu in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2009, 09:40
  3. centralWidget always in center
    By xyfix in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2009, 16:13
  4. QMainWindow->centralWidget with alpha?
    By wafto in forum Newbie
    Replies: 2
    Last Post: 7th December 2008, 02:52
  5. QMainWindow: problem changing centralWidget
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 4th October 2007, 13:00

Tags for this Thread

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.