Custom ComboBox : ListView doesn't display text when ElideRight
-
Hello, I'm writing a customization of QtQuick Controls ComboBox for my style, and I 've got an issue that I doesn't understand.
Here is a first simplified code of a customization that works
(It's a pastebin link, else askimet consider it's a spam)
MyStyle/ComboBox.qmlThis result in this ComboBox
So I would like to ElideRight the text in the Popup's ListView's delegate
delegate: ItemDelegate { id: delegate required property var model required property int index width: control.width height: Math.max(control.implicitHeight, implicitContentHeight) highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled contentItem: Text { text: delegate.model[control.textRole] anchors.verticalCenter: parent.verticalCenter width: delegate.width color: control.textAndBorderColor font: control.currentIndex === index ? Theme.fonts.title : Theme.fonts.textBig elide: Text.ElideRight //I just add this line horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } background: Rectangle{color: "transparent"} }
And this make the
ListView
unable to display the textThe strange thing is that it's like if the text is behind another element, because when I select a line, the previous and new text lines quick appears during the time the popup exit (here is with a 5s exit animation)
I don't understand why the
elide
mode change this. the Textwidth
is specified, and if I set another elide mode (ElideNone
/ElideLeft
/ElideMiddle
), it works.
I've tested this aside in anotherPopup
on my app (not related toT.ComboBox
) and it worked well, it seems that the issue is specific to the ComboBox'spopup
property