[Code] Experimental Qt5 frontend port, with code!

3 replies [Last post]
Worldblender
Worldblender's picture
User offline. Last seen 44 weeks 18 hours ago. Offline
Joined: 2017-06-17
Posts: 16

All the files in one place:
http://45.21.218.32:81/hedgewars-work/QT5frontend.zip
Browse the files individually, including screenshots of some defects:
http://45.21.218.32:81/hedgewars-work/QT5frontend/

readme-newfrontend.txt allegedly wrote:

This is the Hedgewars frontend, ported from Qt4 to Qt5. It's a work-in-progress, and is still not 100% functional yet.
What works:
  • Basic navigation to most of the pages
  • Connecting to the internet
  • Watching saved demos
The source code here has also been changed in these other ways:
  • Some of the FileEngine functionality has been removed, as QAbstractFileEngine and related classes have been made private in Qt5, and there is no drop-in replacement for this.
  • A few other CMakeLists.txt files have also been changed so that the frontend gets linked to Qt5 libraries instead of Qt4 ones.
It has only been tested on Ubuntu 16.04 GNU/Linux so far, but it is likely that my changes can compile successfully on other platforms as well.
Included in this pack are QTCreator files for use with that IDE, and an x86 64-bit binary for sampling purposes. Compiled object and meta-object files have been removed in order to make this pack smaller.

I made these changes that could be backported to the Qt4 version if it is kept:

  • Prefer user style instead of hardcoding the Plastique style.
  • On the game stats page, change both mentions of "his" to "its", so as to not assume that teams have only male hedgehogs.

The following things are noticable defects, currently (they are presented in most of the bundled screenshots):

  • Loading hats, themes, image maps, missions, scripts, and translations will not.work, most likely due to the changes I made to the FileEngine as described above.
  • Images for the game modifier buttons are shrinked, and the no signs are cropped due to this.
  • On the game stats page, for the health graph, the lines appear to be thick vertically and hard to see horizontally.
  • The frontend will crash shortly after appearing if used with the Oxygen style, probably because the custom colors could not be applied to that style.
There may be some more bugs that I might have not yet seen yet, but these are what I noticed so far. Other than what I described above, the frontend functions just like the Qt4 version.

How to use: Overlay all of the files (excluding this readme and the screenshots provided) on top of an existing Hedgewars source directory, at the root. Backup the files that will be overwritten, if necessary. Then build the project as normal; the hwengine is (almost) unaffected, except that it may have trouble trying to find the needed files if started as a quick game.


There may be more changes coming to this code, if they are needed. I really tried my best to do all that I could, but I'm not yet comfortable in doing major rewrites, especially with the FileEngine functionality.

Lyberta
Lyberta's picture
User offline. Last seen 7 weeks 4 days ago. Offline
Joined: 2016-09-10
Posts: 177

You may want to use gender neutral "they" instead of "it".

nemo
nemo's picture
User offline. Last seen 39 min 54 sec ago. Offline
Joined: 2009-01-28
Posts: 1704

It would be nice if you'd worked off the existing one instead of starting a new one...
I'd suggest coming by irc://irc.freenode.net/hedgewars to discuss...
https://hg.hedgewars.org/hedgewars/shortlog/01f88c3b7b66 qmlfrontend branch

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Lyberta
Lyberta's picture
User offline. Last seen 7 weeks 4 days ago. Offline
Joined: 2016-09-10
Posts: 177

I think he just updated Qt widgets frontend to Qt 5. QML frontend is something completely different.

Copyright © 2004-2017 Hedgewars Project. All rights reserved. [ contact ]