Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-qt-ui-qml
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
libdap-qt-ui-qml
Commits
a50e8743
Commit
a50e8743
authored
5 years ago
by
tatiana.novikova
Browse files
Options
Downloads
Patches
Plain Diff
[*] Change first load parameters of comboBox for set main line text
parent
678bef1b
No related branches found
Branches containing commit
No related tags found
1 merge request
!28
Features 3048
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
widgets/DapComboBox.qml
+47
-19
47 additions, 19 deletions
widgets/DapComboBox.qml
widgets/DapComboBoxForm.ui.qml
+7
-3
7 additions, 3 deletions
widgets/DapComboBoxForm.ui.qml
widgets/DapTextForm.ui.qml
+1
-1
1 addition, 1 deletion
widgets/DapTextForm.ui.qml
with
55 additions
and
23 deletions
widgets/DapComboBox.qml
+
47
−
19
View file @
a50e8743
...
@@ -55,12 +55,12 @@ DapComboBoxForm
...
@@ -55,12 +55,12 @@ DapComboBoxForm
)
)
height
:
rectangleTextComboBox
.
height
height
:
rectangleTextComboBox
.
height
spacing
:
roleInterval
spacing
:
roleInterval
property
var
elTextArray
:
[]
Repeater
Repeater
{
{
id
:
textRepeater
id
:
textRepeater
model
:
comboBoxTextRole
.
length
model
:
comboBoxTextRole
.
length
DapText
DapText
{
{
id
:
textComboBoxDelegate
id
:
textComboBoxDelegate
...
@@ -77,36 +77,43 @@ DapComboBoxForm
...
@@ -77,36 +77,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 +124,8 @@ DapComboBoxForm
...
@@ -117,7 +124,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 +148,25 @@ DapComboBoxForm
...
@@ -140,5 +148,25 @@ 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
);
}
}
}
/////////////////
}
}
This diff is collapsed.
Click to expand it.
widgets/DapComboBoxForm.ui.qml
+
7
−
3
View file @
a50e8743
import
QtQuick
2.0
import
QtQuick
2.0
import
QtQuick
.
Controls
2.
2
import
QtQuick
.
Controls
2.
0
import
QtQuick
.
Controls
.
Styles
1.4
import
QtQuick
.
Controls
.
Styles
1.4
import
QtGraphicalEffects
1.0
import
QtGraphicalEffects
1.0
...
@@ -135,10 +135,13 @@ ComboBox
...
@@ -135,10 +135,13 @@ ComboBox
{
{
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
(
popup
.
visible
)
?
text
:
(
popup
.
visible
)
?
mainRow
[
index
]
:
(
index
<
mainRow
.
length
?
mainRow
[
index
]
:
""
):
mainLineText
mainLineText
font
:
(
fontComboBox
.
length
>
index
)
?
font
:
popup
.
visible
?
((
fontComboBox
.
length
>
index
)
?
fontComboBox
[
index
]
:
fontComboBox
[
index
]
:
fontComboBox
[
0
]
)
:
fontComboBox
[
0
];
fontComboBox
[
0
];
width
:
popup
.
visible
?
width
:
popup
.
visible
?
(
topComboBoxRow
.
width
-
roleInterval
*
(
comboBoxTextRole
.
length
-
1
))
/
comboBoxTextRole
.
length
:
(
topComboBoxRow
.
width
-
roleInterval
*
(
comboBoxTextRole
.
length
-
1
))
/
comboBoxTextRole
.
length
:
...
@@ -165,6 +168,7 @@ ComboBox
...
@@ -165,6 +168,7 @@ ComboBox
contentItem
:
contentItem
:
ListView
ListView
{
{
id
:
popupList
clip
:
true
clip
:
true
implicitHeight
:
contentHeight
implicitHeight
:
contentHeight
model
:
dapComboBox
.
popup
.
visible
?
dapComboBox
.
delegateModel
:
null
model
:
dapComboBox
.
popup
.
visible
?
dapComboBox
.
delegateModel
:
null
...
...
This diff is collapsed.
Click to expand it.
widgets/DapTextForm.ui.qml
+
1
−
1
View file @
a50e8743
import
QtQuick
2.4
import
QtQuick
2.4
import
QtQuick
.
Controls
2.
2
import
QtQuick
.
Controls
2.
0
TextInput
TextInput
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment