Goodbye wxWidgets, hello Qt!

I’ve been developing various pieces of software in wxWidgets (back when it was called wxWindows!) for a long time. But recently, I’ve made the switch to Qt.

WordTsar under wxWidgets was stable, and I used it to write quite a few novels (http://geraldbrandt.com), so why the switch? Well, it seems that I always had to do something just a little different based on what platform the software was running on. Don’t get me wrong, 99.9% of the code was cross platform and worked well, but there always seemed to be corner cases.

Qt version, Windows and Linux

The last straw for me was when I tried to get WordTsar running under MacOS. I tweaked here and there. Keyboard input was a pain, but then it was under Qt as well. It was just easier under Qt because I’d already fixed the issue under wxWidgets. So, what was it that I couldn’t get working?

wxTimers.

I use timers to update WordTsar’s status bar, do word counting, and flash the carat. None of it worked under MacOS. Again, I tweaked here and tweaked there, but I just couldn’t get timers to work. Really, timers are a pretty basic function. They should Just Work.

About two years back, I did a test port to Qt to help me find an elusive bug. I moved over just enough code to help track down the bug, and stopped. This time around, I didn’t.

QT Version – MacOS

WordTsar is now 100% Qt based, with all the functionality of version 0.1 Release 1977. Well, almost. The Linux version of WordTsar had spell check working, using Hunspell. Non of the other ports did. I’ve decided to leave spell check out since I want to do it in a more cross-platform way.

What differences will you see with the Qt port? Some of the dialogs look different. Yup, that’s pretty much it.

Well, except for one thing.

Speed.

The Qt version is SIGNIFICANTLY faster than the wxWidgets version. Why? Two things in particular:

  1. Measuring of text under Qt just flies. Under Linux, measuring the widths of 605,814 characters took roughly 1800 ms. With the code optimized to measure strings instead of characters, I got that down to 460 ms. Under Qt, which can only measure individual character widths* the speed is 138 ms. That is a massive speed improvement.
  2. QString vs wxString is the second big increase. I do a lot of parsing of strings using .Mid(), .BeforeFirst(), .Left(), etc. I do no in string indexing (i.e. string[x]). Parsing WordTsar dot commands (string heavy) on a 111,000 word novel took 1060 ms under wxWidgets. With Qt, that process took 348 ms. I was planning to optimize the dot command routines to speed things up, and I still will (via some form of caching), but I can postpone that work now.

What this all comes out to, is under wxWidgets, laying out a 111,000 word document took 1670 ms. Not bad, really. Under Qt, the same process takes 576 ms. That’s a very noticeable difference.

I’ll be testing the Qt version over the next week by editing a 92,000 word novel and bringing that up to 100,000 words or so. Not a bad stress test. If all works out, there will be a WordTsar 0.2 Release xxxx happening next week for Linux, Windows, and MacOS.

* wxWidgets has GetPartialTextExtents() which, when passed in a string, will return an array of character widths. Qt has no such function. You can get the width of an entire string, but not the characters in that string. So, with Qt, I must measure each character.

Just about ready for a new release

I’ve been using Alpha 0.0.51.2014-10-07 for the last few years on both Linux (very stable), and OSX (somewhat stable). I wrote three novels using that software (http://geraldbrandt.com) and got them published by one of the Big 5. It was software that worked, but had its flaws. For example, when starting a new document, you needed to insert a pages worth of blank lines, go back to the top of the document, and start typing. That kept it stable. Unfortunately, the software had also reached its limits. Adding new features would have been a major pain.

So, I did what any developer would do… I refactored the darn thing. I’m seeing speed increases of 200% – 2000%, depending on what I’m doing. Fonts work a bit bettter. RTF import has a bug with font tables, but kinda works. Battery usage on laptops is great. Memory usage is a bit higher.

I currently have version Alpha 0.1.73.0 running on Windows 10 and Ubuntu 17.10 and 18.04 (GTK2 and GTK3). I’ll be getting OSX running over the next couple of weeks. I believe 0.1.73.0 has feature parity with 0.0.51, but I’ll have to double check. I’m working on stability now — along with the OSX port.

For a project that’s been basically dead for the last three years, this is a positive step. Keep watching, it’ll be up in binary format soon. Source code to follow (it may take awhile… I’d love to have a finished product before I release source. Who knows).

 

Long delay…

It’s been awhile since I put out a new release.  I’ve been working on (slowly) getting some of the backend formatting multi-threaded, trying all sorts of tricks with font handling, freetype, etc, etc.  Finally decided to Keep It Simple.

Page formatting is now done ‘in the background’.  It’s not perfect yet, and laptop users will notice a higher CPU usage/battery drain.  I’ll release what I have next week, and work on the issues in the coming weeks.

What is WordTsar?

WordTsar is a modern day Wordstar clone.  It is GUI based, and runs on Linux, Windows, and OSX.

I’ve been using WordTsar in all of my work for the last year. It hasn’t lost data, and it hasn’t crashed. It’s also not complete, and has a couple of bugs. It does exactly what I need to get my work done, and when I need something else, I code it. And although that method works for me, it doesn’t work for getting something out the door.

wordstar clone

So here is what I plan to do. I’ll finish the next feature set and make an Alpha Release available to a limited number of registered testers. The release will be for Windows, Linux, and OSX (see below). It’s called Alpha because it is not feature complete, and it’s only been tested by one person. What I’m looking for from my testers, is continual feedback and feature requests. I’ll try to get a voting system in place to rank the features, and work on them in order. Features will be limited to items that are available in Wordstar 7.0d only. Once WordTsar gets a bit more feature complete, I’ll allow feature requests for items not in Wordstar.

Testers Needed

Please the the registration tab above.

I’m looking for active testers, people that want to use WordTsar and make it better. If you just want to play to see what it’s like, please don’t register as a tester at this time… there will be an opportunity later on in WordTsars development cycle.

You’ll receive an email in return specifying whether you have been accepted as a tester or not. At this point, I don’t see anyone being turned down, but you never know. Your email address will be added to a distribution list I can use to send announcements.

For my part in this tester/developer relationship, I’ll do my best to get new releases out on a regular basis, and get a working Wordstar clone out the door for you.

Let me state again, WordTsar is not feature complete.  For a brief overview of what is done, see this post: http://geraldbrandt.com/2013/05/06/wordtsar-update-2/.  That page will link to a couple of other pages, where you can find more infromation.