Chip-8 Dev Challenge: Frame Rate

Introduction Chip-8 runs at 60 fps (frames per second) and it’s very important to maintain this frame rate. Unlike modern systems, the sound and delay timers are tied to the frame rate. If the frame rate is too fast or too slow, the timing within apps will be off. Also, some apps will time off of the VSync (vertical synchronization). Making the frame rate even more important. I tried multiple methods to maintain a consistent frame rate in Chipped-8 and in the end I was able to achieve a solid 60 fps....

April 21, 2024 · John

Effective Threading Using Qt

Effective Threading Using Qt Introduction Over the years using Qt I’ve seen a lot of difficulty using threads with Qt. Threads can be difficult and Qt provides a lot of ways to make threads easy to work with. Still basic / direct / low level threading (I’ll just call this basic) is often seen as difficult with Qt. It really isn’t though. There are three main ways I’ve seen people handle basic threading in their Qt applications....

May 2, 2015 · John

Extending an Application with Lua Plugins

Introduction A very common use of the Lua language (which is a very versatile) is using Lua to extend an application via plugins. Many popular games use Lua for this very purpose. Adding a plugin framework to an existing application is trivial with Lua. Also, Lua provides a very capable and easy to use language for writing plugins. To demonstrate using Lua for plugins I’m going to make very basic text editor and allow features to be added via Lua scripts (user installable plugins)....

August 16, 2014 · John

Retrieve Formatting Set by QSyntaxHighlighter

I have been working on adding inline spell check to Sigil recently and ran into a quirk on Qt that isn’t immediately obvious. I ended up having to look though the Qt source code to understand exactly what was happening. When dealing with a QPlainTextEdit you can get the QTextCursor and use the charFormat() function to retrieve the QTextCharFormat for the character before the cursor. This does not work when the formatting is set by a QSyntaxHighlighter!...

October 29, 2011 · John

Sigil Now Supports Translations

One of the the new features that has been implemented for 0.5 (release date yet to be determined) is support for Translations. For Sigil’s first supported language Grzegorz Wolszczak has provided a Polish translation. Currently translations are loaded based upon the current system locale. There no support for choosing the language via preferences. This may come at a later time but for now I believe that using the system locale will handle the majority of user needs....

October 8, 2011 · John

Qt Remove Directory and Its Contents

When dealing with directories, Qt has a large number of functions to make manipulating them easy. However, it does not include a way to delete a non-empty directory. This little omission is easily solved. Following is a recursive function that will delete a directory along with all of it’s contents. This will delete depth first. Meaning it will recurse into sub-directories and only start deleting once the directory has no sub-directories....

June 8, 2010 · John

lebookread

I have been taking a short break from blogging again. The pressure at work has only increased and is eating into a lot of my time. I haven’t been motivated to work on personal projects because well they are work. However, this has recently changed a bit. I’ve started a Qt based library for reading ebooks in a generic manner. It is called lebookread! It is it’s early stages. So far I have it supporting epub, palmdoc pdb, ztxt pdb, tcr, and rb files....

May 16, 2010 · John

KDocker 4.2 released

This release includes bug fixes as usual. Some new features: bash completion, iconify on focus lost option and Italian translation thanks to Alessio Cassibba. There is also a small change to the behavior when activating the tray icon. If the window is not visible it will become active and if it is active it will iconify. You can get it at the launchpad page. Somehow I forget to mention the 4....

September 27, 2009 · John

KDocker 4.0

Recently I’ve become the maintainer of the KDocker project. KDocker is a Qt application what allows you dock any application into the system tray. It currently supports any X Windows system. What I’ve done for the 4.0 release is, move the project to launchpad (Girish, the creator of the project is locked out of the Source Forge page) and port/re-write the entire app to use Qt 4. The port/re-write to Qt 4 is complete and I’ve released it....

September 16, 2009 · John

Niw Markdown Editor

For the past three weeks I’ve been working on an editor for working with plain text files and making it easy to add markdown syntax to them. My main goal is to make it easier to format the large number of ebooks I have. Almost all of them are plain text files. It’s a python project using PyQt4 and I’m hosting it on Launchpad. here is the project page and you can find some screen shots here....

August 30, 2009 · John