From 47fa5c13776c404e8075b294a3ffc0ee7e077e8f Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 16 Mar 2015 18:31:07 +0300 Subject: [PATCH] 0022921: [CEA 1438] Remove the checkbox in the "time steps" --- .../ParaViewPlugin/pqMEDReaderPanel.cxx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx index 4a0ec188..c8e62244 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx @@ -126,6 +126,22 @@ pqMEDReaderPanel::pqMEDReaderPanel(pqProxy *object_proxy, QWidget *p):Superclass initAll(); } +// VSR, 16/03/2015, PAL22921 +// Below is the helper class which is implemented a workaround about ugly pqTreeWidgetItemObject class. +// We use this helper class to make 1st and 2nd level tree items uncheckable. +class pqMyTreeWidgetItemObject : public pqTreeWidgetItemObject +{ +public: + pqMyTreeWidgetItemObject(const QStringList& t, int type=QTreeWidgetItem::UserType): pqTreeWidgetItemObject(t, type){} + pqMyTreeWidgetItemObject(QTreeWidget* p, const QStringList& t, int type=QTreeWidgetItem::UserType): pqTreeWidgetItemObject(p, t, type){} + pqMyTreeWidgetItemObject(QTreeWidgetItem* p, const QStringList& t, int type=QTreeWidgetItem::UserType): pqTreeWidgetItemObject(p, t, type){} + virtual void setData ( int column, int role, const QVariant & value ) + { + if ( role != Qt::CheckStateRole) + pqTreeWidgetItemObject::setData(column, role, value ); + } +}; + void pqMEDReaderPanel::initAll() { _all_lev4.clear(); @@ -187,7 +203,7 @@ void pqMEDReaderPanel::initAll() SMProperty->ResetToDefault();//this line is very important ! // QString name0(QString::fromStdString((const char *)verticesNames2->GetValue(id1))); QList strs0; strs0.append(name0); - pqTreeWidgetItemObject *item0(new pqTreeWidgetItemObject(this->UI->Fields,strs0)); + pqTreeWidgetItemObject *item0(new pqMyTreeWidgetItemObject(this->UI->Fields,strs0)); item0->setData(0,Qt::UserRole,name0); item0->setData(0,Qt::ToolTipRole,toolTipName0); // @@ -207,7 +223,7 @@ void pqMEDReaderPanel::initAll() vtkIdType id2(it1->Next()); QString name1(QString::fromStdString((const char *)verticesNames2->GetValue(id2))); QList strs1; strs1.append(name1); QString toolTipName1(name1); - pqTreeWidgetItemObject *item1(new pqTreeWidgetItemObject(item0,strs1)); + pqTreeWidgetItemObject *item1(new pqMyTreeWidgetItemObject(item0,strs1)); item1->setData(0,Qt::UserRole,name1); item1->setData(0,Qt::ToolTipRole,toolTipName1); vtkAdjacentVertexIterator *it2(vtkAdjacentVertexIterator::New());//common support -- 2.39.2