[Interest] QML: PlaceholderText on ComboBox (Controls 2)

Mitch Curtis mitch.curtis at qt.io
Mon Sep 2 10:44:08 CEST 2019


> -----Original Message-----
> From: Carel Combrink <carel.combrink at gmail.com>
> Sent: Monday, 2 September 2019 10:33 AM
> To: Mitch Curtis <mitch.curtis at qt.io>
> Cc: interest <interest at qt-project.org>
> Subject: Re: [Interest] QML: PlaceholderText on ComboBox (Controls 2)
> 
> Sorry, forgot the file, see attached:

Please report this as a bug. I can reproduce it.
 
> 
> On Mon, Sep 2, 2019 at 10:26 AM Carel Combrink
> <carel.combrink at gmail.com <mailto:carel.combrink at gmail.com> > wrote:
> 
> 
> 
> 		That should work (and it appears to from the output), so I'm
> not sure why you don't see the placeholder text, assuming that is the actual
> issue here.
> 
> 
> 	I am not seeing the placeholder text
> 
> 
> 
> 		The way you're doing it in onCompleted is the easiest way to
> do it currently, and it should work. Can you please post a minimal example
> here so we can see why it's not working first?
> 
> 
> 	I have attached a main.qml file that can be executed with the qml
> applicaiton: qml main.qml (I am on windows)
> 
> 	The following screenshot shows what I get when I run the qml file
> with Qt 5.12.3 and 5.12.4 on Windows
> 	The checkbox controls if the combo boxes are editable to show that
> the placeholder text is still shown in the second box when toggled.
> 	The first ComboBox uses the method mentioned in my original email.
> 	The second ComboBox I have copied the style from the Fusion and
> set the placeholderText directly on the TextField
> 
> 
> 
> 
> 
> 
> 
> 		As for a feature request, you can create one if you want. I
> wonder if something like Nils' idea of exposing a textField property would be
> the best solution to this:
> 
> 		https://bugreports.qt.io/browse/QTBUG-
> 71406?focusedCommentId=438916&page=com.atlassian.jira.plugin.system.is
> suetabpanels:comment-tabpanel#comment-438916
> 
> 		Usually the contentItem is a TextField, but if it's not, it would
> just be null. The problem is that this same issue likely applies to lots of other
> controls, and it might end up in a slippery slope of adding these type-specific
> accessor properties.
> 
> 
> 
> 	I would also support either exposing the item or seeing if what I am
> trying can be fixed.
> 	Strangely the "selectByMouse" option can be changed using the
> "comboCategory_.contentItem.selectByMouse = true" code and it works as
> expected (set in the attached code)
> 
> 	Regards,
> 	Carel



More information about the Interest mailing list