Results 1 to 2 of 2

Thread: Can't embed a widget with UI into the central area

  1. #1
    Join Date
    Sep 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Can't embed a widget with UI into the central area

    To ease my task, I designed a widget in Qt Designer for my project. I made the appropitate header and source for the widget and included the headers in the main window source. But I get errors upon adding the widget to the grid layout of the central widget. The errors are announced by that the name of the UI pointer stays black and the point doesn't change to an arrow. I've integrated the main and the UI header of the widget. Here is the code (in Qt Creator view):
    mainWindowUI->gridLayout->addWidget(widgetUI.widget);
    Can you help me please?

  2. #2
    Join Date
    Sep 2006
    Posts
    38
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Can't embed a widget with UI into the central area

    There's not a lot of information to go on, but did you declare "widget" with new? as in
    Qt Code:
    1. lineEdit = new QLineEdit(mainWindowUI);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 0
    Last Post: 28th March 2013, 00:22
  2. Central Widget Max Height
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2011, 18:26
  3. Replies: 8
    Last Post: 28th June 2011, 14:57
  4. Qt Designer About central widget in Qt Designer
    By lrjdragon in forum Qt Tools
    Replies: 2
    Last Post: 3rd April 2010, 16:11
  5. QDockWidgets without central widget
    By JoeMerchant in forum Qt Programming
    Replies: 17
    Last Post: 8th August 2007, 14:52

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.