Qt User Interface Sample Software
March 11, 2008
Sample Source Code
I am herewith distributing the source code and executables for a series of application templates developed using C++ and Trolltech’s Qt. The virtue of these templates is that they are free, they function, and they illustrate a number of features of Qt that, absent working source-code, it might take a person some significant time to get working. There is nothing particularly novel about them.
This software is intended for use under Microsoft Visual Studio 2005. It is programmed in C++ using Qt version 4.3.4. It has been tested under Vista and XP using the commercial version of Qt. To run it you will need a recent commercial version of Qt, Microsoft Visual Studio 2005, and a machine running either Vista or XP. I have included Visual Studio 2005 .sln and .vcproj files for compilation — you are on your own if you run the open source version of Qt or use an earlier version of Visual Studio.
Installation
In order to install this software, pick a directory for the installation and create the environment variable DIR4APPS with a value equal to the installation directory path. Copy all the directories included in the distribution into the DIR4APPS directory. You should have a number of sub-directories: e.g., DIR4APPS/Build++, DIR4APPS/UtilitiesLib, DIR4APPS/SimpleUserInterface, etc.
The projects use the static link version of all Qt libraries. [Software maintenance is hard enough without adding dll hell to your list of woes.] The projects assume you have defined an environment variable QTDIR with value equal to the Qt installation directory. If you have not built Qt for static linking, it is best to reinstall Qt (version 4.3.4 is current as of this documentation) then configure Qt at the command prompt (with Qt environment variables) via:
“configure –static –qt-sql-sqlite –qt-libmng –qt-libtiff –qt-libjpeg –qt-libpng”
“nmake”
When compiling the application, you must make sure that the utility Build++.exe is findable within the Visual Studio executables search path. To inspect the Visual Studio search path, visit /Tools/Options/Projects and Solutions/VC++ Directories. Show Directories For: Executable Files. The utility Build++.exe is distributed at $(DIR4APPS)/Build++/Release.
Contents of the Distribution
This solution contains a number of progressively more complicated application templates. In total, the distribution is approximately 6,000 lines of code.
The short road-map to the interfaces is the following:
1. SimpleUserInterface – A simple application template with a display pane, a menu/navigation pane, a text output pane, context-sensitive help, an application icon, progressively incremented build number, application style sheet (a skin);
2. UserInterfaceWithDatabase – The SimpleUserInterface with a Sqlite database attached;
3. UIwDatabaseDrop – A template illustrating drag-and-drop — with associated database.
4. LoadedUserInterfaceA – The user interface of UserInterfaceWithDatabase, with the addition of application licensing, login/logout capability, hardware keying;
5. LoadedUserInterfaceB – The LoadedUserInterfaceA, with an additional capability for minimization to the system tray.
Each project contains a description of its specific capabilities in a file named Documentation.txt. A short description of how to derive a new application from the samples is included — since Visual Studio does not help in this common task.
One stand-alone utility, Build++, is included. It is the utility used to increment the project build number for every new compilation. Consult the Usage Notes.txt file in the Build++ project directory for further information.
Two application libraries are included. UtilitiesLib contains some basic utilities for non-GUI tasks like error handling and such. It is a hodge-podge of utilities that has grown by accretion, not design. UserInterfaceLib is the library containing the description of the user interface.
While it is possible to download, install, compile, and run every single sample application in this solution within a single day, it would be wise to assume you’ll need a week to get reasonably fluent with the software. The best way to learn the software is to run the applications for awhile and play around with them. Get a feel for how they function before diving into the code. Then start with the SimpleUserInterface.
Documentation
Each project is described in a Documentation.txt file. A series of subsequent blog posts will describe the projects in a bit more detail.
RSS
[...] the directions here to install the development libraries (in the course of which you will define an environment [...]
Hello, the link is dead. Leave me an email with the new URL if it’s up again. Thank you.