Skip to content
Snippets Groups Projects

Features 3048

Merged tatiana.novikova requested to merge features-3048 into develop
3 files
+ 54
22
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 46
18
@@ -55,6 +55,7 @@ DapComboBoxForm
@@ -55,6 +55,7 @@ DapComboBoxForm
)
)
height: rectangleTextComboBox.height
height: rectangleTextComboBox.height
spacing: roleInterval
spacing: roleInterval
 
property var elTextArray: []
Repeater
Repeater
{
{
@@ -77,36 +78,43 @@ DapComboBoxForm
@@ -77,36 +78,43 @@ DapComboBoxForm
horizontalAlignment: (alignTextComboBox.length > index) ?
horizontalAlignment: (alignTextComboBox.length > index) ?
alignTextComboBox[index] :
alignTextComboBox[index] :
alignTextComboBox[0];
alignTextComboBox[0];
onElTextChanged: textRow.elTextArray[index] = elText
Component.onCompleted:
Component.onCompleted:
{
{
comboBoxFontMetric.font = (fontComboBox.length > index) ?
fontComboBox[index] :
fontComboBox[0];
if(rectangleTextComboBox.comboBoxIndex == rectangleTextComboBox.comboBoxCurrentIndex)
if(rectangleTextComboBox.comboBoxIndex == rectangleTextComboBox.comboBoxCurrentIndex)
{
{
var tmp = mainRow;
tmp[index] = elText;
var tmp = mainRow;
mainRow = tmp;
tmp[index] = elText;
mainRow = tmp;
if(rectangleTextComboBox.comboBoxCurrentIndex != -1)
{
if(index == 0)
if(index == 0)
{
mainLineText = comboBoxFontMetric.elidedText(fullText, Text.ElideRight, rectangleTextComboBox.width, Qt.TextShowMnemonic);
comboBoxFontMetric.font = (fontComboBox.length > index) ?
}
fontComboBox[index] :
}
fontComboBox[0];
 
mainLineText = comboBoxFontMetric.elidedText(fullText, Text.ElideRight, rectangleTextComboBox.width, Qt.TextShowMnemonic);
 
}
 
}
}
}
}
}
}
}
 
}
 
Component.onCompleted:
 
{
 
if(rectangleTextComboBox.comboBoxCurrentIndex !== -1)
 
updateMainRow(comboBoxFontMetric, rectangleTextComboBox.comboBoxIndex, rectangleTextComboBox.comboBoxCurrentIndex, textRow.elTextArray, (widthPopupComboBoxNormal - indicatorWidth - indicatorLeftInterval));
 
}
}
onComboBoxCurrentIndexChanged:
onComboBoxCurrentIndexChanged:
{
{
mainLineText = comboBoxFontMetric.elidedText(getModelData(currentIndex, comboBoxTextRole[0]), Text.ElideRight, rectangleTextComboBox.width, Qt.TextShowMnemonic);
if(rectangleTextComboBox.comboBoxCurrentIndex !== -1)
console.log("mainLineText", mainLineText)
updateMainRow(comboBoxFontMetric, rectangleTextComboBox.comboBoxIndex, rectangleTextComboBox.comboBoxCurrentIndex, textRow.elTextArray, rectangleTextComboBox.width);
 
}
}
}
}
@@ -117,7 +125,8 @@ DapComboBoxForm
@@ -117,7 +125,8 @@ DapComboBoxForm
Rectangle
Rectangle
{
{
anchors.fill: parent
anchors.fill: parent
anchors.bottomMargin: {
anchors.bottomMargin:
 
{
if(index == count - 2)
if(index == count - 2)
{
{
if(index+1 == currentIndex)
if(index+1 == currentIndex)
@@ -140,5 +149,24 @@ DapComboBoxForm
@@ -140,5 +149,24 @@ DapComboBoxForm
return model.get(rowIndex)[modelRole];
return model.get(rowIndex)[modelRole];
}
}
 
function updateMainRow(fm, cbIndex, cbCurrentIndex, elTextArray, width)
 
{
 
if(cbIndex === cbCurrentIndex)
 
{
 
for(var i = 0; i < comboBoxTextRole.length; i++)
 
{
 
fm.font = (fontComboBox.length > i) ?
 
fontComboBox[i] :
 
fontComboBox[0];
 
 
var tmp = mainRow;
 
tmp[i] = elTextArray[i];
 
mainRow = tmp;
 
 
if(i == 0)
 
mainLineText = fm.elidedText(getModelData(cbCurrentIndex, comboBoxTextRole[0]), Text.ElideRight, width, Qt.TextShowMnemonic);
 
}
 
}
 
}
}
}
Loading