PDA

View Full Version : QComboBox activated signal: bad int value?



rfdutt
7th April 2008, 20:21
Hi,

I'm using Qt 3.3.3 on Linux and I think I've hit a bug with my QComboBox code.

I have two combo boxes used to represent a selection-subselection pair. When the selection is made in the first combo box the list in the subselection combo box should update.

The first combo box emits an activated(int) signal that connects to a slot function to update the second box. The activated signal arrives as expected but the int value (repesenting my selection) is garbage (-1207960452). The int value should range from 1 to 6. My slot first clears the second combo box as expected but then when I call a function to populate the list, the junk int value derails the lookup.

The same code works fine on a prior project but not on this one.

The difference is the first project uses a makefile to build so I run qmake against my project file to generate the Makefile from a template (/usr/lib/qt-3.3/mkspecs/default/qmake.conf).

The new project is using scons so I'm listing the ui file in the sources list (with a "QT" tag) and letting scons build everything. I'm pretty sure scons doesn't ever look at the project file.

I've gone through the compile outputs and resolved all differences in terms of compile/link options, etc. and I've compared the generated sources files and the source code matches. Effectively, the make and scons build solutions are as identical as I can make them.

Weird thing is, I can still build with make, link it and the activated signal works as expected. If I build with scons then activated(int) returns junk. Reverting to using make for the GUI is not really an option for me. All other widgets on the GUI work fine.

Any thoughts?

Thanks,

Rich


EDIT - I should add that I have a couple files listed in HEADERS section in the project file. These two header files get put into the generated Makefile. I don't have scons fileList.xml equivalents for these. One of these header files contains extern-ed C++ function prototypes wrapped to ensure their names get mangled with C-style name mangling instead of C++ style mangling. If some one knows the scons equivalent of the HEADERS entry it could help me.

wysota
7th April 2008, 23:29
The first combo box emits an activated(int) signal that connects to a slot function to update the second box. The activated signal arrives as expected but the int value (repesenting my selection) is garbage (-1207960452).
Hmm... isn't it by any chance -1 or somehow correlated to it? Can you show us the actual code?