qskinny/examples/iot-dashboard/MainWindow.cpp

43 lines
1.2 KiB
C++
Raw Normal View History

2020-05-22 07:47:09 +00:00
#include "MainWindow.h"
2020-05-22 09:48:05 +00:00
#include "MainContent.h"
2020-05-22 07:47:09 +00:00
#include "MenuBar.h"
#include <QskLinearBox.h>
2020-06-05 18:38:32 +00:00
#include <QtQuickShapes/private/qquickshape_p.h>
#include <QtQuick/private/qquickpath_p.h>
2020-05-22 07:47:09 +00:00
MainWindow::MainWindow() : QskWindow()
{
2020-05-22 13:46:17 +00:00
setPreferredSize( { 1024, 600 } );
2020-05-22 07:47:09 +00:00
setTitle( "IOT dashboard" );
2020-06-05 18:38:32 +00:00
auto* shape = new QQuickShape( contentItem() );
shape->setSize( { 500, 500 } );
connect(this, &QQuickWindow::frameSwapped, [shape]() {
shape->setAsynchronous(!shape->asynchronous());
qDebug() << "status:" << shape->rendererType() << shape->status();
});
auto* shapePath = new QQuickShapePath( shape );
shapePath->setFillColor( Qt::red );
shapePath->setStrokeColor( Qt::blue );
shapePath->setStrokeWidth( 5 );
shapePath->setStartX( 5 );
shapePath->setStartY( 5 );
auto* arc = new QQuickPathArc( shapePath );
arc->setX( 50 );
arc->setY( 50 );
arc->setRadiusX( 100 );
arc->setRadiusY( 100 );
arc->setUseLargeArc( true );
qDebug() << "visible?" << shape->isVisible() << shape->size();
// m_mainLayout = new QskLinearBox( Qt::Horizontal, contentItem() );
// m_menuBar = new MenuBar( m_mainLayout );
// m_mainContent = new MainContent( m_mainLayout );
2020-05-22 07:47:09 +00:00
}