PDA

View Full Version : Use FramelessWindowHint in Windows XP with QML Window Type



dazhu
3rd March 2016, 11:18
main.qml



import QtQuick 2.4
import QtQuick.Window 2.2

Window {
width: 300
height: 300
flags: Qt.FramelessWindowHint | Qt.Window
color: "transparent"

Rectangle {
color: "brown"
anchors.fill: parent
anchors.margins: 10
}
}




#include <QApplication>
#include <qqmlengine>
#include <QQmlComponent>
#include <QtCore>
#include <QQuickWindow>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QQmlEngine engine;
QQmlComponent component(&engine, QUrl::fromLocalFile("main.qml"));
if (!component.isReady())
{
qDebug() << component.errors();
return 0;
}
QQuickWindow* window = qobject_cast<QQuickWindow*>(component.create());
if(!window)
{
qDebug() << component.errors();
return 0;
}
window->show();
return app.exec();
}



if I add the Qt.FramelessWindowHint flag to window

it doesn't work on windows xp

there is no window displayed

is there some wrongs?

i use qt5.4.2 msvc2010 oepngl