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:
Freitag, 14. Mai 2010
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:
I hope this helps a little.
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.
Labels:
Qt C++ status-bar
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.
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.
Labels:
C++ Qt regexp
Abonnieren
Posts (Atom)