Qt
Qt is a GUI toolkit developed by Trolltech and now controlled by the Qt Project. It is the native graphical API for KDE and as such is available for all of the main Linux distributions.
NetHack offers an interface based on Qt. NetHack 3.3.0 through 3.6.0 is compatible with Qt through version 3. It is not compatible with Qt 4 or 5. Because Qt 5 is the current version, the older Qt interface is difficult to build on modern systems. Furthermore, the NetHack 3.6.0 source has a corrupt version of include/qt_xpms.h (bug S360-2); the version of this file from NetHack 3.4.3 must be substituted.
NetHack 3.6.1 offers a revised interface compatible with Qt 4 and 5. With some modification, it can be made to build on Microsoft Windows and Mac OS X. NetHack 3.6.2 has the necessary files to build with Qt 5 on OS X. Unfortunately, the Windows build is broken.
Contents
Features of the Qt interface
The Qt interface supports tiles and text display. It uses tiled mode by default, but the text mode display can be enabled by setting the ascii_map option. Due to a bug in the older Qt interface, it is necessary to redraw the map (press control-R) after changing ascii_map; this is fixed in the Qt 4/5 interface.
A user has suggested improving this page or section as follows:
"Note how to set item counts in the inventory display"
Special configuration options
The Qt interface supports a number of unique options in the configuration file; as only Unix supports Qt, this will be ~/.nethackrc . Some of these can be set from the Game|Qt Options... menu entry.
Option | Values | Meaning |
---|---|---|
QT_TILEWIDTH | 1 to 64 | Width of tiles as displayed |
QT_TILEHEIGHT | 1 to 64 | Height of tiles as displayed |
QT_FONTSIZE | t, s, m, l, h | Size of fonts used on the screen: tiny, small, medium, large, huge |
QT_COMPACT | 0 or 1 | If 1, the message and status windows are on separate pages from the map, and the map is
enlarged to cover most of the screen except for a single line for the messages. |
Note that QT_TILEWIDTH and QT_TILEHEIGHT are the size of the tiles as displayed, not as stored in the tileset. If using Absurd64, for example, you would set OPTIONS=tile_width:64,tile_height:64 as always, but QT_TILEWIDTH and QT_TILEHEIGHT can resize the tiles to whatever size you want.
A user has suggested improving this page or section as follows:
"Get a screenshot of the compact mode"
Compiling
Linux
Use the hints file hints/linux-qt4 or hints/linux-qt5. Depending on the distribution, it may be necessary to edit the hints file to set the MOC variable. Typical values include:
- MOC = moc
- MOC = moc-qt4
- MOC = moc -qt=4
- MOC = moc-qt5
- MOC = moc -qt=5
Mac OS X
Use the hints file hints/macosx-10.10-qt. This hints file works with a Qt 5 installation from Homebrew.
Windows
The build of NetHack with GCC is badly broken in 3.6.2, and the makefile for Visual Studio lacks instructions for building the Qt interface. No build instructions for Windows are available at this time.
This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.6.2. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-362}} tag to the current version's tag or {{noversion}} as appropriate.