diff options
author | Janne Kangas <janne.kangas@qt.io> | 2019-01-07 12:00:21 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-02-18 16:07:33 +0000 |
commit | 86d2fdf89bb159033f9df142b6c98a5c4793f77e (patch) | |
tree | 360b7ce21f6a75b6e372361ecdc34f980c05716f | |
parent | 60015f387e0629b5fa6fc6268ca3cbaaaeb5cc6c (diff) |
Only highlight the properties with nonmatching datainput datatype
In datainput management dialog, highlight only the properties for the
element that has mismatch between property datatype and controlling
datainput type, not for other elements.
Also increase element name field width to avoid clipping.
Change-Id: I0521c98ee55bafedb93d88bf80f75705f9b2c0ce
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/Application/DataInputListDlg.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Authoring/Studio/Application/DataInputListDlg.cpp b/src/Authoring/Studio/Application/DataInputListDlg.cpp index 1a9c1f0b..360d7cc3 100644 --- a/src/Authoring/Studio/Application/DataInputListDlg.cpp +++ b/src/Authoring/Studio/Application/DataInputListDlg.cpp @@ -141,7 +141,7 @@ void CDataInputListDlg::initDialog() m_ui->elementInfo->setFocusPolicy(Qt::NoFocus); m_ui->elementInfo->resizeColumnsToContents(); m_ui->elementInfo->horizontalHeader()->setStretchLastSection(true); - m_ui->elementInfo->horizontalHeader()->setMinimumSectionSize(125); + m_ui->elementInfo->horizontalHeader()->setMinimumSectionSize(140); m_ui->elementInfo->setModel(m_infoContents); m_ui->elementInfo->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); @@ -280,6 +280,7 @@ void CDataInputListDlg::updateInfo() if (m_ui->tableView->selectionModel()->selectedRows(0).size() == 1) { for (auto allCtrldElemsIt = m_dataInputs[m_currentDataInputName]->ctrldElems.begin(); allCtrldElemsIt != m_dataInputs[m_currentDataInputName]->ctrldElems.end();) { + bool typeNotMatching = false; QStandardItem *item = new QStandardItem( g_StudioApp.GetCore()->GetDoc()->GetStudioSystem() ->GetClientDataModelBridge()->GetName( @@ -319,6 +320,13 @@ void CDataInputListDlg::updateInfo() } count++; + + // Check if there is a non-matching datatype binding with one or several + // properties for this element. + if (!CDataInputDlg::getAcceptedTypes(allCtrldElemsIt->dataType.first).contains( + (EDataType)(m_dataInputs[m_currentDataInputName]->type))) { + typeNotMatching = true; + } // Advance main iterator so that after the inner loop we end up // at the start of next instance's batch of controlleditems. allCtrldElemsIt++; @@ -332,10 +340,9 @@ void CDataInputListDlg::updateInfo() QStandardItem *item3 = new QStandardItem(propNames); item3->setToolTip(propNames); item3->setEditable(false); - // If we have warning icon set for this datainput, we have something - // wrong with the property types in this object. Highlight properties - // to provide additional reminder. - if (!m_tableContents->item(m_currentDataInputIndex, 1)->icon().isNull()) { + + // Highlight the entire property name item if a non-match was found. + if (typeNotMatching) { item3->setForeground( QBrush(CStudioPreferences::invalidDataInputIndicatorColor())); static QString warning(tr("\n\nData Input type is not matching with one or " |