Skip to content
Snippets Groups Projects
Commit 43c5b227 authored by andrey.daragan's avatar andrey.daragan
Browse files

Merge branch 'bugs-3222' into 'develop'

Bugs-3222

See merge request !37
parents 64876e9d 50f12dfe
No related branches found
No related tags found
1 merge request!37Bugs-3222
...@@ -3,6 +3,18 @@ import QtQuick.Controls 2.0 ...@@ -3,6 +3,18 @@ import QtQuick.Controls 2.0
DapComboBoxForm DapComboBoxForm
{ {
Component.onCompleted:
{
if(isDefaultNeedToAppend && model.get(0, comboBoxTextRole[0]) !== mainLineText)
{
if(comboBoxTextRole[0] === "name")
model.insert(0, {name: mainLineText});
else if(comboBoxTextRole[0] === "text")
model.insert(0, {text: mainLineText});
currentIndex = 0;
}
}
delegate: delegate:
ItemDelegate ItemDelegate
{ {
......
...@@ -84,6 +84,8 @@ ComboBox ...@@ -84,6 +84,8 @@ ComboBox
property var mainRow: [""] property var mainRow: [""]
//@detalis mainLineText Text without unneccesary part. //@detalis mainLineText Text without unneccesary part.
property string mainLineText property string mainLineText
///@details isDefaultNeedToAppend Sign to add default data to the beginning of model
property bool isDefaultNeedToAppend: false
width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal
...@@ -134,8 +136,9 @@ ComboBox ...@@ -134,8 +136,9 @@ ComboBox
Text Text
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: (popup.visible) ? text: (popup.visible) ?
(index < mainRow.length ? mainRow[index] : ""): (dapComboBox.currentIndex === -1 ? mainLineText : (index < mainRow.length ? mainRow[index] : "") ) :
mainLineText mainLineText
font: popup.visible ? font: popup.visible ?
((fontComboBox.length > index) ? ((fontComboBox.length > index) ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment