…just another hippy blog

Tags: Development, QtNovember 6, 2007 2:31 pm

Are you sure? Come on! Are you serious? Do you really want to quit the application and have a real life? 

 

Lately I was looking for a way to disable that nifty little close (X) button on a window title bar. There is no way to do this using Qt code so I had to write my own platform dependant code.

This is the macro I am using on Windows:

# ifdef Q_OS_WIN
#  include <windows.h>
#  define ENABLE_CLOSE_BTN(Enable) \
    { QWidget* tlw = this; \
    while (tlw && !tlw->isWindow() && tlw->windowType() != Qt::SubWindow) \
        tlw = tlw->parentWidget(); \
    HMENU hMenu = GetSystemMenu((HWND) tlw->winId(), FALSE); \
    EnableMenuItem(hMenu, SC_CLOSE, Enable ? (MF_BYCOMMAND | MF_ENABLED) : (MF_BYCOMMAND | MF_GRAYED)); }
# endif // Q_OS_WIN

The macro can be used from any widget (e.g. a QWizardPage) as it will automatically look for the parent top level widget.

I still haven’t found a way to achieve the same on X11 or Mac OS X. Any suggestions? Anyone reading this blog? No? Rats, I knew that! 

Tags: Development, Qt, Qt JambiNovember 1, 2006 6:08 pm

Qt Jambi Artwork

Trolltech releases the third and last technical preview of their Qt bindings for Java. Lots of work has been done since the TP2 and lots of work still needs to be done.

This version is based on Qt 4.2 and thus it can benefit from the new features in Qt 4.2 (see my previous post). Some of the major changes include support for SVG graphics (this was added to Qt 4.1), the QGraphicsView (there’s a funny demo showing some mice ;) , support for JavaDoc and "real" enums.

Some words about enums: C++ and Java enums are conceptually very different. Enums are used in different ways in Qt. Some examples are the QEvent::Type extensible enumerator and the or-combinable flags in QIODevice::OpenMode. Java flags can only be used as enumerators. TP3 solves this issue allowing to use enums with Qt even if the syntax is sometimes different.

The Eclipse plugin has been updated too, and lots of bugs have been fixed. I used it for some hours without Eclipse crashing! The Qt Jambi resource system still needs to be integrated into the Qt Jambi Designer (and it’s Eclipse integration). You can add resources using the Action Editor in TP3, but the JUIC would produce wrong prefixes and the files woun’t get loaded. Trolltech developer Eskil Blomfeldt has told me that this issue will be solved in a future release and we will be able to use the resource system with the Qt Jambi Designer too.

I was reading some posts on the Trolltech Qt-Interest archive and it seems that KDevelop developers are working on a Java language parser. This means we may be able to see a Qt Jambi plugin for KDevelop in (a not so near) future. Jakob Petsovits and Italian Roberto Raggi (a former student at my own University in Pisa ;) should be the main developers for the Java-code.

Tags: Development, Qt, Qt JambiSeptember 8, 2006 7:55 pm

Trolltech recently released the second (out of three planned) technology preview of the Qt bindings for Java: Qt Jambi.
This should be some good news for the many Java developers out there… a big mass to which I will always refuse to belong ;)
The project currently seems more an experiment as a real commercial product. Trolltech itself still does not know when (and if at all) the final product will be released.
As to my precious opinion (sure, laugh!!) I bet they will release it pretty soon. And with lots of bugs, at least until version x.1.

(more…)

Tags: Development, QtJuly 6, 2006 11:26 pm

I finally found some time to take a look to the new Qt 4.2 technology preview (http://doc.trolltech.com/4.2/qt4-2-intro.html).

It seems like people at Trolltech are still doing a great work. I really love the Qt toolkit (well, I think you either love it or you hate it and prefer writing CLI apps or lisp powered GUIs ;) and every release seems adding great new features, besides to usability and performance enhancements.

Here are just some of the new features:

  • Desktop Services for accessing common desktop services
  • Graphics View – A powerful 2D graphics area for highly optimized graphics development
  • Widget stylesheets
  • QWidgetAction allows to add QWidgets to menus
  • Text completition framework
  • Support for Inter-Process Communication (IPC) using the D-BUS protocol on Linux and Unix systems
  • QNetworkInterface class for detection and reporting of network interfaces
  • A new Scalable Vector Graphics (SVG) icon engine
  • Qt’s keyboard handling has been improved to support physical key recognition

The final release of Qt 4.2 is currently scheduled for the fourth quarter of 2006. As with Qt 4.0 and 4.1, I would prefer to wait for the first bug fix release of the Qt 4.2 series (4.2.1 or later) for production use.