...
 
Commits (5)
......@@ -40,6 +40,8 @@ In the case of extensible Group Items, the item view style refers to subgroups.
* The modified signal from the corresponding qtInputItem is no longer sent when the underlying ValueItem is modified. It is now sent after the Editor's internal widgets have been appropriately updated.
### Changes to qtBaseView
* The qtBaseView class has been split into qtBaseView and qtBaseAttributeView.
All of the existing qtBaseView subclasses now instead inherit qtBaseAttributeView.
* The displayItem test now calls 2 new methods categoryTest and advanceLevelTest. This makes it easier for derived classes to override the filtering behavior
### Changes to qtAnalysisView
......
......@@ -86,7 +86,7 @@ qtBaseView* qtSurfaceExtractorView::createViewWidget(const ViewInfo& info)
}
qtSurfaceExtractorView::qtSurfaceExtractorView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtSurfaceExtractorViewInternals;
this->Internals->ExtractorWidget = NULL; // new imageFeatureExtractorWidget();
......@@ -285,7 +285,7 @@ void qtSurfaceExtractorView::operationSelected(const smtk::operation::OperationP
void qtSurfaceExtractorView::showAdvanceLevelOverlay(bool show)
{
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
void qtSurfaceExtractorView::requestModelEntityAssociation()
......
......@@ -15,13 +15,13 @@
#ifndef qtSurfaceExtractorView_h
#define qtSurfaceExtractorView_h
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
class qtSurfaceExtractorViewInternals;
class qtSurfaceExtractorView : public smtk::extension::qtBaseView
class qtSurfaceExtractorView : public smtk::extension::qtBaseAttributeView
{
Q_OBJECT
......
......@@ -390,7 +390,9 @@ void pqSMTKOperationPanel::operationListDoubleClicked(QListWidgetItem* item)
{
if (opInstance->configure(nullptr, params->associations()))
{
auto baseView = m_attrUIMgr ? m_attrUIMgr->topView() : nullptr;
auto baseView =
dynamic_cast<smtk::extension::qtBaseAttributeView*>(
m_attrUIMgr ? m_attrUIMgr->topView() : nullptr);
if (baseView)
{
baseView->attributeChanged(opInstance->parameters());
......
......@@ -289,6 +289,10 @@ void pqSMTKResourceBrowser::activeViewChanged(pqView* view)
for (auto rsrcPhrase : rsrcPhrases)
{
auto rsrc = rsrcPhrase->relatedResource();
if (!rsrc)
{
continue;
}
auto pvr = behavior->getPVResource(rsrc);
auto rep = pvr ? pvr->getRepresentation(view) : nullptr;
// TODO: At a minimum, we can update the representation's visibility now
......
......@@ -14,11 +14,14 @@
#include "smtk/extension/qt/qtDescriptivePhraseModel.h"
#include "smtk/view/ResourcePhraseModel.h"
#include "smtk/view/RGGPhraseModel.h"
pqSMTKResourcePanel::pqSMTKResourcePanel(QWidget* parent)
: Superclass(parent)
{
auto phraseModel = smtk::view::ResourcePhraseModel::create();
//auto phraseModel = smtk::view::ResourcePhraseModel::create();
const smtk::view::View::Component x;
auto phraseModel = smtk::view::RGGPhraseModel::create(x);
std::string modelViewName = "";
auto qtPhraseModel = new smtk::extension::qtDescriptivePhraseModel;
// NB: We could call
......
......@@ -131,7 +131,7 @@ public:
};
smtkAssignColorsView::smtkAssignColorsView(const OperationViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new smtkAssignColorsViewInternals;
this->Internals->CurrentOp = info.m_operator;
......@@ -148,7 +148,7 @@ bool smtkAssignColorsView::displayItem(smtk::attribute::ItemPtr item)
{
return false;
}
return this->qtBaseView::displayItem(item);
return this->qtBaseAttributeView::displayItem(item);
}
qtBaseView* smtkAssignColorsView::createViewWidget(const ViewInfo& info)
......
......@@ -23,7 +23,7 @@ class QColor;
class QIcon;
class smtkAssignColorsViewInternals;
class SMTKPQOPERATIONVIEWSEXT_EXPORT smtkAssignColorsView : public smtk::extension::qtBaseView
class SMTKPQOPERATIONVIEWSEXT_EXPORT smtkAssignColorsView : public smtk::extension::qtBaseAttributeView
{
Q_OBJECT
......
......@@ -11,20 +11,20 @@
#define smtk_extension_paraview_operators_smtkModelIOView_h
#include "smtk/extension/paraview/operators/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <vtk_jsoncpp.h> // for Json::Value; must be in header due to VTK mangling
class QColor;
class QIcon;
class QMouseEvent;
class SMTKPQOPERATIONVIEWSEXT_EXPORT smtkModelIOView : public smtk::extension::qtBaseView
class SMTKPQOPERATIONVIEWSEXT_EXPORT smtkModelIOView : public smtk::extension::qtBaseAttributeView
{
Q_OBJECT
public:
smtkModelIOView(const smtk::extension::ViewInfo& info)
: smtk::extension::qtBaseView(info)
: smtk::extension::qtBaseAttributeView(info)
{
}
virtual ~smtkModelIOView() {}
......
......@@ -10,6 +10,8 @@
#include "smtk/extension/paraview/widgets/pqSMTKAttributeItemWidget.h"
#include "smtk/extension/paraview/widgets/pqSMTKAttributeItemWidgetP.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/ValueItem.h"
#include "smtk/attribute/ValueItemDefinition.h"
......@@ -255,7 +257,8 @@ void pqSMTKAttributeItemWidget::acceptWidgetValues()
void pqSMTKAttributeItemWidget::createWidget()
{
smtk::attribute::ItemPtr dataObj = this->item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<smtk::extension::qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -276,7 +279,8 @@ void pqSMTKAttributeItemWidget::clearChildWidgets()
void pqSMTKAttributeItemWidget::updateUI()
{
auto dataObj = this->item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<smtk::extension::qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -317,9 +321,9 @@ void pqSMTKAttributeItemWidget::updateUI()
}
QLabel* label = new QLabel(labelText, m_widget);
label->setSizePolicy(sizeFixedPolicy);
if (m_itemInfo.baseView())
if (iview)
{
label->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
label->setFixedWidth(iview->fixedLabelWidth() - padding);
}
label->setWordWrap(true);
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......
......@@ -8,6 +8,7 @@ set(QAttrLibSrcs
qtAttribute.cxx
qtAttributeDisplay.cxx
qtAttributeItemInfo.cxx
qtBaseAttributeView.cxx
qtBaseView.cxx
qtCategorySelectorView.cxx
qtCheckItemComboBox.cxx
......@@ -76,6 +77,7 @@ set(QAttrLibMocHeaders
qtUIManager.h
qtAttribute.h
qtAttributeDisplay.h
qtBaseAttributeView.h
qtBaseView.h
qtCategorySelectorView.h
qtCheckItemComboBox.h
......
......@@ -45,7 +45,7 @@ qtBaseView* qtAnalysisView::createViewWidget(const ViewInfo& info)
}
qtAnalysisView::qtAnalysisView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
}
......
......@@ -13,7 +13,7 @@
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <set>
......@@ -41,14 +41,14 @@
* AnalysisAttributeName is the name of the Attribute the view will create to represent the
* Analysis (if needed)
*
* \sa qtBaseView
* \sa qtBaseAttributeView
*/
namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtAnalysisView : public qtBaseView
class SMTKQTEXT_EXPORT qtAnalysisView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -114,7 +114,7 @@ qtBaseView* qtAssociationView::createViewWidget(const ViewInfo& info)
}
qtAssociationView::qtAssociationView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtAssociationViewInternals;
}
......@@ -282,7 +282,7 @@ void qtAssociationView::getAllDefinitions()
}
this->Internals->m_attCompMap[defName] = attsComp.child(i);
this->qtBaseView::getDefinitions(attDef, this->Internals->AllDefs);
this->qtBaseAttributeView::getDefinitions(attDef, this->Internals->AllDefs);
this->Internals->m_attDefinitions.push_back(attDef);
}
......
......@@ -16,7 +16,7 @@
#define __smtk_extension_qtAssociationView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <QMap>
#include <QModelIndex>
......@@ -46,7 +46,7 @@ namespace extension
* </View>
*
*/
class SMTKQTEXT_EXPORT qtAssociationView : public qtBaseView
class SMTKQTEXT_EXPORT qtAssociationView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -9,7 +9,7 @@
//=========================================================================
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtUIManager.h"
#include "smtk/attribute/Attribute.h"
......@@ -111,17 +111,18 @@ void qtAttribute::createWidget()
int numShowItems = 0;
std::size_t i, n = att->numberOfItems();
if (m_internals->m_view)
auto iview = dynamic_cast<qtBaseAttributeView*>(m_internals->m_view.data());
if (iview)
{
for (i = 0; i < n; i++)
{
if (m_internals->m_view->displayItem(att->item(static_cast<int>(i))))
if (iview->displayItem(att->item(static_cast<int>(i))))
{
numShowItems++;
}
}
// also check associations
if (m_internals->m_view->displayItem(att->associations()))
if (iview->displayItem(att->associations()))
{
numShowItems++;
}
......
......@@ -260,6 +260,7 @@ void qtAttributeRefItem::createWidget()
return;
}
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
QGridLayout* thisLayout = new QGridLayout(m_widget);
thisLayout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
thisLayout->setContentsMargins(0, 0, 0, 0);
......@@ -313,7 +314,7 @@ void qtAttributeRefItem::createWidget()
QString lText = item->label().c_str();
this->Internals->theLabel = new QLabel(lText, m_widget);
this->Internals->theLabel->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
this->Internals->theLabel->setFixedWidth(iview->fixedLabelWidth() - padding);
this->Internals->theLabel->setSizePolicy(sizeFixedPolicy);
this->Internals->theLabel->setWordWrap(true);
this->Internals->theLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......@@ -440,7 +441,11 @@ void qtAttributeRefItem::setOutputOptional(int state)
{
item->setIsEnabled(enable);
emit this->modified();
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
}
}
......@@ -456,6 +461,11 @@ void qtAttributeRefItem::onInputValueChanged()
void qtAttributeRefItem::refreshUI(QComboBox* comboBox)
{
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (!iview)
{
return;
}
int curIdx = comboBox->currentIndex();
int elementIdx = comboBox->property("ElementIndex").toInt();
......@@ -470,7 +480,7 @@ void qtAttributeRefItem::refreshUI(QComboBox* comboBox)
if (curIdx == comboBox->count() - 1) // create New attribute
{
QList<smtk::attribute::DefinitionPtr> AllDefs;
m_itemInfo.baseView()->getDefinitions(attDef, AllDefs);
iview->getDefinitions(attDef, AllDefs);
QList<QString> defTypes;
QList<QString> defLabels;
foreach (smtk::attribute::DefinitionPtr aDef, AllDefs)
......@@ -566,13 +576,13 @@ void qtAttributeRefItem::refreshUI(QComboBox* comboBox)
if (!currentAtt)
{
int currentLen = m_itemInfo.baseView()->fixedLabelWidth();
int currentLen = iview->fixedLabelWidth();
int tmpLen = m_itemInfo.uiManager()->getWidthOfAttributeMaxLabel(
attPtr->definition(), m_itemInfo.uiManager()->advancedFont());
m_itemInfo.baseView()->setFixedLabelWidth(tmpLen);
iview->setFixedLabelWidth(tmpLen);
smtk::view::View::Component comp; // currently not used
currentAtt = new qtAttribute(attPtr, comp, m_widget, m_itemInfo.baseView());
m_itemInfo.baseView()->setFixedLabelWidth(currentLen);
iview->setFixedLabelWidth(currentLen);
if (currentAtt->widget())
{
QBoxLayout* mylayout =
......@@ -604,6 +614,6 @@ void qtAttributeRefItem::refreshUI(QComboBox* comboBox)
if (valChanged)
{
emit this->modified();
m_itemInfo.baseView()->valueChanged(item);
iview->valueChanged(item);
}
}
......@@ -144,7 +144,7 @@ qtBaseView* qtAttributeView::createViewWidget(const ViewInfo& info)
}
qtAttributeView::qtAttributeView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtAttributeViewInternals;
smtk::view::ViewPtr view = this->getObject();
......@@ -1441,7 +1441,7 @@ void qtAttributeView::getAllDefinitions()
}
this->Internals->m_attCompMap[defName] = attsComp.child(i);
this->qtBaseView::getDefinitions(attDef, this->Internals->AllDefs);
this->qtBaseAttributeView::getDefinitions(attDef, this->Internals->AllDefs);
this->Internals->m_attDefinitions.push_back(attDef);
}
......@@ -1510,7 +1510,7 @@ void qtAttributeView::showAdvanceLevelOverlay(bool show)
{
this->Internals->CurrentAtt->showAdvanceLevelOverlay(show);
}
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
bool qtAttributeView::isEmpty() const
......
......@@ -16,7 +16,7 @@
#define __smtk_extension_qtAttributeView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <QMap>
#include <QModelIndex>
......@@ -31,7 +31,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtAttributeView : public qtBaseView
class SMTKQTEXT_EXPORT qtAttributeView : public qtBaseAttributeView
{
Q_OBJECT
......
This diff is collapsed.
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
// .NAME qtBaseAttributeView - a base class for all view types
// .SECTION Description
#ifndef smtk_extension_qtBaseAttributeView_h
#define smtk_extension_qtBaseAttributeView_h
#include "smtk/extension/qt/qtBaseView.h"
class qtBaseAttributeViewInternals;
class QScrollArea;
namespace smtk
{
namespace extension
{
class qtUIManager;
class qtItem;
class qtViewInfoDialog;
class SMTKQTEXT_EXPORT qtBaseAttributeView : public qtBaseView
{
Q_OBJECT
public:
qtBaseAttributeView(const ViewInfo& info);
~qtBaseAttributeView() override;
void setInitialCategory() override;
/// Determines if an item should be displayed
virtual bool displayItem(smtk::attribute::ItemPtr);
virtual void getDefinitions(
smtk::attribute::DefinitionPtr attDef, QList<smtk::attribute::DefinitionPtr>& defs);
int fixedLabelWidth() { return m_fixedLabelWidth; }
bool setFixedLabelWidth(int w);
bool advanceLevelVisible() { return m_advOverlayVisible; }
bool useSelectionManager() const { return m_useSelectionManager; }
int advanceLevel() override;
bool categoryEnabled() override;
std::string currentCategory() override;
void setTopLevelCategories(const std::set<std::string>& categories) override;
//Returns true if the view does not contain any information to display - the default
// behavior is to return false
bool isEmpty() const override;
signals:
void modified(smtk::attribute::ItemPtr);
public slots:
void updateUI() override
{
this->updateAttributeData();
this->updateModelAssociation();
this->showAdvanceLevelOverlay(m_advOverlayVisible);
}
virtual void updateModelAssociation() { ; }
virtual void valueChanged(smtk::attribute::ItemPtr);
/// Invoke the Signal dummy operation to indicate an attribute has been created.
virtual void attributeCreated(const smtk::attribute::AttributePtr&);
/// Invoke the Signal dummy operation to indicate an attribute has been changed (renamed).
virtual void attributeChanged(const smtk::attribute::AttributePtr&);
/// Invoke the Signal dummy operation to indicate an attribute has been removed.
virtual void attributeRemoved(const smtk::attribute::AttributePtr&);
void showAdvanceLevel(int i) override;
void enableShowBy(int /* enable */) override;
void onInfo() override;
virtual void requestModelEntityAssociation() { ; }
protected slots:
virtual void updateAttributeData() { ; }
virtual void onAdvanceLevelChanged(int levelIdx);
protected:
/// Create the UI related to the view and assigns it to the parent widget.
void buildUI() override;
/// Adds properties associated with respects to a top level view
void makeTopLevel() override;
/// \brief Test for category filtering.
/// Returns true if the item's categories pass
virtual bool categoryTest(smtk::attribute::ItemPtr);
/// \brief Test for advance level filtering.
/// Returns true if the item's advance level pass
virtual bool advanceLevelTest(smtk::attribute::ItemPtr);
QScrollArea* m_ScrollArea;
bool m_topLevelInitialized;
private:
int m_fixedLabelWidth;
qtBaseAttributeViewInternals* Internals;
}; // class
} // namespace attribute
} // namespace smtk
#endif
This diff is collapsed.
......@@ -10,8 +10,8 @@
// .NAME qtBaseView - a base class for all view types
// .SECTION Description
#ifndef __smtk_extension_qtBaseView_h
#define __smtk_extension_qtBaseView_h
#ifndef smtk_extension_qtBaseView_h
#define smtk_extension_qtBaseView_h
#include <QtCore/QList>
#include <QtCore/QObject>
......@@ -22,7 +22,6 @@
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtViewInfoDialog.h"
class qtBaseViewInternals;
class QScrollArea;
namespace smtk
......@@ -75,76 +74,45 @@ public:
QWidget* parentWidget() const { return m_viewInfo.m_parent; }
qtUIManager* uiManager() const { return m_viewInfo.m_UIManager; }
// Description:
// Determines if an item should be displayed
virtual bool displayItem(smtk::attribute::ItemPtr);
virtual void getDefinitions(
smtk::attribute::DefinitionPtr attDef, QList<smtk::attribute::DefinitionPtr>& defs);
int fixedLabelWidth() { return m_fixedLabelWidth; }
bool setFixedLabelWidth(int w);
bool advanceLevelVisible() { return m_advOverlayVisible; }
bool useSelectionManager() const { return m_useSelectionManager; }
virtual int advanceLevel();
virtual bool categoryEnabled();
virtual std::string currentCategory();
virtual int advanceLevel() { return 0; }
virtual bool categoryEnabled() { return false; }
virtual std::string currentCategory() { return ""; }
// When category filtering is requested to be either on by default or is requested to be
// on permanently, we need to have a mechanism to force the views to display info based on
// the initial category. This method will check to see if this is the case and call the
// onShowCategory method
void setInitialCategory();
virtual void setInitialCategory() { ; }
bool isTopLevel() const { return m_isTopLevel; }
void setTopLevelCategories(const std::set<std::string>& categories);
virtual void setTopLevelCategories(const std::set<std::string>& categories) { ; }
//Returns true if the view does not contain any information to display - the default
// behavior is to return false
virtual bool isEmpty() const;
/// Return true if the view does not contain any information to display.
/// Subclasses should override this method and return false by default
/// unless they have specific knowledge that the view is vacuous.
virtual bool isEmpty() const { return true; }
signals:
void modified(smtk::attribute::ItemPtr);
void aboutToDestroy();
public slots:
virtual void updateUI()
{
this->updateAttributeData();
this->updateModelAssociation();
this->showAdvanceLevelOverlay(m_advOverlayVisible);
}
virtual void updateModelAssociation() { ; }
virtual void valueChanged(smtk::attribute::ItemPtr);
/// Invoke the Signal dummy operation to indicate an attribute has been created.
virtual void attributeCreated(const smtk::attribute::AttributePtr&);
/// Invoke the Signal dummy operation to indicate an attribute has been changed (renamed).
virtual void attributeChanged(const smtk::attribute::AttributePtr&);
/// Invoke the Signal dummy operation to indicate an attribute has been removed.
virtual void attributeRemoved(const smtk::attribute::AttributePtr&);
virtual void updateUI() { ; }
virtual void childrenResized() { ; }
virtual void showAdvanceLevelOverlay(bool val) { m_advOverlayVisible = val; }
virtual void showAdvanceLevel(int i);
virtual void updateViewUI(int /* currentTab */) {}
virtual void enableShowBy(int /* enable */);
virtual void onInfo(); /* for displaying View Information */
virtual void showAdvanceLevel(int /* level */) { ; }
virtual void updateViewUI(int /* currentTab */) { ; }
virtual void enableShowBy(int /* enable */) { ; }
/// Display view information (i.e., help text)
virtual void onInfo();
virtual void onShowCategory() {}
virtual void requestModelEntityAssociation() { ; }
protected slots:
virtual void updateAttributeData() { ; }
virtual void onAdvanceLevelChanged(int levelIdx);
protected:
// Description:
// Creates the UI related to the view and properly assigns it
// to the parent widget.
virtual void buildUI();
// Description:
// Creates the main QT Widget that is associated with a View. Typically this
// is the only method a derived View needs to override.
virtual void createWidget() {}
/// Creates the UI related to the view and properly assigns it
/// to the parent widget.
virtual void buildUI() { ; }
/// Creates the main QT Widget that is associated with a View. Typically this
/// is the only method a derived View needs to override.
virtual void createWidget() { ; }
// Description:
// Adds properties associated with respects to a top level view
......@@ -154,29 +122,15 @@ protected:
// Set the information to be displayed in the ViewInfoDialog
virtual void setInfoToBeDisplayed();
/// \brief Test for category filtering.
/// Returns true if the item's categories pass
virtual bool categoryTest(smtk::attribute::ItemPtr);
/// \brief Test for advance level filtering.
/// Returns true if the item's advance level pass
virtual bool advanceLevelTest(smtk::attribute::ItemPtr);
QWidget* Widget;
QScrollArea* m_ScrollArea;
bool m_isTopLevel;
bool m_topLevelInitialized;
bool m_useSelectionManager;
ViewInfo m_viewInfo;
QPointer<qtViewInfoDialog> m_infoDialog;
private:
bool m_advOverlayVisible;
int m_fixedLabelWidth;
qtBaseViewInternals* Internals;
}; // class
}; // namespace attribute
}; // namespace smtk
} // namespace attribute
} // namespace smtk
#endif
......@@ -55,7 +55,7 @@ qtBaseView* qtCategorySelectorView::createViewWidget(const ViewInfo& info)
}
qtCategorySelectorView::qtCategorySelectorView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtCategorySelectorViewInternals;
}
......@@ -216,7 +216,7 @@ void qtCategorySelectorView::onShowCategory()
this->Internals->m_viewCategories.at(i) == currentCategory);
this->Internals->ChildViews.at(i)->onShowCategory();
}
this->qtBaseView::onShowCategory();
this->qtBaseAttributeView::onShowCategory();
}
void qtCategorySelectorView::showAdvanceLevelOverlay(bool show)
......@@ -225,13 +225,17 @@ void qtCategorySelectorView::showAdvanceLevelOverlay(bool show)
{
childView->showAdvanceLevelOverlay(show);
}
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
void qtCategorySelectorView::updateModelAssociation()
{
foreach (qtBaseView* childView, this->Internals->ChildViews)
{
childView->updateModelAssociation();
auto iview = dynamic_cast<qtBaseAttributeView*>(childView);
if (iview)
{
iview->updateModelAssociation();
}
}
}
......@@ -12,7 +12,7 @@
#define __smtk_extension_qtCategorySelectorView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
/**\brief Provides the QT UI for a Category-based Selection View.
*
......@@ -43,7 +43,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtCategorySelectorView : public qtBaseView
class SMTKQTEXT_EXPORT qtCategorySelectorView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -10,7 +10,7 @@
#include "smtk/extension/qt/qtDateTimeItem.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtOverlay.h"
#include "smtk/extension/qt/qtTimeZoneSelectWidget.h"
#include "smtk/extension/qt/qtUIManager.h"
......@@ -253,9 +253,10 @@ void qtDateTimeItem::setOutputOptional(int state)
if (enable != item->isEnabled())
{
item->setIsEnabled(enable);
if (m_itemInfo.baseView())
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
m_itemInfo.baseView()->valueChanged(item);
iview->valueChanged(item);
}
emit this->modified();
}
......@@ -344,7 +345,8 @@ void qtDateTimeItem::onTimeZoneRegion()
void qtDateTimeItem::createWidget()
{
smtk::attribute::ItemPtr dataObj = m_itemInfo.item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -372,7 +374,8 @@ void qtDateTimeItem::loadInputValues()
void qtDateTimeItem::updateUI()
{
auto dataObj = m_itemInfo.itemAs<smtk::attribute::DateTimeItem>();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -417,9 +420,9 @@ void qtDateTimeItem::updateUI()
}
QLabel* label = new QLabel(labelText, m_widget);
label->setSizePolicy(sizeFixedPolicy);
if (m_itemInfo.baseView())
if (iview)
{
label->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
label->setFixedWidth(iview->fixedLabelWidth() - padding);
}
label->setWordWrap(true);
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......
......@@ -515,7 +515,10 @@ QIcon qtDescriptivePhraseModel::lookupIconForPhraseFlags(
auto meshComp = dynamic_pointer_cast<smtk::mesh::Component>(item->relatedComponent());
std::ostringstream resourceName;
resourceName << ":/icons/entityTypes/";
if (item->phraseType() == smtk::view::DescriptivePhraseType::COMPONENT_LIST)
if (
item->phraseType() == smtk::view::DescriptivePhraseType::COMPONENT_LIST ||
item->phraseType() == smtk::view::DescriptivePhraseType::LIST
)
{
resourceName << "list" << (lightness >= 0.179 ? "_b" : "_w");
}
......
......@@ -23,7 +23,7 @@
#include "smtk/attribute/ValueItem.h"
#include "smtk/attribute/ValueItemDefinition.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtUIManager.h"
using namespace smtk::extension;
......@@ -257,12 +257,17 @@ void qtDiscreteValueEditor::updateContents()
}
}
int currentLen = this->Internals->m_inputItem->m_itemInfo.baseView()->fixedLabelWidth();
auto iiview = dynamic_cast<qtBaseAttributeView*>(
this->Internals->m_inputItem->m_itemInfo.baseView().data());
int currentLen = iiview ? iiview->fixedLabelWidth() : 0;
if (this->Internals->m_inputItem->uiManager())
{
int tmpLen = this->Internals->m_inputItem->uiManager()->getWidthOfItemsMaxLabel(
activeChildDefs, this->Internals->m_inputItem->uiManager()->advancedFont());
this->Internals->m_inputItem->m_itemInfo.baseView()->setFixedLabelWidth(tmpLen);
if (iiview)
{
iiview->setFixedLabelWidth(tmpLen);
}
}
for (i = 0; i < m; i++)
......@@ -294,7 +299,10 @@ void qtDiscreteValueEditor::updateContents()
}
}
this->Internals->m_inputItem->m_itemInfo.baseView()->setFixedLabelWidth(currentLen);
if (iiview)
{
iiview->setFixedLabelWidth(currentLen);
}
this->Internals->m_hintChildWidth = this->Internals->m_childrenFrame->width();
this->Internals->m_hintChildHeight = this->Internals->m_childrenFrame->height();
if (this->Internals->m_childrenLayout)
......
......@@ -10,7 +10,7 @@
#include "smtk/extension/qt/qtFileItem.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtOverlay.h"
#include "smtk/extension/qt/qtUIManager.h"
......@@ -421,7 +421,11 @@ void qtFileItem::onInputValueChanged()
{
this->updateFileComboList(editBox->text());
}
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
if (fSystemItemDef->isValueValid(item->value(elementIdx)))
{
......@@ -557,7 +561,8 @@ void qtFileItem::setInputValue(const QString& val)
void qtFileItem::createWidget()
{
smtk::attribute::ItemPtr dataObj = m_itemInfo.item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -697,8 +702,9 @@ void qtFileItem::loadInputValues()
void qtFileItem::updateUI()
{
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
auto dataObj = m_itemInfo.itemAs<FileSystemItem>();
if (!m_itemInfo.baseView()->displayItem(dataObj))
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -743,9 +749,9 @@ void qtFileItem::updateUI()
}
QLabel* label = new QLabel(labelText, m_widget);
label->setSizePolicy(sizeFixedPolicy);
if (m_itemInfo.baseView())
if (iview)
{
label->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
label->setFixedWidth(iview->fixedLabelWidth() - padding);
}
label->setWordWrap(true);
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......@@ -824,9 +830,10 @@ void qtFileItem::setOutputOptional(int state)
{
item->setIsEnabled(enable);
emit this->modified();
if (m_itemInfo.baseView())
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
m_itemInfo.baseView()->valueChanged(item);
iview->valueChanged(item);
}
}
}
......
......@@ -12,7 +12,7 @@
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtAttributeRefItem.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtTableWidget.h"
#include "smtk/extension/qt/qtUIManager.h"
......@@ -154,7 +154,11 @@ void qtGroupItem::setEnabledState(bool checked)
{
item->setIsEnabled(checked);
emit this->modified();
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
}
}
......@@ -256,6 +260,11 @@ void qtGroupItem::addSubGroup(int i)
{
return;
}
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (!iview)
{
return;
}
const std::size_t numItems = item->numberOfItemsPerGroup();
QBoxLayout* frameLayout = qobject_cast<QBoxLayout*>(this->Internals->ChildrensFrame->layout());
......@@ -292,8 +301,8 @@ void qtGroupItem::addSubGroup(int i)
}
const int tmpLen = m_itemInfo.uiManager()->getWidthOfItemsMaxLabel(
childDefs, m_itemInfo.uiManager()->advancedFont());
const int currentLen = m_itemInfo.baseView()->fixedLabelWidth();
m_itemInfo.baseView()->setFixedLabelWidth(tmpLen);
const int currentLen = iview->fixedLabelWidth();
iview->setFixedLabelWidth(tmpLen);
for (std::size_t j = 0; j < numItems; j++)
{
......@@ -320,7 +329,7 @@ void qtGroupItem::addSubGroup(int i)
connect(childItem, SIGNAL(modified()), this, SLOT(onChildItemModified()));
}
}
m_itemInfo.baseView()->setFixedLabelWidth(currentLen);
iview->setFixedLabelWidth(currentLen);
frameLayout->addWidget(subGroupFrame);
this->onChildWidgetSizeChanged();
}
......
......@@ -153,7 +153,7 @@ qtBaseView* qtGroupView::createViewWidget(const ViewInfo& info)
}
qtGroupView::qtGroupView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtGroupViewInternals;
}
......@@ -495,7 +495,11 @@ void qtGroupView::updateModelAssociation()
{
foreach (qtBaseView* childView, this->Internals->m_ChildViews)
{
childView->updateModelAssociation();
auto iview = dynamic_cast<qtBaseAttributeView*>(childView);
if (iview)
{
iview->updateModelAssociation();
}
}
}
......
......@@ -10,13 +10,13 @@
// .NAME qtGroupView - UI components for Group View
// .SECTION Description
// .SECTION See Also
// qtBaseView
// qtBaseAttributeView
#ifndef __smtk_extension_qtGroupView_h
#define __smtk_extension_qtGroupView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
class qtGroupViewInternals;
......@@ -24,7 +24,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtGroupView : public qtBaseView
class SMTKQTEXT_EXPORT qtGroupView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -11,7 +11,7 @@
#include "smtk/extension/qt/qtInputsItem.h"
#include "smtk/attribute/Definition.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtDiscreteValueEditor.h"
#include "smtk/extension/qt/qtDoubleLineEdit.h"
#include "smtk/extension/qt/qtOverlay.h"
......@@ -186,7 +186,11 @@ void qtInputsItem::unsetValue(int elementIndex)
{
item->unset(elementIndex);
emit modified();
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
}
}
......@@ -204,7 +208,11 @@ bool qtInputsItem::setDiscreteValue(int elementIndex, int discreteValIndex)
else if (item->setDiscreteIndex(elementIndex, discreteValIndex))
{
emit this->modified();
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
return true;
}
return false;
......@@ -214,7 +222,11 @@ void qtInputsItem::forceUpdate()
{
auto item = m_itemInfo.itemAs<ValueItem>();
emit this->modified();
m_itemInfo.baseView()->valueChanged(item);
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
iview->valueChanged(item);
}
}
void qtInputsItem::setLabelVisible(bool visible)
......@@ -225,7 +237,8 @@ void qtInputsItem::setLabelVisible(bool visible)
void qtInputsItem::createWidget()
{
smtk::attribute::ItemPtr dataObj = m_itemInfo.item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -368,7 +381,8 @@ void qtInputsItem::loadInputValues()
void qtInputsItem::updateUI()
{
smtk::attribute::ValueItemPtr dataObj = m_itemInfo.itemAs<ValueItem>();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -413,9 +427,9 @@ void qtInputsItem::updateUI()
}
QLabel* label = new QLabel(labelText, m_widget);
label->setSizePolicy(sizeFixedPolicy);
if (m_itemInfo.baseView())
if (iview)
{
label->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
label->setFixedWidth(iview->fixedLabelWidth() - padding);
}
label->setWordWrap(true);
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......@@ -506,9 +520,10 @@ void qtInputsItem::setOutputOptional(int state)
if (enable != item->isEnabled())
{
item->setIsEnabled(enable);
if (m_itemInfo.baseView())
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
m_itemInfo.baseView()->valueChanged(item);
iview->valueChanged(item);
}
emit this->modified();
}
......@@ -877,10 +892,10 @@ void qtInputsItem::onExpressionReferenceChanged()
inputitem->unset(elementIdx);
}
qtBaseView* bview = m_itemInfo.baseView();
if (bview)
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview)
{
bview->valueChanged(inputitem->shared_from_this());
iview->valueChanged(inputitem->shared_from_this());
}
emit this->modified();
}
......@@ -1260,18 +1275,18 @@ void qtInputsItem::doubleValueChanged(double newVal)
// Lets determine if the item is set to the default value -
isDefault = ditem->isUsingDefault(elementIdx);
isInvalid = !ditem->isSet(elementIdx);
qtBaseView* bview = m_itemInfo.baseView();
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (valChanged)
{
if (bview != NULL)
if (iview)
{
bview->valueChanged(ditem);
iview->valueChanged(ditem);
}
emit this->modified();
}
if (bview != NULL)
if (iview)
{
qtUIManager* uimanager = bview->uiManager();
qtUIManager* uimanager = iview->uiManager();
isDefault ? uimanager->setWidgetColorToDefault(senderWidget)
: (isInvalid ? uimanager->setWidgetColorToInvalid(senderWidget)
: uimanager->setWidgetColorToNormal(senderWidget));
......@@ -1302,18 +1317,18 @@ void qtInputsItem::intValueChanged(int newVal)
// Lets determine if the item is set to the default value -
isDefault = iitem->isUsingDefault(elementIdx);
isInvalid = !iitem->isSet(elementIdx);
qtBaseView* bview = m_itemInfo.baseView();
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (valChanged)
{
if (bview != NULL)
if (iview)
{
bview->valueChanged(iitem);
iview->valueChanged(iitem);
}
emit this->modified();
}
if (bview != NULL)
if (iview)
{
qtUIManager* uimanager = bview->uiManager();
qtUIManager* uimanager = iview->uiManager();
isDefault ? uimanager->setWidgetColorToDefault(senderWidget)
: (isInvalid ? uimanager->setWidgetColorToInvalid(senderWidget)
: uimanager->setWidgetColorToNormal(senderWidget));
......@@ -1414,18 +1429,18 @@ void qtInputsItem::onInputValueChanged(QObject* obj)
// Lets determine if the item is set to the default value -
isDefault = rawitem->isUsingDefault(elementIdx);
isInvalid = !rawitem->isSet(elementIdx);
qtBaseView* bview = m_itemInfo.baseView();
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (valChanged)
{
if (bview != NULL)
if (iview)
{
bview->valueChanged(rawitem->shared_from_this());
iview->valueChanged(rawitem->shared_from_this());
}
emit this->modified();
}
if (bview != NULL)
if (iview)
{
qtUIManager* uimanager = bview->uiManager();
qtUIManager* uimanager = iview->uiManager();
isDefault ? uimanager->setWidgetColorToDefault(inputBox)
: (isInvalid ? uimanager->setWidgetColorToInvalid(inputBox)
: uimanager->setWidgetColorToNormal(inputBox));
......
......@@ -12,8 +12,8 @@
// .SECTION See Also
// qtItem
#ifndef __smtk_extension_qtInputsItem_h
#define __smtk_extension_qtInputsItem_h
#ifndef smtk_extension_qtInputsItem_h
#define smtk_extension_qtInputsItem_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtItem.h"
......
......@@ -48,7 +48,7 @@ qtBaseView* qtInstancedView::createViewWidget(const ViewInfo& info)
}
qtInstancedView::qtInstancedView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtInstancedViewInternals;
}
......@@ -196,7 +196,7 @@ void qtInstancedView::showAdvanceLevelOverlay(bool show)
att->showAdvanceLevelOverlay(show);
}
}
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
bool qtInstancedView::isValid() const
......
......@@ -16,7 +16,7 @@
#define __smtk_extension_qtInstancedView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
class qtInstancedViewInternals;
class QScrollArea;
......@@ -25,7 +25,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtInstancedView : public qtBaseView
class SMTKQTEXT_EXPORT qtInstancedView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -192,7 +192,7 @@ qtBaseView* qtModelEntityAttributeView::createViewWidget(const ViewInfo& info)
}
qtModelEntityAttributeView::qtModelEntityAttributeView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtModelEntityAttributeViewInternals;
}
......@@ -210,7 +210,7 @@ qtModelEntityAttributeView::~qtModelEntityAttributeView()
void qtModelEntityAttributeView::buildUI()
{
this->qtBaseView::buildUI();
this->qtBaseAttributeView::buildUI();
std::ostringstream receiverSource;
receiverSource << "qtModelEntityAttributeView" << this;
this->Internals->m_selectionSourceName = receiverSource.str();
......@@ -715,7 +715,7 @@ void qtModelEntityAttributeView::getAllDefinitions()
continue;
}
this->Internals->m_attCompMap[defName] = attsComp.child(i);
this->qtBaseView::getDefinitions(attDef, this->Internals->AllDefs);
this->qtBaseAttributeView::getDefinitions(attDef, this->Internals->AllDefs);
this->Internals->m_attDefinitions.push_back(attDef);
}
......
......@@ -16,7 +16,7 @@
#define __smtk_extension_qtModelEntityAttributeView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <QMap>
#include <QModelIndex>
......@@ -51,7 +51,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtModelEntityAttributeView : public qtBaseView
class SMTKQTEXT_EXPORT qtModelEntityAttributeView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -11,6 +11,7 @@
#include "smtk/extension/qt/qtModelOperationWidget.h"
#include "smtk/extension/qt/qtActiveObjects.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtAttribute.h"
#include "smtk/extension/qt/qtCollapsibleGroupWidget.h"
#include "smtk/extension/qt/qtInstancedView.h"
......@@ -267,7 +268,11 @@ bool qtModelOperationWidget::checkExistingOperation(const std::string& opName)
// if the operator is already created, just set its UI to be current widget
if (this->Internals->OperationMap.contains(opName))
{
this->Internals->OperationMap[opName].opUiView->requestModelEntityAssociation();
auto iview = dynamic_cast<qtBaseAttributeView*>(this->Internals->OperationMap[opName].opUiView.data());
if (iview)
{
iview->requestModelEntityAssociation();
}
this->Internals->OperationsLayout->setCurrentWidget(
this->Internals->OperationMap[opName].opUiParent);
return true;
......
......@@ -63,7 +63,7 @@ qtBaseView* qtOperationView::createViewWidget(const ViewInfo& info)
}
qtOperationView::qtOperationView(const OperationViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
, m_applied(false)
{
this->Internals = new qtOperationViewInternals;
......@@ -190,7 +190,7 @@ void qtOperationView::onModifiedParameter(qtItem* uiItem)
void qtOperationView::showAdvanceLevelOverlay(bool show)
{
this->Internals->m_instancedView->showAdvanceLevelOverlay(show);
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
void qtOperationView::requestModelEntityAssociation()
......
......@@ -18,7 +18,7 @@
#include "smtk/operation/Operation.h"
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include <QPointer>
#include <QThread>
......@@ -51,7 +51,7 @@ public:
smtk::operation::OperationPtr m_operator;
};
class SMTKQTEXT_EXPORT qtOperationView : public qtBaseView
class SMTKQTEXT_EXPORT qtOperationView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -10,7 +10,7 @@
#include "smtk/extension/qt/qtReferenceItem.h"
#include "smtk/extension/qt/qtReferenceItemData.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
#include "smtk/extension/qt/qtOverlay.h"
#include "smtk/extension/qt/qtTypeDeclarations.h"
#include "smtk/extension/qt/qtUIManager.h"
......@@ -369,7 +369,8 @@ smtk::view::PhraseModelPtr qtReferenceItem::createPhraseModel() const
void qtReferenceItem::createWidget()
{
smtk::attribute::ItemPtr dataObj = m_itemInfo.item();
if (!m_itemInfo.baseView()->displayItem(dataObj))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(dataObj))
{
return;
}
......@@ -393,7 +394,8 @@ void qtReferenceItem::clearWidgets()
void qtReferenceItem::updateUI()
{
smtk::attribute::ItemPtr itm = m_itemInfo.item();
if (!m_itemInfo.baseView()->displayItem(itm))
auto iview = dynamic_cast<qtBaseAttributeView*>(m_itemInfo.baseView().data());
if (iview && !iview->displayItem(itm))
{
return;
}
......@@ -472,9 +474,9 @@ void qtReferenceItem::updateUI()
QString labelText = !itm->label().empty() ? itm->label().c_str() : itm->name().c_str();
m_p->m_label = new QLabel(labelText, m_widget);
m_p->m_label->setSizePolicy(sizeFixedPolicy);
if (m_itemInfo.baseView())
if (iview)
{
m_p->m_label->setFixedWidth(m_itemInfo.baseView()->fixedLabelWidth() - padding);
m_p->m_label->setFixedWidth(iview->fixedLabelWidth() - padding);
}
m_p->m_label->setWordWrap(true);
m_p->m_label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
......
......@@ -55,7 +55,7 @@ qtBaseView* qtSelectorView::createViewWidget(const ViewInfo& info)
}
qtSelectorView::qtSelectorView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtSelectorViewInternals;
}
......@@ -290,7 +290,7 @@ void qtSelectorView::onShowCategory()
{
childView->onShowCategory();
}
this->qtBaseView::onShowCategory();
this->qtBaseAttributeView::onShowCategory();
}
void qtSelectorView::showAdvanceLevelOverlay(bool show)
......@@ -299,14 +299,18 @@ void qtSelectorView::showAdvanceLevelOverlay(bool show)
{
childView->showAdvanceLevelOverlay(show);
}
this->qtBaseView::showAdvanceLevelOverlay(show);
this->qtBaseAttributeView::showAdvanceLevelOverlay(show);
}
void qtSelectorView::updateModelAssociation()
{
foreach (qtBaseView* childView, this->Internals->ChildViews)
{
childView->updateModelAssociation();
auto iview = dynamic_cast<qtBaseAttributeView*>(childView);
if (iview)
{
iview->updateModelAssociation();
}
}
}
void qtSelectorView::selectionChanged()
......
......@@ -12,7 +12,7 @@
#define __smtk_extension_qtSelectorView_h
#include "smtk/extension/qt/Exports.h"
#include "smtk/extension/qt/qtBaseView.h"
#include "smtk/extension/qt/qtBaseAttributeView.h"
/**\brief Provides the QT UI for a Selector View.
*
......@@ -46,7 +46,7 @@ namespace smtk
{
namespace extension
{
class SMTKQTEXT_EXPORT qtSelectorView : public qtBaseView
class SMTKQTEXT_EXPORT qtSelectorView : public qtBaseAttributeView
{
Q_OBJECT
......
......@@ -87,7 +87,7 @@ qtBaseView* qtSimpleExpressionView::createViewWidget(const ViewInfo& info)
}
qtSimpleExpressionView::qtSimpleExpressionView(const ViewInfo& info)
: qtBaseView(info)
: qtBaseAttributeView(info)
{
this->Internals = new qtSimpleExpressionViewInternals;
}
......@@ -800,6 +800,6 @@ void qtSimpleExpressionView::getAllDefinitions(QList<smtk::attribute::Definition