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.

Samstag, 13. März 2010

Linking to a specific subversion revision in urls

Yesterday I did some documentation work at my company and had to archive a documentation link in our Lotus Notes databases. But after reflecting the link a little I thought it would be better to link not to the subversion HEAD because the document I was linking to can be moved or modified. It would be more better to link to the actual revision. I was not able to find something helpful in the svn docs.

But I found this helpful link. Searching the "/!svn/bc/" in google gave the following also interesting link to stackoverflow.

Per posted: "Now, to easily browse an earlier revision of the tree, simply edit the URL and insert "/!svn/bc/<revision number>/" after the svn root"

For the Fashion girls ;-) source tree revision 4 this looks like this:

http://fashion-girls.googlecode.com/svn/!svn/bc/4/trunk/src/FashionGirls_GAE/

This is the regular link to the HEAD of the trunk:

http://fashion-girls.googlecode.com/svn/trunk/src/FashionGirls_GAE/

The difficult part for me was to find the svn root path of our companies svn server url. For this I had to play around a little bit. Otherwise maybe wireshark is a option ;-)
I hope this helps someone other than me.

Samstag, 30. Januar 2010

Posting Source Code, an approach

After reading this post, I had to try this by my own.

Some litte cpp code:

Java Script:

Lua Code:


This does not look too bad, isn`t it?

The Lua syntax highlighter is not part of the official release. But you can get it here.

There was also a little change in the installation. The modified include lines can be found here. The code hosting is no longer by google code it can be found here.