QHacc FAQ

This is the QHacc Frequently Asked Questions section of the manual. It is been updated for QHacc v2.7.2, and should stay reasonably up-to-date. If you find anything in the questions and answers that is vague or just plain-old wrong, please write to ryan@ostrich-emulators.com. If you have a question you do not see in this list, please write to the same address to have it added.

Questions:

  1. I just started QHacc, what do I need to do now?
  2. Is there an easier way to enter a lot of old transactions?
  3. Why does the account viewer get all funky during resizing?
  4. How do I graph more than one account at a time?
  5. How do I upgrade from version X to version Y?
  6. What happened to --enable-debug?
  7. How can I translate QHacc / How do I make my language work?
  8. What's with the qm files instead of po files?
  9. How do I run QHacc on Windows?
  10. Can QHacc read my Gnofin datafile?
  11. What about Quicken's .qif files?
  12. How can I use MySQL as a backend to QHacc?
  13. What's the biggest transaction QHacc can handle?
  14. How can I write my own plugin for QHacc?
  15. How do I install QHacc to a non-default location, or move it to one?

Answers:

Q I just started QHacc, what do I need to do now?
A Unlike some accounting programs, QHacc does not automatically start with a ready-made setup. If you just unpacked QHacc, a complete and operational setup is available in the qhacc/contrib/easysetup directory. The easiest way to get started is to copy this directory somewhere, say /home/ryan/.qhacc, and start QHacc with the -f option. The steps are simple: Obviously, you should really try to use your own login name instead of mine.

If you don't like using the -f option, you can alternately set a QHACC_HOME environment variable in your shell. If you use any of the bourne-like shells, then type

If you're a csh person, the command might look something like
Q Is there an easier way to enter a lot of old transactions?
A There is a QHacc plugin that provides a means of importing data from Quicken's QIF export. As other plugins become available, this range of options will increase. Simply run QHacc with the --import option.

If you keep your old transactions in a checkbook, then there isn't any way around entering them manually. However, QHacc has many useful features for speeding the process. First, change your preferences to use "Auto-Complete on" all or new transactions. With this option, QHacc will try to use data from already-entered transactions on the new transactions. After typing in the payee, QHacc will supply the sum, memo, and double-entry account field automatically. If there is some ambiguity for a payee, you can go to the sum field and press the up and down arrows for other payments from that payee. Another useful feature is to highlight the last transaction entered, and use the "i" key instead of hitting the spacebar over "<new>" button to create a new transactions. This makes the transaction editor use the date from the already-entered transaction as the date for the new transaction. Hitting the spacebar uses the current date, which is probably annoying if you're trying to enter old transactions.


Q Why does the account viewer get all funky during resizing?
A This question originally pertained to an older version of QHacc that didn't work well with opaque, or "show contents of window during resizing" resizing. The solution was to make QHacc quit trying to work. More recent versions resize windows much more gracefully, but the column headers are still a problem. The solution here is to simply resize a column header, and the remaining headers will resize correctly. I used to think I'd get to this bug eventually, but now I fear this is a bug that will never be fixed.
Q How do I graph more than one account at a time?
A You can graph more than one account at a time by holding down the control key and selecting another account, or by holding the shift key and selecting a whole range of accounts.
Q How do I upgrade from version X to version Y?
A Usually, different versions of QHacc remain backward compatible. Unfortunately things do change occasionally, and datafiles can become incompatible between versions. Upgrading is (hopefully) painless. The first step is to make a backup of all your datafiles. Then, restore any archived transactions you may have created, and run the appropriate upgrade script.

Upgrade scripts work from one revision to the next, but they do not work for more than one revision. That is, if the data format changes from version 1 to version 2 and from version 2 to version 3, the upgrade script provided in version 3 assumes the datafiles are in the format of version 2. Luckily, all upgrade scripts are provided in the download tarball, so upgrading even several revisions should be possible.


Q What happened to --enable-debug?
A QHacc used to have an --enable-debug option to configure. That option was removed in version 2.0. The reason is that debugging information is now controlled at runtime instead of compile-time, and that control is much more fine-grained than the --enable-debug provided. There are currently 6 levels of debugging/error handling information:
   0: no debugging nor errors
   1: fatal errors only
   2: errors that affect operation
   3: errors requiring default values to be used
   4: major debugging information
   5: minor debugging information
   6: for the curiosity cat
To make the output a little more customizable, errors are printed to standard error while debugging information is printed to standard out.

--enable-debug also used to enable compilation with the -g option to gcc. That option made the compiler include debug information in the executable. The same behaviour can be obtained directly through make by using: make CXXFLAGS="-O2 -g"


Q How can I translate QHacc / How do I make my language work?
A QHacc has the beginnings of internationalization (i18n) support included. As with most aspects of QHacc, I don't know how it's "supposed" to be done, so I'm feeling my way along. However, Qt has some excellent support for i18n. (By the way--just because I only recently found out--internationalization is called i18n because there are 18 letters between the i and n in internationalization. I still don't know why localization is called l10n, though.) In any event, creating a translation for QHacc is rather easy if you have the Qt tools. You'll need lupdate and linguist (or lrelease), all of which are available for free in the Qt sources.

First, you need to start with a .ts file. This can be created using the lupdate.info file included with the sources in the src directory. Edit that file to include your i18n code. (i.e., qhacc_de_DE for German; qhacc_en_US for American English.) Then, run lupdate on lupdate.info to create the ts file. If you have trouble, contact me, and I'll be happy to make the ts file for you. If you followed the example, running lupdate should create a qhacc_de_DE.ts file.

The ts file is a simple XML script that contains the needed translations and their translated texts. You can edit it by hand, though Qt provides a tool called linguist that significanly enhances the experience. When you are done with the translation, call lrelease to make a .qm file. If you used linguist, there is an option to create a release from the open ts file. This qm file contains your translation QHacc. So how do you use it?

Using the qm file is a bit clunky at this time, though it does work. To use the qm file, just set your LANG and QHACC_LANGDIR variables. The LANG variable should be whatever your international code is, and QHACC_LANGDIR is where the qm file is. To continue our example, a German user would set LANG=de_DE, and QHACC_LANGDIR to /usr/local/qhacc/share, assuming that is where they put the qm file. Restart QHacc, and it should be in your language. (Localization--things like decimal point and currency symbol--is slightly different from internationalization. Right now, QHacc's support for l10n is limited to the options in the preferences dialog. There is no automatic l10n support.) By default, QHacc will install the available qm files into /usr/local/qhacc/share.

QHacc is currently only available in English, as that is the only language I can reasonably speak. I am working on a Spanish translation as well, but it may take some time. If you are interested in translating QHacc, I would love to hear from you. If you're a bit worried about the work, it is VERY easy to make a translation.


Q What's with the qm files instead of po files?
A Qt's native translation file is a .qm file. GNU uses .po files, but that requires the gettext package. One of the goals of QHacc has always been to require the fewest possible number of dependencies. Even though nearly every system around has gettext, I decided to stick with Qt, since I'm reasonably certain if you can install QHacc, you have Qt on your system.
Q How do I run QHacc on Windows?
A QHacc can run on Windows, but not natively. It requires the cygwin-qt dlls to properly compile, and the cygwin dll to run. The packages are available at
cygwin.kde.org and cygwin.com. Cygwin has a graphical installer which is very easy to use. Just make sure you download the XFree86 system as well, or QHacc won't be able to open. QHacc's configuration script can recognize a Windows install and operate accordingly. It looks like the Qt dll requires the gcc2 compiler to correctly link, however.
Q Can QHacc read my Gnofin datafile?
ANot exactly. QHacc is distributed with a script called importGnofin084.sh in the /contrib directory. This script attempts to convert Gnofin's datafile to QHacc-readable files. There are some caveats to its use: Also, since the current version of QHacc no longer uses the 2.2 file structure, you will need to run an upgrade script to use the newly-created datafiles with QHacc. If there is a demand, more scripts can be created to handle the conversion.


Q What about Quicken's .qif files?
A Currently, there is a preliminary process for converting Quicken's .qif files to QHacc datafiles. The file format is pretty well documented, but it seems that not even Quicken creates valid .qifs all the time. In fact, Intuit, Quicken's maker, apparently discourages using .qifs for all but the most rudimentary backups. QHacc provides QIF support via an import plugin. Simply install the plugin and run to import the data into QHacc. If you can download your statements from your banking institution, you can also run to automatically reconcile those transactions.

Q How can I use MySQL as a backend to QHacc?
A QHacc supports MySQL as a backend as of version 2.5, but that support was moved to a plugin in version 2.7. Setting this up is more complicated than using local files, but once configured, there is no real operational difference. QHacc relies on the MySQL++ APIs for database connectivity. These libraries must be correctly configured prior to compiling the plugin. Once installed, the following steps must be completed. The only noticeable difference between writing to MySQL and writing to a local file is that the idea of "saving" data is nonexistant. Data saves take place whenever QHacc's internal tables get updated. As such, there is absolutely no recovery from, say, deleting your checking account. You cannot quit the program without saving, as you can with local files. Likewise, the "Save" option from the "File" menu is meaningless.

Q What's the biggest transaction QHacc can handle?
A QHacc secretly converts all values to integers when counting them. This strategy helps reduce the rounding errors that computers sometimes make when dealing with decimal points. How big the transaction can be depends on how your particular system stores integers. On this Slackware Linux system, an integer is 4 bytes long, which translates to 31 bits for the number and one bit for the sign. 231 is 2147483648, so the largest transaction could be $21,474,836.48, but that's only if you had one. You could still get an error if you tried to add transactions of, say, $10,000,000.00 and $12,000,000.00, as you might if you were generating a report.

So, why use an integer instead of a long integer (which would allow transactions of up to $92,233,720,368,547,758.08)? There's no particular reason, other than QHacc is the "Q Home Accountant," not the "Q More Money Than Has Ever Been On The Earth Ever Accountant." I'm perfectly willing to limit QHacc's scope of use to people and families that have less than $20M in working capital.


Q How can I write my own plugin for QHacc?
A As of v2.7 or so, QHacc relies on plugins to provide most database access. The plugin interface defined by plugins.h of the lib source directory. Also in that directory is a sqldbplugin.h and sqldbplugin.cpp which is a good example to customizing the plugin interface or working with databases. localfileplugin.h and localfileplugin.cpp provide a working example of writing a plugin from scratch. It seems that there are three avenues for writing a plugin:
  1. A plugin derived from localfileplugin: Write your plugin by overloading the functions in localfileplugin.h. Link your plugin to the localfileio library.
  2. A plugin derived using QHacc's native table layout: Write your plugin by overloading the functions in sqldbplugin.h. Link your plugin to the nativedbio library. (Look at the MySQL plugin for a model.)
  3. A plugin created in any other format: Write your plugin by overloading the functions in plugins.h. Link your plugin to the foreigndbio library.


Q How do I install QHacc to a non-default location or move it to one?
A By default, QHacc installs itself in a pretty reasonable tree. It looks like this:
  /usr/local/qhacc
  /usr/local/qhacc/bin
  /usr/local/qhacc/lib
  /usr/local/qhacc/include
  /usr/local/qhacc/plugins
  /usr/local/qhacc/plugins/db
  /usr/local/qhacc/plugins/import
  /usr/local/qhacc/plugins/export
  /usr/local/qhacc/share
  /usr/local/qhacc/share/html
But QHacc uses Autoconf, so just about all the locations can change. For the most part, that's not a problem, except when it comes to plugins. Currently, plugins get installed into the lib directory and links get created in the appropriate plugin directory. However, if you change where the libraries go, the links won't work, and none of the plugins will be loaded.

The solution to this problem is the preconf file. More information about it can be found here. This file goes in the root of the QHacc installation (where ever you pointed --prefix to), and can include the token "PLUGINDIR" to point to where the plugins can be found. You'll probably also need to recreate the links or move the libraries from the library directory.

So what if you installed the binaries one place, the libs somewhere else, and you deleted everything else? That's a little more complicated, but still doable. Just find your qhacc executable. It's actually just a shell script, so you can edit it directly to change the QHACC_ROOT variable. Point that to the new installation directory (where the preconf file can be found), and change the LD_LIBRARY_PATH variable to point to the lib directory. Again, if the plugins aren't where QHacc's expecting them, you'll have to recreate the links or move the libraries.

I guess I should note that relocating QHacc isn't exactly for beginners. You should be familiar with your system and administering it in general before attempting these procedures.