patchFreeciv - Patches: patch #3367, A bit playable qt-client

Show feedback again

patch #3367: A bit playable qt-client

Submitted by:  mir3x <mir3x>
Submitted on:  Wed Jul 4 22:03:34 2012  
Category: client-qtPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Sat Jul 14 23:23:09 2012, comment #8:

Configure check discussion moved to patch #3417.

Jacob Nevins <jtn>
Project Administrator
Sat Jul 14 22:00:56 2012, comment #7:

I've had gui-qt in my trunk builds for a while. Now this is in, I'm getting:

It seems the method 'setPlaceholderText' was introduced in Qt 4.7. I'm on Ubuntu Linux 10.04, and it seems I have Qt 4.6.2.

My distro is now quite old (it's an LTS, but not the latest LTS), so I don't feel aggrieved not to be able to build the Qt client, but I guess we need some configure checks and advertised minimum versions of things.

Jacob Nevins <jtn>
Project Administrator
Sat Jul 14 20:22:05 2012, SVN revision 21547:

Implemented everything required to move units on map and more
on Qt-client.

Patch by mir3x with stylistic changes and marking some
strings for translation by me.

See gna patch #3367

(Browse SVN revision 21547)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu Jul 12 01:23:31 2012, comment #5:

- Removed more extra spaces between function names and argument lists
- Corrected some comments
- A couple of more strings marked for translation

(file #16066)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun Jul 8 22:47:35 2012, comment #4:

First, I'd like to stress I know very little about Qt.
Having said that, after gtk3 client, I have an idea or two that somebody how knows Qt better could adapt.

1. curved line: with cairo, I've done it through cairo_curve_to - AFAICT, in Qt similar effect would be QPainterPath::cubicTo

2. fog - this problem I've sidestepped by CAIRO_OPERATOR_HSL_COLOR (it was extremely lucky that cairo 1.10 added this); unfortunately, I don't see similar operator among CompositionMode enums, but while does something a bit different, it suggests something similar could be done for HSL (though the question would be: can it be done with acceptable performance ?)

Sun Jul 8 20:55:37 2012, comment #3:

I went through the style. I have not yet checked the patch otherwise. There was quite a bit to fix, even if I took relaxed attitude on some details. Some of these things are badly worded in CodigStyle; I'll try to update it a bit after this experience.

- From freeciv perspective Qt headers are system headers, so they are included before any freeciv headers
- Quite a many places you had forgotten {} around single line if, else, for, while, etc blocks. Even complex "for() if singlecommand; else singlecommand;" was found
- "*" in front of each comment line in multiline comments does not apply to function headers
- There's no space between function name and "(". I think your "_ (" constructs even break gettext string collection mechanism, so it's a real bug

The only functional change I did was addition of translating of most of the new strings - for some that need code restructuring to work properly I just added FIXME comment.

(file #16032)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat Jul 7 15:12:27 2012, comment #2:

Previous bug removed ( added add_idle_callback which resolved infinite loop )
Known bug - doesnt work with isometric ( amplio2 ) but under gdb runs ok somehow ...
Added first mouse handling ( move map via right click and select units via left click )
Added some menus to make basic stuff like roads ...
Added information bar about gov, turn, time + icons
( changed from left to small down, minimap could be floatable then and unit info )
Fixed Coding style mostly I think

(file #16005)

mir3x <mir3x>
Project Member
Wed Jul 4 22:41:29 2012, comment #1:

Thank you. Seems like big step forward for Qt-client.

- Please read doc/CodingStyle. Though it's not yet updated to reflect the fact that Qt-client is C++, and not C, most of it still valid ( "if (" and not "if(", block required even for single command after if... )

- Compiling with --enable-debug -> -Werror:

../../../../src/client/gui-qt/mapview.cpp: In function 'void pixmap_put_overlay_tile(int, int, sprite*)':
../../../../src/client/gui-qt/mapview.cpp:224:6: error: no previous declaration for 'void pixmap_put_overlay_tile(int, int, sprite*)' [-Werror=missing-declarations]

../../../../src/client/gui-qt/optiondlg.cpp:38:35: error: 'option_dialogs' defined but not used [-Werror=unused-variable]
../../../../src/client/gui-qt/optiondlg.cpp:99:13: error: 'void option_dialog_option_apply(option*)' defined but not used [-Werror=unused-function]

../../../../src/client/gui-qt/pages.cpp: In function 'void create_conn_menu(player*, connection*)':
../../../../src/client/gui-qt/pages.cpp:336:6: error: no previous declaration for 'void create_conn_menu(player*, connection*)' [-Werror=missing-declarations]
../../../../src/client/gui-qt/pages.cpp: In function 'void server_scan_error(server_scan*, const char*)':
../../../../src/client/gui-qt/pages.cpp:598:6: error: no previous declaration for 'void server_scan_error(server_scan*, const char*)' [-Werror=missing-declarations]

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed Jul 4 22:03:34 2012, original submission:

Added primary widgets
Connect to game possible via network page or ./fcgui -a
( start or load not working but widgets completed )
Visible map and moving units via numpad and arrows.

some bug: after connect if any city is not visible and after resize would be visible, client will lockup in endless loop
fill_sprite_array )

if city is already visible or after unit movement is visible then it works ok. It happens only at first resize.

mir3x <mir3x>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #16066:  BigQtImpr-2.patch.bz2 added by cazfi (18kB - application/x-bzip)
file #16032:  BigQtImpr.patch.bz2 added by cazfi (18kB - application/x-bzip)
file #16005:  qt.patch added by mir3x (111kB - application/octet-stream)
file #15974:  qt.diff added by mir3x (71kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by mir3x (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Jul 14 20:22:18 2012cazfiStatusReady For Test=>Done
    Thu Jul 12 01:23:31 2012cazfiAttached File-=>Added BigQtImpr-2.patch.bz2, #16066
      Assigned toNone=>cazfi
    Sun Jul 8 20:55:37 2012cazfiAttached File-=>Added BigQtImpr.patch.bz2, #16032
      StatusNone=>Ready For Test
    Sat Jul 7 15:12:27 2012mir3xAttached File-=>Added qt.patch, #16005
    Wed Jul 4 22:41:29 2012cazfiPlanned Release=>2.5.0
    Wed Jul 4 22:03:34 2012mir3xAttached File-=>Added qt.diff, #15974
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup