Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual
Page 219

KTD-S0057-I
Page 215 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
switch
(orientation)
{
case
ScreenOrientationLockPortrait:
attribute
=
Qt::WA_LockPortraitOrientation;
break;
case
ScreenOrientationLockLandscape:
attribute
=
Qt::WA_LockLandscapeOrientation;
break;
default:
case
ScreenOrientationAuto:
attribute
=
Qt::WA_AutoOrientation;
break;
};
setAttribute (attribute, true);
}
void QmlApplicationViewer::showExpanded ()
{
show
();
}
QApplication *createApplication (int &argc, char **argv)
{
return new QApplication (argc, argv);
}
The Qt
TM
Quick project provides a set of examples on the following webpage
http://qt-project.org/doc/qt-4.8/qdeclarativeexamples.html
The first example uses the sourcecode from '
Web Browser
'. This project requires the WebKit plugin, an
open source web browser rendering engine. You can find a more detailed description on
http://qt-project.org/doc/qt-4.8/qtwebkit.html#details
Plugins for Qt
TM
are normally available in the following directory (target device)
/usr/lib/arm-linux-gnueabihf/qt4/imports
If this directory
imports
or the subdirectory
QtWebKit
do not exist download the plugin with
sudo apt-get install libqtwebkit-qmlwebkitplugin
Now let us discuss the main project. You should download the sourcecode from the '
Web Browser
' page
(the file webbrowser.svg is not really needed). Then create a new directory on the target hardware, for
example '/home/ktam3874/qt/webbrowser/qml', and copy all qml-files into this directory. However,
there is a problem with the png-files (integrated in the qml-files) - the
qt4-demos
package does not con-
tain these files but this issue can be solved by a web search with little effort. Necessary files:
display.png, edit-delete.png, go-jump-locationbar.png, go-next-view.png
go-previous-view.png, scrollbar.png, titlebar-bg.png and view-refresh.png
Thereafter create a new subdirectory '/home/ktam3874/qt/webbrowser/qml/pics' and copy the png-files
into this directory.