QDeclarativeView window cannot transparent on android
-
Hello everyone,
I use QMainWindow create as first window,and then QDeclarativeView create as other window.
I set the QDeclarativeView as transparent, the QDeclarativeView window can transparent on Linux and window system,
But I find this is not OK on android, I found that the QDeclarativeView window cannot transparentcode as below: QMainWindow window; window.resize(800, 480); ........>>painter the picture to MainWindow window.show() QDeclarativeView * m_pDeclarativeView = new QDeclarativeView (); // set view as transparent background m_pDeclarativeView->setAttribute(Qt::WA_TranslucentBackground,true); m_pDeclarativeView->setStyleSheet(QString("background: transparent")); m_pDeclarativeView->setWindowFlags(Qt::FramelessWindowHint); m_pDeclarativeView->setSource(QUrl::fromLocalFile(("main.qml"))); m_pDeclarativeView->show(); main.qml import QtQuick 1.1 Rectangle { width: 360 height: 360 color: "transparent" MouseArea { anchors.fill: parent onClicked: { Qt.quit(); } } Text { color: "red" text: qsTr("Hello World") anchors.centerIn: parent }
}
Could you help me solved this problem?
Thanks in advance! -
@Brian.H QDeclarativeView is deprecated in
Qt5
and IMO withQt4.8
it was never taken further for android platform. I would strongly suggest you update toQt5
possiblyQt 5.4.1
. It works nicely on android. -
-
-
@Brian.H said:
Because My android platform is 2.3.3, and when I use QQuickView instead of QDeclarativeView,
I found that the qml page could not draw on the android system,so I use the QDeclarativeView
to draw the qml.Ah, I see.
I don't have experience with an old platform and Qt Quick 1, sorry...!