← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Unity-2D and Qt5

 

Le 07/01/12 15:52, a.grandi@xxxxxxxxx a écrit :
HI,

I've some quick questions before proceding with this tasks.

On 5 January 2012 02:04, Florian Boucault
<florian.boucault@xxxxxxxxxxxxx>  wrote:
./configure -developer-build -nomake examples -nomake tests -no-gtkstyle
-no-webkit -opensource -confirm-license
make -j3

I notice that you don't set a specific installation path (for example
/opt/qt5 ) and you don't execute "make install".
Does it mean that these libs will overwrite my Qt4 libs installed on my Ubuntu?
When do you make install these libs?

I simply do not install Qt5 nor any of the libraries compiled later on. No overwrite of Qt4.


2) Recompile the libraries that Unity 2D depends on against Qt5, that are
dee-qt, bamf-qt, dbusmenu-qt and dconf-qt. I adapted them so that they
compile and work more or less fine against Qt5:

bzr branch lp:~fboucault/dee-qt/qt5
cd qt5
cmake .
make
cd ..

same here... no "make install" at all... is it right?
How can the cmake find the Qt5 libs if they're not installed somewhere?

It finds it thanks to the PATH environment variable set later on:
export PATH=$PWD/qtbase/bin:$PATH


3) Finally modify Unity 2D's code for it to compile against Qt5. For that
there is a bunch of tasks that need to be accomplished properly listed just
after. To get a (working) idea of it I pasted a very crude patch that does
part of it there:

http://pastebin.com/31G903eY

have you already pushed this branch somewhere? Or do you prefer me to
branch the original unity-2d and apply the patch you wrote?

There is no branch yet with that code as it was really quick and dirty. It would be awesome to have a branch with one commit per clean change :)



Qt4 compatible tasks:
* fix Qt includes to be fully specified (e.g. QObject becomes
QtCore/QObject)
* CMakeLists.txt:
- use INCLUDE_DIRS instead of INCLUDE_DIR
- migrate away from qt4_automoc in panel and libunity-2d-private and use
qt4_wrap_cpp instead (removes all #include .moc in *.cpp)

Qt5 only tasks:
* CMakeLists.txt:
- replace uses of qt4_wrap_cpp with qt5_wrap_cpp
- replace uses of qt4_add_dbus_adaptor with qt5_add_dbus_adaptor
* drop usage of QX11Info (maybe isolate dependencies on X while at it)
* in QML: Accessible.name and Accessible.role do not exist anymore; find the
replacement

If I correctly understand you have applied these modifications only in
a small part of the code and the task is to apply them everywhere in
the unity-2d code, is it right?

That's right. And make sure that the ones I made are correct. And also general tidying up, making sure that no reference to Qt4 is left, that the tests still pass, etc.


* That makes Unity 2D run with Qt5 but still using QtQuick 1.1. We will also
want to migrate to QtQuick 2.0.

yes, we need to change the import at the beginning of *.qml files.
I can try to do it once I'm sure that everything else runs fine.


Perfect.

* automoc in Qt5 will be done through its inclusion in CMake 2.8.7 and we
will be able to remove:

set(FOO_MOC_HEADERS foo_header.h)
qt5_wrap_cpp(FOO_MOC_SRCS ${FOO_MOC_HEADERS})
add_library(foo SHARED ${FOO_SRCS} ${FOO_MOC_SRCS})

by adding:
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

for the moment we just have to wait for automoc to be includes in CMake, right?

Thanks!


automoc is now included in CMake but the version of CMake we ship is not the latest one therefore we cannot rely on it just yet hence the need for qt5_wrap_cpp which we can remove later on.

Florian



References