2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include <SkinnyFont.h>
|
|
|
|
#include <SkinnyShortcut.h>
|
|
|
|
|
|
|
|
#include <QskLinearBox.h>
|
2018-08-03 08:15:28 +02:00
|
|
|
#include <QskObjectCounter.h>
|
2017-07-21 18:21:34 +02:00
|
|
|
#include <QskTextLabel.h>
|
|
|
|
#include <QskWindow.h>
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
class TextBox : public QskLinearBox
|
2017-07-21 18:21:34 +02:00
|
|
|
{
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
|
|
|
TextBox( QQuickItem* parent = nullptr )
|
|
|
|
: QskLinearBox( Qt::Vertical, 3, parent )
|
2017-07-21 18:21:34 +02:00
|
|
|
{
|
2018-08-03 08:15:28 +02:00
|
|
|
const QStringList texts =
|
|
|
|
{ "Default", "Tiny", "Small", "Medium", "Large", "Huge" };
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
for ( int i = 0; i < texts.size(); i++ )
|
|
|
|
{
|
2018-08-03 08:15:28 +02:00
|
|
|
auto label = new QskTextLabel( texts[ i ] + " Font", this );
|
2017-08-22 20:15:11 +02:00
|
|
|
label->setFontRole( i );
|
2017-07-21 18:21:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
int main( int argc, char* argv[] )
|
|
|
|
{
|
|
|
|
#ifdef ITEM_STATISTICS
|
|
|
|
QskObjectCounter counter( true );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
QGuiApplication app( argc, argv );
|
|
|
|
|
|
|
|
SkinnyFont::init( &app );
|
|
|
|
SkinnyShortcut::enable( SkinnyShortcut::Quit |
|
|
|
|
SkinnyShortcut::DebugShortcuts );
|
|
|
|
|
|
|
|
auto box = new TextBox();
|
|
|
|
|
|
|
|
QskWindow window;
|
|
|
|
window.addItem( box );
|
|
|
|
window.resize( box->sizeHint().toSize() );
|
|
|
|
|
|
|
|
window.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|