Results 1 to 2 of 2

Thread: QComboBox activated signal: bad int value?

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default QComboBox activated signal: bad int value?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QComboBox activated signal: bad int value?

    Quote Originally Posted by rfdutt View Post
    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?

Similar Threads

  1. emit the activated signal on a combobox
    By Equilibrium in forum Qt Programming
    Replies: 4
    Last Post: 8th November 2007, 12:33
  2. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25
  3. Replies: 2
    Last Post: 17th May 2006, 21:01
  4. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.