Getting Started With Lighthouse: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(→‎Now you can start on the advanced stuff: Put the content from the other page here, as it's just a stub anyway.)
m (Refine category, mark for deletion.)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Outdated | reason=Article says it's outdated.}}
{{Outdated | reason=Article says it's outdated.}}
{{Delete | reason=Please move any useful content to [[Qt Platform Abstraction]] and redirect there. Thank you!}}
[[Category:HowTo]]
[[Category:HowTo]]
[[Category:Developing Qt]]
[[Category:Developing_Qt::Lighthouse]]


The information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/
The information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/
Line 100: Line 101:
== Now you can start on the advanced stuff ==
== Now you can start on the advanced stuff ==


The short version: Look at the files in <code>qtbase/src/plugins/platforms/minimal/<code>.
The short version: Look at the files in <kbd>qtbase/src/plugins/platforms/minimal/</kbd>.
That should show what needs to be implemented to get a new plugin off the ground.
That should show what needs to be implemented to get a new plugin off the ground.
The long version might get written up as [[Writing Your Own Lighthouse Backend]].
The long version might get written up as [[Writing Your Own Lighthouse Backend]].

Latest revision as of 09:32, 7 August 2017

IMPORTANT: The content of this page is outdated. Reason: Article says it's outdated.
If you have checked or updated this page and found the content to be suitable, please remove this notice.
This article is nominated for deletion. Reason: Please move any useful content to Qt Platform Abstraction and redirect there. Thank you!
Please raise your support/opposition to this nomination in the article's discussion page.

The information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/


Getting started with Lighthouse (a.k.a. QPA)

Prerequisites

You need a Unix-like system, a reasonably modern C++ compiler, and an up-to-date version of git (1.6 or newer recommended). (If you do not have git, there is a way to download tarballs from qt.gitorious.org, but I'm not going to show you how: You really want to use git, especially if you are ever going to update to newer versions.)

Clone the Lighthouse repository

First choose some convenient place to put the code. For the purpose of this document I will use

~/dev/

.

 mkdir -p~/dev
 cd ~/dev

Now clone the Lighthouse repository into

~/dev/lighthouse

:

 git clone git://gitorious.org/+qt-developers/qt/lighthouse.git

Configure and build

We will use shadow builds for this. Shadow building means building outside the source directory tree. It is of course possible to build Lighthouse inside the source tree, but use shadow builds anyway. You will thank me later: With shadow builds you can have several different build configurations side by side.

The only limitation is that the shadow build directory has to be outside the source tree; otherwise Qt's build system will be fatally confused. Apart from that you could put the build directory anywhere, but here I'll put it next to the source directory.

Create a build directory, and

cd

into it.

 cd ~/dev
 mkdir build-lighthouse
 cd build-lighthouse

Running the configure script from inside the build directory sets up the shadow build:

 ../qt-lighthouse/configure -qpa -developer-build

(The

-embedded-lite

option is what makes this a Lighthouse build instead of making just another Qt/X11 binary;

-developer-build

makes a library that does not need to be installed somewhere else, as well as setting some other developer-friendly options.) Now compile Lighthouse. To save time, we'll just compile

src

, and skip the tools and examples for now:

 make -C src

Run some examples

We didn't compile any examples in the previous step, so we have to compile them as we need them. We'll choose the industrial standard example for Qt testing:

 cd examples/widgets/wiggly/
 make

If we don't specify a backend, Lighthouse will just complain at us, so we use the

-platform

command line argument, and choose minimal.

 ./wiggly -platform minimal

Note: you have to press Ctrl-C to stop the program, otherwise your file system will fill up with images.

Now you can use your favorite image viewer to look at the images (

outputxxxx.png

). You probably want to clean up afterwards:

 rm output*.png

If you are running an X11 server, and have the necessary header files installed, you can also try out the

testlite

backend. It's not compiled by default, so you'll have to do that first:

 cd ../../../src/plugins/platforms/testlite/
 make

Go back to the example,

 cd-

and run it with the new backend:

./wiggly -platform testlite

Now you can start on the advanced stuff

The short version: Look at the files in qtbase/src/plugins/platforms/minimal/. That should show what needs to be implemented to get a new plugin off the ground. The long version might get written up as Writing Your Own Lighthouse Backend.