qquickwidget

Qt Virtual Keyboard in QQuickWidget

夙愿已清 提交于 2021-02-19 06:23:08
问题 It is possible to show Virtual Keyboard in QQuickWidget or in QWidget? I have QWidget application and I need to have better control where VirtualKeyboard is shown. Today I spend all my day to find a solution, unfortunately without success. 回答1: The following code shows that it is valid to use virtualkeyboard in QQuickWidget. main.cpp #include <QApplication> #include <QQmlApplicationEngine> #include <QQuickWidget> int main(int argc, char *argv[]) { qputenv("QT_IM_MODULE", QByteArray(

QQuickWidget: grabToImage: item's window is not visible

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 11:00:48
问题 I'm having a problem when I try to use Item::grabToImage() qml method. No matter which item I point to, it always says the following error: grabToImage: item's window is not visible I tried using the root/toplevel Item named rect too, but it didnt work. My goal: I want to capture a rectangle sized image with the map tile and polygon draw on it Below there's a minimal reproducible example import QtQml 2.2 import QtLocation 5.9 import QtPositioning 5.9 import QtQuick 2.0 import QtQuick.Controls

QQuickWidget grab image

巧了我就是萌 提交于 2019-12-20 03:27:30
问题 I am saving an image of a QQuickWidget with several QML children but all I have is a blank image. C++ side: QQuickWidget* content.. content->setSource(QUrl("qml:/main.qml")); QPixmap *pm = content->grab(QRect(QPoint(0,0),QSize(-1,-1)); pm->save("someFilename.png", 0, 100); QML side: Rectangle{ width: 5; height: 5; color: "yellow"; objectname: "rootobj"} In the QML I wish to dynamically add children and be able to show them in the image. I have tried QQuickWindow grabWindow method with a

Adding QQuickWidget in QStackedWidget

柔情痞子 提交于 2019-12-12 03:37:51
问题 I am trying to add a qquickwidget along with some other qwidgets in qstackedwidget. But when I am trying to set the current widget to the qquickwidget nothing appears on the window. Is there something else that need to be done? I am also setting the view property of the qquickwidget to true QQuickWidget* mRoom = new QQuickWidget; connect(mRoom, SIGNAL(statusChanged(QQuickWidget::Status)), this, SLOT(StatusChanged(QQuickWidget::Status))); mRoom->setSource(QUrl::fromLocalFile("C:/Users/visjain

QQuickWidget grab image

大憨熊 提交于 2019-12-02 02:06:21
I am saving an image of a QQuickWidget with several QML children but all I have is a blank image. C++ side: QQuickWidget* content.. content->setSource(QUrl("qml:/main.qml")); QPixmap *pm = content->grab(QRect(QPoint(0,0),QSize(-1,-1)); pm->save("someFilename.png", 0, 100); QML side: Rectangle{ width: 5; height: 5; color: "yellow"; objectname: "rootobj"} In the QML I wish to dynamically add children and be able to show them in the image. I have tried QQuickWindow grabWindow method with a connection to a slot and it works but it captures only the window visible area and I need to capture the