2017-07-25 07:24:27 +02:00
|
|
|
#include "MainWindow.h"
|
2017-07-25 21:34:27 +02:00
|
|
|
#include "SkinFactory.h"
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2017-12-06 17:01:10 +01:00
|
|
|
#include <QskShortcutMap.h>
|
2018-01-03 11:57:05 +01:00
|
|
|
#include <QskSkinManager.h>
|
2017-07-25 07:24:27 +02:00
|
|
|
#include <QskSetup.h>
|
|
|
|
#include <SkinnyShortcut.h>
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
2017-07-26 13:21:10 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2017-07-25 10:47:40 +02:00
|
|
|
int main( int argc, char** argv )
|
2017-07-25 07:24:27 +02:00
|
|
|
{
|
2018-01-03 11:57:05 +01:00
|
|
|
auto skinFactory = new SkinFactory();
|
|
|
|
|
|
|
|
qskSkinManager->setPluginPaths( QStringList() ); // no plugins
|
|
|
|
qskSkinManager->registerFactory( "SampleSkinFactory", skinFactory );
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2018-01-03 11:57:05 +01:00
|
|
|
QGuiApplication app( argc, argv );
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2017-07-26 11:56:19 +02:00
|
|
|
/*
|
|
|
|
When going over QPainter for the SVGs we prefer the raster paint
|
|
|
|
engine, simply showing better results. Interestingly the OpenGL paint
|
|
|
|
engine was even slower for the use case of non-complex SVGs.
|
|
|
|
Looks like its tesselation is not much faster than "pixeling"
|
|
|
|
those images directly.
|
|
|
|
*/
|
|
|
|
qskSetup->setControlFlag( QskSetup::PreferRasterForTextures, true );
|
|
|
|
|
|
|
|
// Starting with a simple skin made for this example
|
|
|
|
// CTRL-S allow to rotate through the registered skins and CTRL-T
|
|
|
|
// changes the colors, when the DefaultSkin is active.
|
|
|
|
|
2017-07-25 21:34:27 +02:00
|
|
|
qskSetup->setSkin( "DefaultSkin" );
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2017-07-26 13:21:10 +02:00
|
|
|
cout << "CTRL-S to change the skin." << endl;
|
|
|
|
cout << "CTRL-T to change the color scheme, when the \"Default\" skin is active." << endl;
|
2017-07-25 21:34:27 +02:00
|
|
|
|
2017-12-06 17:01:10 +01:00
|
|
|
QskShortcutMap::addShortcut( QKeySequence( Qt::CTRL + Qt::Key_T ),
|
2018-01-03 11:57:05 +01:00
|
|
|
false, skinFactory, SLOT(toggleScheme()) );
|
2017-07-25 21:34:27 +02:00
|
|
|
|
2017-12-06 17:01:10 +01:00
|
|
|
QskShortcutMap::addShortcut( QKeySequence( Qt::CTRL + Qt::Key_S ),
|
2018-01-03 11:57:05 +01:00
|
|
|
false, skinFactory, SLOT(rotateSkin()) );
|
2017-07-25 07:24:27 +02:00
|
|
|
|
2017-07-26 13:21:10 +02:00
|
|
|
// With CTRL-B you can rotate a couple of visual debug modes
|
2017-07-26 17:54:25 +02:00
|
|
|
SkinnyShortcut::enable( SkinnyShortcut::DebugBackground |
|
2017-07-26 13:21:10 +02:00
|
|
|
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
|
|
|
|
|
2017-07-25 07:24:27 +02:00
|
|
|
MainWindow mainWindow;
|
|
|
|
mainWindow.show();
|
2017-07-25 10:47:40 +02:00
|
|
|
|
2017-07-25 07:24:27 +02:00
|
|
|
return app.exec();
|
|
|
|
}
|