summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-11-19 15:17:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-21 16:36:50 +0100
commit37eb61677cb12ca4602e970f0d0ec6a9c0ae71e6 (patch)
treeeeedd73d9a2c4cff28a8f30eca19ff5e6f486880 /tests/auto
parentb8e883bdb034795a1cfa56c26e34f109b97050b0 (diff)
uic - fix to handle QTreeWidget with empty header(s)
This makes it possible for uic to handle QTreeWidget that in the designer has one or more empty headers. Before the right(most) empty items where there wasn't a non-empty header to the right of them would not be visible. The other empty items - where there was a header to the right of it would not be empty but initialized with a number. This patch ensures the same behavior that the QTableWidget is having. Task-number: QTBUG-18156 Change-Id: I19bfd3307befe46a1af2d6a3275f7446a15b3442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui83
-rw-r--r--tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h76
2 files changed, 159 insertions, 0 deletions
diff --git a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui
new file mode 100644
index 0000000000..e74958010b
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QTreeWidget" name="treeWidget">
+ <column>
+ <property name="text">
+ <string/>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>4</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string/>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h
new file mode 100644
index 0000000000..5be6215888
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h
@@ -0,0 +1,76 @@
+/********************************************************************************
+** Form generated from reading UI file 'bug18156QTreeWidget.ui'
+**
+** Created: Tue Nov 20 20:12:59 2012
+** by: Qt User Interface Compiler version 5.0.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef BUG18156QTREEWIDGET_H
+#define BUG18156QTREEWIDGET_H
+
+#include <QtCore/QVariant>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QTreeWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Dialog
+{
+public:
+ QGridLayout *gridLayout;
+ QTreeWidget *treeWidget;
+ QDialogButtonBox *buttonBox;
+
+ void setupUi(QDialog *Dialog)
+ {
+ if (Dialog->objectName().isEmpty())
+ Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->resize(400, 300);
+ gridLayout = new QGridLayout(Dialog);
+ gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ treeWidget = new QTreeWidget(Dialog);
+ treeWidget->headerItem()->setText(0, QString());
+ treeWidget->headerItem()->setText(2, QString());
+ treeWidget->setObjectName(QStringLiteral("treeWidget"));
+
+ gridLayout->addWidget(treeWidget, 0, 0, 1, 1);
+
+ buttonBox = new QDialogButtonBox(Dialog);
+ buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setOrientation(Qt::Horizontal);
+ buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
+
+ gridLayout->addWidget(buttonBox, 1, 0, 1, 1);
+
+
+ retranslateUi(Dialog);
+ QObject::connect(buttonBox, SIGNAL(accepted()), Dialog, SLOT(accept()));
+ QObject::connect(buttonBox, SIGNAL(rejected()), Dialog, SLOT(reject()));
+
+ QMetaObject::connectSlotsByName(Dialog);
+ } // setupUi
+
+ void retranslateUi(QDialog *Dialog)
+ {
+ Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0));
+ QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem();
+ ___qtreewidgetitem->setText(1, QApplication::translate("Dialog", "4", 0));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Dialog: public Ui_Dialog {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // BUG18156QTREEWIDGET_H