Weekend Projects #2: Simple Qt Text Editor

The second project is now complete* and here is the publication of that project! This one turned out to be a bit more complicated than I had been expecting, but it was mostly a result of trying to make sure I implemented all of Notepad’s feature set properly. This *still* isn’t completely done, for example I need a preferences system above and beyond Notepad to allow users to change the time/date format that is output upon pressing F5, but that will be for later.

Download and try out the software from GitHub here.

Tour of the Project

I wrote a set of documentation on the docs Wiki here at kirhut.com. You can find it here. Just look that over for how to use the software, it is not very complicated.

The Next Project

The next Weekend Project is already decided: A Simple File Hashing Application! This application will primarily use Crypto++ to perform file hashing, however there will also be a custom MD5 implementation included in the project, since MD5 isn’t fit for security purposes anymore and I already have a custom MD5 implementation in C++17 that would be great to show off!

Posted in Uncategorized | Leave a comment

Weekend Projects #1: Simple Dice Roller App

I’m starting a series of projects that I will complete over a single weekend to provide a sort of “repository” of example code I have written and software I can produce. These applications are intentionally not meant to be complicated, they are actually directly intended to make it simple to see how to write simple C++ applications with Qt 6, or more specifically, how I write C++ applications with Qt 6.

The first project I did this with is posted here, a Simple Dice Roller Application. This application can be downloaded from Github here. I’m not currently providing precompiled binaries but I will do that eventually as well.

Tour of the Project

The project is made up of three primary class objects: The MainWindow, the DiceWidget, and the DiceRoll. The MainWindow is the primary window of the Dice Roller application and provides the main user interface, as well as the majority of code. All of the button event handlers are coded in the MainWindow class, and most of the application’s event logic is within this class. Since this application is not very big, the MainWindow class ended up being a bit of a God Object, but even with that it is only 200 lines of code if you count all the whitespace, so the actual amount of logic is not that big.

The DiceWidget class is a Widget class that provides a widget you can roll a particular kind of dice with. The Dice Roller allows you to roll all of the conventional D&D dice, however it is also possible to use any arbitrary number of faces (after all, the app just generates a random number between 1 and X, where X is the number of faces). Each widget also allows the user to have up to 99 of a particular dice, and can set an addition or a multiplier on a per-die basis or to the total of the whole set of dice being rolled. This allows for a large number of unique dice rolls that can calculate bonuses immediately.

The DiceRoll class is actually a simple data class that randomly selects a set of numbers each time it is created. After it is created, the data is constant and cannot be changed. The actual random number generation is done by the DiceRoll class directly, using a C++ standard Mersenne Twister engine to generate the random values. Weighing in at only 60 lines of code, this class is quite compact and efficient, and reliably generates random values very quickly.

The Next Project

The next Weekend Project is already decided: A Simple Text Editor! This should be about as (not) complicated as this weeks project, so similarly it should not take all weekend to do and more like just a Saturday afternoon. I have a life so I have a lot to do despite my desire to do this on a consistent basis. We will see how long this lasts!

Posted in Programming, Weekend Projects | Tagged | Leave a comment

New Website

I’ve changed how kirhut.com works. It was a family website but it is time to use this for our security software products. The KirHut Security Company is dedicated to making using the Internet more secure for everyone, and to help you maintain your privacy in a world bent on taking it from you.

The old website is still available but wasn’t really used much. I am going to make it work in a subdomain but some unforeseen technical issues are preventing me from doing that correctly for now. I may end up simply making it part of the internal home network.

My intentions for this domain are big. I’ve set up a Dokuwiki documentation wiki server on this domain as well on the Documentation link in the main menu, and will start moving over docs I have internally there. I will also provide access to all of the source code I have been working on through here, though I have not decided how. Either I will provide a GitHub link or will create a Gitea instance at kirhut.com to provide sources from.

Thanks for visiting, but right now, there isn’t much here!

Posted in Main | Tagged , , | Leave a comment