PDA

View Full Version : QML Comboox listed items orientation



MarkoSan
1st October 2015, 13:25
Dear Sirs and Madams!

I have following simple QML Combobox in file UeStaffSelector.qml:


import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

import si.mikroelektronika 1.0

Item
{
id: ueStaffSelector

width: 256
height: 96

ComboBox
{
editable: false
activeFocusOnPress: false
selectByMouse: false

anchors.fill: parent

model: [ "Banana", "Apple", "Coconut" ]

style: ComboBoxStyle
{
label: Image
{
source: "qrc:///ueIcons/icons/ueUserLogError.png"
} // label

background: Rectangle
{
width: parent.width
height: parent.height

color: "black"
} // background
} // style
} // ComboBox
} // Item

It produces ComboBox as seen in screenshot:
11407
Now, this ComboBox resides in QML's app StatusBar and as you can see, test items are listed, that is ok. But, how do I reformat this item listing so it will reside on a top of ComboBox, as you can see from the screenshot?

Sincerely,
Marko

anda_skoa
1st October 2015, 13:48
I don't think there is a way to control this.

A ComboBox is by default a drop-down control unless there is not enough space for the popup below the combobox.

You'll likely have to create your own combobox-like control.

Cheers,
_