Doc: A guide for porting Gtk+ applications to Qt

267 views
Skip to first unread message

PCMan

unread,
Apr 25, 2013, 1:45:28 AM4/25/13
to lxde-list, pcmanfm-develop, razo...@googlegroups.com, lubuntu user list
Hello,
To help people porting their Gtk+ programs to Qt, I just started a
wikipage documenting what I've learned so far.
http://wiki.lxde.org/en/Port_GTK%2B_Programs_to_Qt

Currently it provides a long table listing equivalent Qt classes for
commonly used GtkWidget classes. This is useless for experts, but it's
very helpful for Qt beginners who know Gtk+ well.
The mapping is not yet finished, but I'll try to make it complete soon.

Later I'll add more content and documented how to safely mix
glib/gio/GObject code with Qt. How the translation systems differ.
I hope that developers interested in this topic can help edit the wiki
page to make it more complete and free from errors.

It's still a work in progress but I hope it helps someone as more and
more people are using Qt and some more LXDE components might get Qt
ports later.
BTW, since ubuntu guys is moving toward Qt, this also helps them.

Cheers!

Дмитрий Антонов

unread,
Apr 25, 2013, 9:30:57 AM4/25/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list
Hello!
Port Synaptic to QT5 please.

Jerome Leclanche

unread,
Apr 25, 2013, 11:40:21 AM4/25/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list
On Thu, Apr 25, 2013 at 2:30 PM, Дмитрий Антонов <dmya...@gmail.com> wrote:
Hello!
Port Synaptic to QT5 please.

What is this, a buffet?

Really cool docs; I'm surprised there isn't something like this already somewhere :)

BTW, the horizontal/vertical stuff is handled by Qt layouts (QHBoxLayout, QVBoxLayout); ref: https://qt-project.org/doc/qt-4.8/layout.html

J. Leclanche

 

--
--
You received this message because you are subscribed to the Google
Groups "Razor-qt" group.
For more options, visit this group at
http://groups.google.com/group/razor-qt?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Razor-qt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to razor-qt+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

PICCORO McKAY Lenz

unread,
Apr 25, 2013, 3:01:11 PM4/25/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list
excelent documentation.. thanks.
Lenz McKAY Gerardo (PICCORO)


On Thu, Apr 25, 2013 at 11:10 AM, Jerome Leclanche <ady...@gmail.com> wrote:
Port Synaptic to QT5 please.

What is this, a buffet?
KA KA KA kakakak jajaja
 

Kuzma Shapran

unread,
Apr 25, 2013, 10:05:00 PM4/25/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list


On Thursday, 25 April 2013 17:45:28 UTC+12, PCMan wrote:
Hello,
To help people porting their Gtk+ programs to Qt, I just started a
wikipage documenting what I've learned so far.
http://wiki.lxde.org/en/Port_GTK%2B_Programs_to_Qt

 
Great article!

May I add some notes?

To use signal/slots it is not necessary to include an automatically generated moc file, it only has to be compiled into the app.
If you use *.pro file to build your app - qmake will do all the magic for you. If you use CMake - qt4_wrap_cpp/qt5_wrap_cpp are macros you need.

Also useful CMake macros are:
qt4_add_resources to add embedded resources to your app,
qt4_wrap_ui to add a widget form,
qt4_create_translation for translation,
qt4_add_dbus_adaptor & qt4_add_dbus_interface to generate D-Bus-related code.


P.S. There is a layout problem in the table with "Disconnect signals" row - the cell content happened to be in the next row.

Дмитрий Антонов

unread,
Apr 26, 2013, 5:01:13 AM4/26/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list
How long does it take to make Synaptic QT?

Petr Vanek

unread,
Apr 26, 2013, 5:08:28 AM4/26/13
to razo...@googlegroups.com
On 04/26/2013 11:01 AM, Дмитрий Антонов wrote:
> How long does it take to make Synaptic QT? --

There is no synaptic developer here now. Also I don't see any reason why
me, we, or any of lxde-ers should handle one distro related app.

fyi:
http://forums.debian.net/viewtopic.php?f=20&t=71558

Дмитрий Антонов

unread,
Apr 26, 2013, 5:15:41 AM4/26/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop, lubuntu user list
LXDE is developing rapidly and is quite popular, only because of Lubuntu.

Kevin Krammer

unread,
Apr 26, 2013, 5:19:45 AM4/26/13
to razo...@googlegroups.com, lxde-list, pcmanfm-develop
On Friday, 2013-04-26, Kuzma Shapran wrote:
> On Thursday, 25 April 2013 17:45:28 UTC+12, PCMan wrote:
> > Hello,
> > To help people porting their Gtk+ programs to Qt, I just started a
> > wikipage documenting what I've learned so far.
> > http://wiki.lxde.org/en/Port_GTK%2B_Programs_to_Qt
>
> Great article!
>
> May I add some notes?
>
> To use signal/slots it is not necessary to include an automatically
> generated moc file, it only has to be compiled into the app.
> If you use *.pro file to build your app - qmake will do all the magic for
> you. If you use CMake - qt4_wrap_cpp/qt5_wrap_cpp are macros you need.

You can also just activate CMake's automoc feature

set(CMAKE_AUTOMOC TRUE)

It supports both separately compiled moc.cpp files as well as moc "includes".

Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
signature.asc
Reply all
Reply to author
Forward
0 new messages