PDA

View Full Version : Help ComboBox



vinny gracindo
20th November 2009, 18:45
How do I get a window keep checking, while the window is open, the currentText a comboBox?

For example:
I have a ComboBox with: Driver and vehicle.
If Driver is activated, without pressing any button, it addItems (getDriver). If vehicle is activated, without pressing any button, it updates automatic (getVehicle).

john_god
20th November 2009, 19:00
Not sure if I understand what you want to achieve.

Driver is activated (by the user ?), it adds one item (you could use the signal slot mechanism), or keep adding items until the user deactivate it? (you could use timmers)

vinny gracindo
20th November 2009, 19:27
I want the program to detect the currentText enabled in ComboBox without pressing any button.
For example:

ComboBox
----- Driver
----- Vehicle

If the vehicle is currentText I want the program calls a function. If the Driver is currentText I want him to call another function.

But I want him to ALWAYS check alone currentText of the ComboBox.

john_god
20th November 2009, 19:41
So your looking for void QComboBox::currentIndexChanged ( int index ) [signal] (http://doc.qt.nokia.com/4.2/qcombobox.html#currentIndexChanged)

If you 're using qtcreator just right click in the combox, choose "go to slot".