[Interest] UIC (widgets) generation problem

Yury Luneff yury at indigosystem.ru
Sat Dec 6 23:14:40 CET 2014


I’m using Qt 5.3.2.

My UI file (QtWidgets) contains layout like this:
>>>>>>>>>>>>>>>>
<layout class="QVBoxLayout" name="verticalLayout_10" stretch="1,100">
    <property name="spacing">
     <number>0</number>
    </property>
    <property name="sizeConstraint">
     <enum>QLayout::SetDefaultConstraint</enum>
    </property>
    <property name="leftMargin">
     <number>0</number>
    </property>
    <property name="topMargin">
     <number>0</number>
    </property>
    <property name="rightMargin">
     <number>0</number>
    </property>
    <property name="bottomMargin">
     <number>0</number>
    </property>
    <item>
>>>>>>>>>>>>>>>
and so on

Upon generation I have:
>>>>>>>>>>>>>>>>>>>>>
verticalLayout_10 = new QVBoxLayout(centralWidget);
verticalLayout_10->setSpacing(0());
verticalLayout_10->setMargin(0());
verticalLayout_10->setObjectName(QStringLiteral("verticalLayout_10"));
verticalLayout_10->setSizeConstraint(QLayout::SetDefaultConstraint);
verticalLayout_10->setContentsMargins(0, 0, 0, 0);
>>>>>>>>>>>>>>>>>>>>>>>

With "0()" parameter being the problem:
./ui_indigotaxi.h:440:41: error: expression cannot be used as a function
         verticalLayout_10->setSpacing(0());

When I replace spacing value with 1 I get
verticalLayout_10->setSpacing(1);

I had the same problem with Qt 4.8.5, but VS2005 was able to ignore this. Now I have Qt 5.3.2 and GCC doesn’t allow this at all.
        
How could I bypass this problem?
---
Yury Luneff
CEO
Indigo Systems, Ltd.

http://www.indigosystem.ru
mobile: +7 (908) 51-10-138




More information about the Interest mailing list