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
}
}
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
}
}
To copy to clipboard, switch view to plain text mode
#include <QApplication>
#include <qqmlengine>
#include <QQmlComponent>
#include <QtCore>
#include <QQuickWindow>
int main(int argc, char *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();
}
#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();
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks