Thought about a Qt port

Alberto Mardegan mardy at users.sourceforge.net
Sun Mar 31 10:37:44 PDT 2013


On 03/31/2013 06:28 AM, Dirk Hohndel wrote:
> linking with g++ solves that but then of course the resulting program
> doesn't run...

Strange, that worked for me. Anyway, linking with g++ is indeed correct,
so I changed that.

> I am happy to track things in a Qt branch in the official
> repository. And I'm ok with things in that branch not working /
> compiling at times. One thing that I do insist on are Signed-off-by:
> lines for every commit...

Absolutely. But please don't consider these commits as anything that I'd
submit, they are just a playground to test some things and receive early
feedback on the generic approach; and don't be too much upset if I'll
rebase that wip branch -- I indeed plan to do it, and will try to come
up with commits split in a way that makes sense.

About the changes themselves, feel free to comment (and nitpick on the
style); if I don't hear anything, I'll assume it's all OK.

I added one more commit which actually does something:
https://github.com/mardy/subsurface/commit/f1b180afcd3398fec5c0c438ca86b01ab0acc69d

Now when you start subsurface you'll see two windows, the usual Gtk+ and
a new Qt one (who said that Gtk+ and Qt cannot co-exist? ;-) ).

The Qt window does nothing, I just added it to test the i18n (it seems
that getting gettext work with Qt is quite easy), the moc and uic (the
file ui/main-window.ui is created with Qt Designer).


Let me know if the usage of Qt Designer files is OK or if you prefer to
see all the Qt code in .cpp files (I suspect the latter, since you were
not using Glade). I actually never used Qt Designer myself before (my
QtWidget needs were always minimal), but I'm starting to like it. :-)


Another thing that you (and especially other Qt developers here) might
want to comment about, is the definition of C++ classes in the .cpp
files themselves (and not in a header file).
I usually declare and define the private classes (those that don't need
to be visible outside of the .cpp file) in the .cpp file itself, while
generally Qt developers (at least KDE ones) prefer to have the
declaration in a separate header file, leaving only the methods
definitions in the .cpp file.  I find it more annoying than helpful (it
increases the number of files, and force switching files in the editor
often than necessary), but might be just me. :-)

> As Linus said - we are totally fine with switching to QSettings.

Excellent!

Ciao,
  Alberto

-- 
http://blog.mardy.it <- geek in un lingua international!


More information about the subsurface mailing list