Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main.cpp
- #include <QApplication>
- #include "qmlapplicationviewer.h"
- #include <QGLWidget>
- Q_DECL_EXPORT int main(int argc, char *argv[])
- {
- QScopedPointer<QApplication> app(createApplication(argc, argv));
- QmlApplicationViewer viewer;
- viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
- viewer.setMainQmlFile(QLatin1String("qml/test/main.qml"));
- //viewer.setViewport(new QGLWidget());
- viewer.setAttribute(Qt::WA_TranslucentBackground);
- viewer.setStyleSheet("background:transparent;");
- viewer.setWindowFlags(Qt::FramelessWindowHint);
- viewer.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::Antialiasing);
- viewer.showExpanded();
- return app->exec();
- }
- main.qml
- import QtQuick 1.1
- Rectangle {
- width: 400
- height: 400
- color: "transparent"
- Rectangle {
- width: 60
- height: 60
- anchors.centerIn: parent
- color: "indigo"
- }
- Rectangle {
- width: 60
- height: 60
- color: "indigo"
- }
- Rectangle {
- width: 60
- height: 60
- anchors.right: parent.right
- color: "indigo"
- }
- Rectangle {
- width: 60
- height: 60
- anchors { bottom: parent.bottom; }
- color: "indigo"
- }
- Rectangle {
- width: 60
- height: 60
- anchors { bottom: parent.bottom; right: parent.right }
- color: "indigo"
- }
- }
Add Comment
Please, Sign In to add comment