Plugin with type dock doesn't fill available width
Hi,
my plugin looks like in the screenshot: it's elements don't fill the width.
When I compare it to the demo plugin random2 I can't see the difference.
My plugin code is:
...
pluginType: "dock"
dockArea: "left"
width: 200
height: 700
Layout.fillWidth: true
GridLayout {
anchors.fill: parent
columns: 1
rowSpacing: 1
Text {
text: "Instrument (anzeigen)"
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
MouseArea {
anchors.fill: parent
}
}
ComboBox {
id: comboModel
Layout.fillWidth: true
textRole: "value"
...
It's pretty much the same as random2.qml from layout instructions as far as I see...
Any ideas?
Attachment | Size |
---|---|
screenshot-2021-02-13-10-57-06.png | 50.69 KB |
Comments
It would be helpful if you could attach a full plugin code, at least some minimal example on which the issue is reproducible. From what I see I would try the following possible solutions:
- Replacing the top-level
width
andheight
properties withimplicitWidth
andimplicitHeight
: implicit versions of these properties won't enforce fixed width or height so they may behave better in this regard, and they still ensure the correct initial dimensions of the plugin view.- Removing the top-level
Layout.fillWidth: true
: I am not sure if it does anything useful at the plugin's top-level component but I don't see anything like this in the code ofrandom2.qml
.In reply to It would be helpful if you… by dmitrio95
Thank you dimitrio95. At the end, it was just a missing
anchors.fill: parent
inGridLayout
. A few problems played together and made it hard to spot the problem:The patch below fixed it.