Freitag, 14. Mai 2010

The next step to plug-ins enabled Qt GUI

Today I'll give an example on how easy it is to figure out the root path of an Qt Application. There is a wonderful static Method in the QCoreApplication class called applicationDirPath(). This method returns the directory that contains the application executable. This is very useful to get the application's plug-in directory. Under Linux this even works if links to the executable are used.



The result looks like this:

Dienstag, 11. Mai 2010

Manipulating the status-bar in QT Applications

Here are some hints to modify the QStatusbar of an Qt Application.

In the constructor of the derived QMainWindow add a call to the
initConnectToolBar method.


The initConnectToolBar method itself looks like this:


The result will look like this:





I hope this helps a little.

Donnerstag, 6. Mai 2010

Check for correct ip-address in QtCombobox while typing

This can be don with the help of the QRegExpValidator class.

Here is a short example:


Now you can only type in a valid IPv4 Address. The 0.0.0.0 and 255.255.255.255 are accepted as well.

The regexp is from this page.