Problem with ComboBox when plugin is docked
Example attached is simplified from a real plugin that I am working on.
If I make the plugin of type Dock then the dropdown choices appear in the wrong place when the plugin is actually docked:
If I drag the plugin's UI outside of the main Musescore window then it works as expected:
What do I need to do to make it work when docked? I have tried it as a dialog plugin and it works properly but dialogs cannot be kept on top of the main Musescore window.
Here is the code for this example:
Comments
There is no more problem if you move to QtQuick Controls 2 (but you must accept the Flat style of QTUick Controls 2):
These are (I think) the latest version allowed by MS3.6
In reply to There is no more problem if… by parkingb
Much appreciated. :-)
This does indeed solve the problem and flat style is equally acceptable. I've lost the background colour of dropdown but I expect that there will be a property for this somewhere in the new Qt.Controls.
In reply to Much appreciated. :-) This… by yonah_ag
Have a look at my plugin's. All are using QtQuick Controls 2 and most are using ComboBox,
SoloAnalyser has its own NiceComboBox that auto-determines its width based on its content.
In reply to Have a look at my plugin's… by parkingb
Thanks again, there's so much useful learning for me in your plugins. It looks like contentItem is one of the pieces of the puzzle that I was missing. Flickable was another essential to get my TextArea scrolling again. I have also found the reference documentation for Qt 5.9 which is proving helpful.
In reply to Thanks again, there's so… by yonah_ag
I've got one Flickable in Scale Workout Builder that could serve as an example
In reply to Thanks again, there's so… by yonah_ag
ScrollView is another alternative for panels or elements that need to be scrolled.
I used it in the Euclidean Rhythm plugin.
In reply to There is no more problem if… by parkingb
The flat styles just about work on Windows:
But on macOS it's a mess:
Is there anything that I can do to fix these issues?
In reply to The flat styles just about… by yonah_ag
I can't test under MacOs. But I've tested all my plugins on both Window 10 and Ubuntu and never encountered such problem.
What puzzles me is the look of your ComboBoxes on Windows. Rounded. Have you tweaked them to obtain that effect ? If yes, have you tested un-tweaked ComboBoxes ?
Have you tested one of my plugin in MacOs ? For example Scale Workout Builder has ComboBoxes. How does it behave ? Have you the same mess ?
You can always create improved versions those items. I did it for the RadioButton (i.e. NiceradioButton) and for the CheckBox (i.e. SmallCheckBox). In both elements next to L&F improvements I also corrected some issues with the base components themselves in dark mode.
Both can be seen in action in the Batch Convert plugin.
You could follow the same way and create a new element "MyComboBox" where you define your own Indicator.
In reply to I can't test under MacOs… by parkingb
Yes, I had rounded the ComboBoxes, (but have now removed this.)
Thanks for the links. These have set me on the right path to defining my own indicator and also changing other properties of the components. It seems a lot more work than the earlier version of Qt and involves a fair bit of trial and error in Musescore's plugin creator. I can only test on Windows but have a collaborator on this project who is running macOS so I'll ask him how the revised UI is working out.
In reply to I can't test under MacOs… by parkingb
I've got my own indicator styling working now but have a couple of questions.
1) Is there any way to shrink the vertical spacing of items in the ComboBox dropdown list?
2) Is there any way to highlight an item in the dropdown list when the mouse pointer hovers over it?
In reply to I've got my own indicator… by yonah_ag
Got there in they end by including:
In reply to The flat styles just about… by yonah_ag
Hi,yonah_ Ag. I would like to ask. Are there many bugs in graphic design like this on Mac?
In reply to Hi,yonah_ Ag. I would like… by davil123
Given that Qt is a mature product and that I am something of a novice with it, (having only just moved to Qt5.9), I think that it is more a case of my lack of understanding. I have made a good bit of progress since the above screenshot, mainly by specifying properties in more detail rather than relying on defaults.
The links and examples posted above by parkingb are all worth exploring if you need to increase your understanding.