Results 1 to 6 of 6

Thread: QMainWindow setCentralWidget from ui widget, Qt4

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    de
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    4

    Default QMainWindow setCentralWidget from ui widget, Qt4

    Sorry for a question with an obvious (?) answer (seems not to be asked so far).

    I would like to create a program based on QMainWindow and have created a quite complex QWidget in Qt-Designer (Qt4) which I would now like to set as the CentralWidget in the QMainWindow.

    I'm using the ui.setup approach, but this gives me always the error, that a 'Ui::Xy&' is not a 'QWidget*': & != * .

    Can somebody point to a simple example where a *.ui file is used to create the CentralWidget of a QMainWIndow, please?

    The Qt4 example about QMainWindow does not do it for me...

    Or is the correct approach to create this main widget as a QMainWindow instead of a QWidget?
    (But what would then be the CentralWidget?)

    (I use cmake rather than qmake, but this should not make any difference, I assume.)
    The widget to be used as the CentralWidget compiles OK, so far I managed to see it outside of the QMainWindow.

    Help is much appreciated.

    Helge

    P.S.: Using Qt 4.4.0-rc1-5 on debian sid amd64, if that matters.
    Last edited by alan; 3rd May 2008 at 00:46.

Similar Threads

  1. Replies: 4
    Last Post: 25th August 2014, 18:05
  2. make a widget paint itself even thought it is not shown
    By momesana in forum Qt Programming
    Replies: 7
    Last Post: 28th April 2008, 11:57
  3. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  4. paint central widget of a QMainWindow???
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 17th January 2007, 08:02
  5. Central Widget of QMainWindow
    By sumsin in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2006, 18: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
  •  
Qt is a trademark of The Qt Company.