2023-04-06 09:23:37 +02:00

61 lines
1.7 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "DynamicConstraintsPage.h"
#include "FlowLayoutPage.h"
#include "LinearLayoutPage.h"
#include "GridLayoutPage.h"
#include "StackLayoutPage.h"
#include "TestRectangle.h"
#include <SkinnyShortcut.h>
#include <QskFocusIndicator.h>
#include <QskObjectCounter.h>
#include <QskTabView.h>
#include <QskWindow.h>
#include <QskQml.h>
#include <QGuiApplication>
int main( int argc, char* argv[] )
{
#ifdef ITEM_STATISTICS
QskObjectCounter counter( true );
#endif
QskQml::registerTypes();
qmlRegisterType< TestRectangle >( "Test", 1, 0, "TestRectangle" );
QGuiApplication app( argc, argv );
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
auto tabView = new QskTabView();
tabView->setMargins( 10 );
tabView->setTabBarEdge( Qt::LeftEdge );
tabView->setAutoFitTabs( true );
tabView->addTab( "Grid Layout", new GridLayoutPage() );
tabView->addTab( "Flow Layout", new FlowLayoutPage() );
tabView->addTab( "Linear Layout", new LinearLayoutPage() );
tabView->addTab( "Dynamic\nConstraints", new DynamicConstraintsPage() );
tabView->addTab( "Stack Layout", new StackLayoutPage() );
tabView->setCurrentIndex( 0 );
QSize size( 800, 600 );
size = size.expandedTo( tabView->sizeHint().toSize() );
QskWindow window;
window.addItem( tabView );
window.addItem( new QskFocusIndicator() );
window.resize( size );
window.show();
return app.exec();
}