2018-09-27 16:49:05 +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 <QskWindow.h>
|
|
|
|
#include <QskObjectCounter.h>
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include <private/qquickwebengineview_p.h>
|
|
|
|
|
|
|
|
class WebView : public QQuickWebEngineView
|
|
|
|
{
|
2021-07-16 16:02:15 +02:00
|
|
|
using Inherited = QQuickWebEngineView;
|
|
|
|
|
2019-01-07 09:13:53 +01:00
|
|
|
public:
|
2018-09-27 16:49:05 +02:00
|
|
|
WebView( const char* url, QQuickItem* parent = nullptr )
|
|
|
|
: WebView( parent )
|
|
|
|
{
|
|
|
|
setUrl( QUrl( url ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
WebView( QQuickItem* parent = nullptr )
|
|
|
|
: QQuickWebEngineView( parent )
|
|
|
|
{
|
2021-07-16 16:02:15 +02:00
|
|
|
componentComplete();
|
2018-09-27 16:49:05 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
int main( int argc, char* argv[] )
|
|
|
|
{
|
|
|
|
#ifdef ITEM_STATISTICS
|
|
|
|
QskObjectCounter counter( true );
|
|
|
|
#endif
|
|
|
|
|
2021-07-16 16:02:15 +02:00
|
|
|
QtWebEngine::initialize();
|
2018-09-27 16:49:05 +02:00
|
|
|
|
2021-07-16 16:02:15 +02:00
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
2018-09-27 16:49:05 +02:00
|
|
|
QGuiApplication app( argc, argv );
|
|
|
|
|
|
|
|
SkinnyFont::init( &app );
|
|
|
|
SkinnyShortcut::enable( SkinnyShortcut::Quit | SkinnyShortcut::DebugShortcuts );
|
|
|
|
|
|
|
|
QskWindow window;
|
|
|
|
|
|
|
|
window.addItem( new WebView( "https://github.com/uwerat/qskinny" ) );
|
|
|
|
window.resize( 800, 600 );
|
|
|
|
window.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|