Results 1 to 4 of 4

Thread: error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to '

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to '

    why do I get this error:warning when I "rebuild" a ui project?

    Qt Code:
    1. error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget1'.
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting t

    It means that inside the .ui XML file, the element named "layoutWidget" has already been used somewhere, and the moc compiler is complaining about that, and telling you that it is changing the name to make it unique.

    Open the .ui file using a text editor (*not Qt Designer*) and do a search for "layoutWidget". You should find it twice. Change the name of one to something unique, and the warning will go away.

    I don't know why this happens - it is probably a bug in Qt Designer somewhere that results in a name being reused. It is harmless, but if it bothers you, find it in a text editor (or using the Qt Designer hierarchy browser) and fix it.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2011
    Location
    Solikamsk / Russia
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting t

    (Qt) guys, any plans to really fix this annoying bug ???

    of course it's possible to edit the .ui file manually, but this gets overwritten on next edit with designer ((

    and there are situations like the following, where changing the name(s) manually ain't that obvious:

    </widget>
    <zorder>layoutWidget</zorder>
    <zorder>layoutWidget</zorder>
    <zorder>layoutWidget</zorder>
    <zorder>layoutWidget</zorder>
    <zorder>groupBox_3</zorder>
    </widget>

    so which layoutWidget is which ??? This is really a bug !!!

    this issue still there at Qt4.8.1, please fix it, can't be too hard ...

  4. #4
    Join Date
    Jan 2015
    Location
    Macungie, PA
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting t

    I know it's 3 years later but I'm seeing the same problem now with Qt Creator 3.3.2 (opensource) based on Qt 4.3.1 (BDD 4.6.1, 64 bit)

    I can't find the widgets in question in the designer either. When I look at the XML I see them but I can't point to them on the form.
    Any help?
    They seem to be benign warnings but I'd rather not look at them and Qt Creator doesn't let you modify the XML directly.

Similar Threads

  1. Replies: 5
    Last Post: 3rd July 2014, 12:46
  2. KGlobal::locale::Warning error...
    By glafauci in forum Qt-based Software
    Replies: 2
    Last Post: 19th September 2011, 08:56
  3. Error while executing a application - Gtk WARNING
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2010, 12:25
  4. Replies: 2
    Last Post: 15th February 2010, 06:42
  5. Error in put one QWidget in another QWidget
    By xjtu in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2008, 16:05

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.