1. Kevin
  2. Valentina Studio
  3. 金, 2月 26 2021, 08:43 PM
  4.  メールで購読

Is there a way to modify the number of items a ComboBox displays to the user?

For example, the ComboBox "fills" the screen, top to bottom, with items. Would like to see, maybe 16, at a time, and scroll through them.

I looked at Properties and didn't see an option.


There are no comments made yet.
Kevin 承諾済みの回答

A follow-up.

I found this:


So, I went to Valentina Studio Pro's documentation (probably should have started there):

Classes - qt - QComboBox

maxVisibleItems -> Number
This property holds the maximum allowed size on screen of the combo box, measured in items.

I think this is what I want.

So I entered the following in the comboBox's Signals QObject created:

this.comboBox.maxVisibleItems = 2;

But I couldn't get it to work. I also entered it into the main form's Signals QComboBox created.

From the QT documentation link above:

"Note: This property is ignored for non-editable comboboxes in styles that returns true for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style."

My combobox was non-editable. Thus, I checked Editable. Now looks like a comboBox (the non-editable ... just a long list one can scroll through). 10 entries.

Re-enter the code and the code is now working in the comboBox's Signals QObject created.

However, it doesn't work in some of my comboboxes, even after I checked Editable.

The comboboxes that don't work contain Aliases based on a query (and Items are also based on a query). Remove the Aliases and it works.

I am on Windows. Not sure if Preferences Appearance Styles impacts the non-editable / editable functionality.


There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello Kevin,

Thank you, in some cases, we create an additional ComboBox control and it looks like the maxVisibleItems property is not applied to it, most probably a fix in code is required.
There are no comments made yet.
  • ページ :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.