Combobox falls in the wrong place

2019-04-16 05:29发布

I'm trying to use qml widget in QtWidget-based application like that

QQuickView *view = new QQuickView;
view->setSource(QUrl::fromLocalFile("myqml.qml"));
QWidget *widget = QWidget::createWindowContainer(view);
widget->setMinimumSize(100, 100);
widget->setMaximumSize(1000, 1000);
widget->setFocusPolicy(Qt::TabFocus);
widget->show();

And that code doesn't work right with comboBoxes, their list falls in the wrong place, it looks like Qt calculate their position relative to the screen.

If I don't use widget and do

view->show()

it works fine, but I need to use widget, to put it in QSplitter or QLayout.

Is there a way to make it work or some other way to put qml-based widget in QSplitter/QLayout.

标签: qt qml
1条回答
Juvenile、少年°
2楼-- · 2019-04-16 06:06

This bug will be fixed in Qt5.1.2 (Next Patch Release) and Qt5.2.0 (Next Minor Release)

see QTBUG-32826 for more informations

查看更多
登录 后发表回答