Commit b63380ee authored by Haocheng LIU's avatar Haocheng LIU

BUG: qtGroupItem should expand to contents

parent 26731a7d
......@@ -13,6 +13,7 @@
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtAttributeRefItem.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtTableWidget.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/attribute/GroupItem.h"
......@@ -353,10 +354,9 @@ void qtGroupItem::addItemsToTable(int i)
QBoxLayout* frameLayout = qobject_cast<QBoxLayout*>(this->Internals->ChildrensFrame->layout());
if (!this->Internals->ItemsTable)
{
this->Internals->ItemsTable = new QTableWidget(this->Internals->ChildrensFrame);
this->Internals->ItemsTable = new qtTableWidget(this->Internals->ChildrensFrame);
this->Internals->ItemsTable->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//this->Internals->ItemsTable->horizontalHeader()->setStretchLastSection(true);
//this->Internals->ItemsTable->setFixedHeight(120);
this->Internals->ItemsTable->setColumnCount(1); // for minus button
frameLayout->addWidget(this->Internals->ItemsTable);
}
......
......@@ -7,7 +7,6 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include "smtk/extension/qt/qtTableWidget.h"
#include <QHeaderView>
......@@ -17,8 +16,13 @@ using namespace smtk::extension;
qtTableWidget::qtTableWidget(QWidget* p)
: QTableWidget(p)
{
//we want the table to always fill the frame
// Table should always fills the frame and resizes to contents
this->horizontalHeader()->setStretchLastSection(true);
#if QT_VERSION >= 0x050000
this->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#else
this->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#endif
}
qtTableWidget::~qtTableWidget()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment