docs adjusted to build with an installe qskinny
This commit is contained in:
parent
a1ca38d4fa
commit
9cd20ff160
@ -30,17 +30,13 @@ As a next step, we need to write our app. Let's start with a simple `main.cpp` f
|
|||||||
.main.cpp
|
.main.cpp
|
||||||
[source]
|
[source]
|
||||||
....
|
....
|
||||||
#include <SkinnyFont.h>
|
|
||||||
#include <QskWindow.h>
|
#include <QskWindow.h>
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
QGuiApplication app( argc, argv );
|
QGuiApplication app( argc, argv );
|
||||||
|
|
||||||
SkinnyFont::init( &app );
|
|
||||||
|
|
||||||
QskWindow window;
|
QskWindow window;
|
||||||
window.show();
|
window.show();
|
||||||
|
|
||||||
@ -48,20 +44,23 @@ int main( int argc, char* argv[] )
|
|||||||
}
|
}
|
||||||
....
|
....
|
||||||
|
|
||||||
For now this will just create an empty window (the `QskWindow`) without any controls. Next, we need to create a `myapp.pro` file in our `myapp` directory:
|
For now this will just create an empty window (the `QskWindow`) without any controls.
|
||||||
|
Next, we need to create a `myapp.pro` file in our `myapp` directory.
|
||||||
|
Assuming, that qskinny had been installed to "/opt/qskinny":
|
||||||
|
|
||||||
.myapp.pro
|
.myapp.pro
|
||||||
[source,xml]
|
[source,xml]
|
||||||
....
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = myapp
|
TARGET = myapp
|
||||||
|
|
||||||
INCLUDEPATH += /home/user/dev/qskinny/support \
|
QT *= quick
|
||||||
/home/user/dev/qskinny/src/common \
|
|
||||||
/home/user/dev/qskinny/src/controls \
|
|
||||||
/home/peter/temp/qskinny/src/layouts
|
|
||||||
|
|
||||||
LIBS += -L/home/user/dev/qskinny/lib -lqskinny -lqsktestsupport
|
QSK_ROOT=/opt/qskinny
|
||||||
|
|
||||||
|
INCLUDEPATH += $${QSK_ROOT}/include
|
||||||
|
LIBS += -L$${QSK_ROOT}/lib -lqskinny
|
||||||
|
|
||||||
|
QMAKE_RPATHDIR *= $${QSK_ROOT}/lib
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp
|
main.cpp
|
||||||
@ -76,11 +75,12 @@ qmake
|
|||||||
make
|
make
|
||||||
....
|
....
|
||||||
|
|
||||||
When running the app we will have to supply the `LD_LIBRARY_PATH`:
|
When running myapp it needs to find the skin plugins. Setting QT_PLUGIN_PATH is one
|
||||||
|
option ( see https://doc.qt.io/qt-5/deployment-plugins.html ):
|
||||||
|
|
||||||
[source,xml]
|
[source,xml]
|
||||||
....
|
....
|
||||||
LD_LIBRARY_PATH=/home/user/dev/qskinny/lib ./myapp
|
QT_PLUGIN_PATH=/opt/qskinny/plugins ./myapp
|
||||||
....
|
....
|
||||||
|
|
||||||
This should show just an empty window.
|
This should show just an empty window.
|
||||||
@ -92,7 +92,6 @@ Now that we have our app running, we can add some UI controls to it by extending
|
|||||||
.main.cpp
|
.main.cpp
|
||||||
[source]
|
[source]
|
||||||
....
|
....
|
||||||
#include <SkinnyFont.h>
|
|
||||||
#include <QskWindow.h>
|
#include <QskWindow.h>
|
||||||
#include <QskLinearBox.h>
|
#include <QskLinearBox.h>
|
||||||
#include <QskPushButton.h>
|
#include <QskPushButton.h>
|
||||||
@ -103,8 +102,6 @@ int main( int argc, char* argv[] )
|
|||||||
{
|
{
|
||||||
QGuiApplication app( argc, argv );
|
QGuiApplication app( argc, argv );
|
||||||
|
|
||||||
SkinnyFont::init( &app );
|
|
||||||
|
|
||||||
auto* horizontalBox = new QskLinearBox( Qt::Horizontal );
|
auto* horizontalBox = new QskLinearBox( Qt::Horizontal );
|
||||||
auto* button1 = new QskPushButton( "button 1", horizontalBox );
|
auto* button1 = new QskPushButton( "button 1", horizontalBox );
|
||||||
auto* button2 = new QskPushButton( "button 2", horizontalBox );
|
auto* button2 = new QskPushButton( "button 2", horizontalBox );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user