Tag Archives: GUI

Qt Pig Latin Translator

The Tutorial

About a week ago, Braden the Software Guy wrote a daily program to translate things into Pig Latin. I liked the program, so I decided to throw together a quick program using his code for the actual translation. The original program on his blog can be found here. Below is a video detailing the nifty program:

Hopefully I can find time to make a tutorial. It was a pretty big program though, and it took me a few hours to make.

Restoring Qt Application State and Geometry: Part 3

Read the Second Tutorial

So by now we have a complete application, but I’d like to pull out a few extra tricks. Primarily, I want to make the application store the state even if there isn’t any user interaction. This could be very useful if your application is a complex GUI comprised of several toolbars, etc. By implementing a continuous loop of state storage, even if your application crashes, the data will be preserved from a certain amount of time before. We’ll need to change a few things first, however, starting with the MainWindow declaration:

Continue reading

Restoring Qt Application State and Geometry: Part 2

Read the first tutorial 

In the first part of this tutorial series, we went over the main.cpp file and a brief overview of what we wanted to accomplish in this application. Now we’ll go over the MainWindow class and save the state upon close of the window. First, we’ll look at the header file:

Continue reading

Restoring Qt Application State and Geometry: Part 1

You have probably used an application that restores state and/or geometry at some point. State means how things “are” in an application, to so sum it up. Geometry is where the window was on the screen, and the size. We’ll be using some Qt functions that take care of most of the actual settings work. I’ll also show you how to override the closing event of a QMainWindow so you can inject custom code into the virtual event. For example, say you are making a text editor and you want to save the current files that are open. In addition, you’ll learn a few other things along the way, while the main focus will be QSettings.

So without further ado, let us begin!

Continue reading

Qt Fusion Style

I’ll have to say, I’ve never really liked the Windows form components. Of course with WPF and similar technologies (cough, Java, cough), C++ is kind of left out of all this new UI craze that is happening to Windows. I mean, if you open up the latest version of Chrome, the context menus aren’t even the familiar ones. Apparently the Windows UI artists had a different vision…

Amidst the emphasis on QML as the new UI language for Qt, new form styles have been ushered in to bring a new light to the dating Qt Widgets. My personal favorite so far is Fusion, which brings a more modern UI to widgets (in my opinion). I made a demo and shot a video of some components:

Got a personal favorite? Let me know in the comments!