summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-26 12:24:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-26 12:24:57 (GMT)
commite2e2ee6684931bb0325d4b973709a315f7477cb2 (patch)
treecfc34761b3cb6816187def9ad59eb4b59f8e95ef /tools
parente2f475b0e32d302ea8b755e7c16274077b454725 (diff)
parent140e68ae50411631aa5c1649face4c7d9d1b651d (diff)
downloadQt-e2e2ee6684931bb0325d4b973709a315f7477cb2.zip
Qt-e2e2ee6684931bb0325d4b973709a315f7477cb2.tar.gz
Qt-e2e2ee6684931bb0325d4b973709a315f7477cb2.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix broken qglthreads autotest build on Solaris. Don't store the alignment attribute for spacers
Diffstat (limited to 'tools')
-rw-r--r--tools/designer/src/lib/uilib/abstractformbuilder.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/designer/src/lib/uilib/abstractformbuilder.cpp b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
index 81f1a3b..665badb 100644
--- a/tools/designer/src/lib/uilib/abstractformbuilder.cpp
+++ b/tools/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -1452,6 +1452,8 @@ struct FormBuilderSaveLayoutEntry {
explicit FormBuilderSaveLayoutEntry(QLayoutItem *li = 0) :
item(li), row(-1), column(-1), rowSpan(0), columnSpan(0), alignment(0) {}
+ void setAlignment(Qt::Alignment al);
+
QLayoutItem *item;
int row;
int column;
@@ -1460,6 +1462,20 @@ struct FormBuilderSaveLayoutEntry {
Qt::Alignment alignment;
};
+// filter out the case of "Spacer" and "QLayoutWidget" widgets
+void FormBuilderSaveLayoutEntry::setAlignment(Qt::Alignment al)
+{
+ if (!item->widget())
+ return;
+
+ const QString className = item->widget()->metaObject()->className();
+ if (className == QLatin1String("Spacer")
+ || className == QLatin1String("QLayoutWidget"))
+ return;
+
+ alignment = al;
+}
+
// Create list from standard box layout
static QList<FormBuilderSaveLayoutEntry> saveLayoutEntries(const QLayout *layout)
{
@@ -1469,7 +1485,7 @@ static QList<FormBuilderSaveLayoutEntry> saveLayoutEntries(const QLayout *layout
for (int idx = 0; idx < count; ++idx) {
QLayoutItem *item = layout->itemAt(idx);
FormBuilderSaveLayoutEntry entry(item);
- entry.alignment = item->alignment();
+ entry.setAlignment(item->alignment());
rc.append(entry);
}
}
@@ -1486,7 +1502,7 @@ static QList<FormBuilderSaveLayoutEntry> saveGridLayoutEntries(QGridLayout *grid
QLayoutItem *item = gridLayout->itemAt(idx);
FormBuilderSaveLayoutEntry entry(item);
gridLayout->getItemPosition(idx, &entry.row, &entry.column, &entry.rowSpan,&entry.columnSpan);
- entry.alignment = item->alignment();
+ entry.setAlignment(item->alignment());
rc.append(entry);
}
}