1. Kevin
  2. Valentina Studio
  3. Friday, February 26 2021, 08:43 PM
  4.  Subscribe via email
Hi,

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.

Thanks,

Kevin
Comment
There are no comments made yet.
Kevin Accepted Answer
Hi,

A follow-up.

I found this:

https://doc.qt.io/qt-5/qcombobox.html#maxVisibleItems-prop

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.


Thanks,

Kevin
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 1
Sergey Pashkov Accepted Answer
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.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 2
  • Page :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories