[Solved] QtDesigner leaves redundant <tags/>?



  • I have noticed that the .ui file is full of tags like this <layout class="QVBoxLayout" name="verticalLayout_3"> that do not appear in the visual editor. Why is that? They just polute the namespace? Is there a way to remove them?


  • Lifetime Qt Champion

    Hi,

    Didn't you put your widget in layouts ?



  • Yes I did. And th ui looks very nice but when I start to type a few of these invisible in the outline layout names pop up. Tomorrow I'll post some xml. I checked other .ui files and they also contain such redundant layout tags.
    Like that:
    @
    <layout....
    <item>
    <layout>. - the actual layout @



  • !http://i.imgur.com/FtXJH4V.png(This is Qt Designer)!
    @
    <widget class="QWidget" name="centralWidget">
    <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
    <layout class="QVBoxLayout" name="verticalLayout">
    <item>
    <layout class="QHBoxLayout" name="horizontalLayout">
    <item>
    <widget class="QPushButton" name="pushButton_Back">
    <property name="text">
    <string><</string>
    </property>
    </widget>
    </item>
    <item>
    <widget class="QPushButton" name="pushButton_Forward">
    <property name="text">
    <string>></string>
    </property>
    </widget>
    </item>
    <item>
    <widget class="QLineEdit" name="lineEdit_AddressBar"/>
    </item>
    <item>
    <widget class="QPushButton" name="pushButton_Go">
    <property name="text">
    <string>Go</string>
    </property>
    </widget>
    </item>
    </layout>
    </item>
    <item>
    <widget class="QWebView" name="webView">
    <property name="url">
    <url>
    <string>about:blank</string>
    </url>
    </property>
    </widget>
    </item>
    </layout>
    </item>
    </layout>
    </widget>
    <widget class="QStatusBar" name="statusBar"/>
    </widget>
    @


  • Lifetime Qt Champion

    Are you using the standalone Qt Designer or Qt Creator's ?



  • Both... but that code above was created by the standalone that comes with PyQt.

    I have a feeling that these layout elements are leftovers from deleted layouts that I removed while trying to design the form.

    This "issue" is not just limited to the standalone Qt Designer. I have such UIs created by QtCreator too.


  • Lifetime Qt Champion

    Do do you have the same things happening with a fresh new design ?



  • I figured it out. Some Widgets have layouts and they appear as properties in Qt Designer but they are not shown in the outline. :)

    Thanx!


  • Lifetime Qt Champion

    You're welcome !

    Since it's all clear now, please update the thread title prepending [solved] so other forum users may know an answer has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.