Good Afternoon
I've got an interesting little segfault that I can't seem to figure out why it's happening.
This is using Qt 4.1.0 I beleive.
First of all, here's a dump of the backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -150056832 (LWP 3712)]
0x00f14c67 in QObject::connect (sender=0x8461ea0, signal=0x805c630 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x83f3688,
method=0x805c5fc "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
2134 kernel/qobject.cpp: No such file or directory.
in kernel/qobject.cpp
(gdb) bt
#0 0x00f14c67 in QObject::connect (sender=0x8461ea0, signal=0x805c630 "2currentItemChanged( QTableWidgetItem *, QTableWidgetItem * )", receiver=0x83f3688,
method=0x805c5fc "1validate( QTableWidgetItem *, QTableWidgetItem * )", type=AutoConnection) at kernel/qobject.cpp:2134
#1 0x080563a4 in DataGen::setUpConnections (this=0x83f3688) at datagen.cpp:553
#2 0x0804d480 in DataGen (this=0x83f3688) at datagen.cpp:45
#3 0x08057d73 in main (argc=1, argv=0xfef1b434) at main.cpp:12
At first glance, it seems that the signal slot connection is having a hard time being made. The file not found error seems to point to something wrong with the Qt install, but here's the kicker, the exact same code runs perfectly fine in another project I have, on the same machine no less. So I'm not sure that the Qt install is the problem.
The code that seems to be closest to causing this fault is in the setUpConnections function, relevent snippet is here:
void DataGen::setUpConnections()
{
//Signals and Slot Connections.
//This line is causing the problem, although it's syntactically and semantically correct...at least it seems to be.
...
}
void DataGen::setUpConnections()
{
//Signals and Slot Connections.
//This line is causing the problem, although it's syntactically and semantically correct...at least it seems to be.
connect( m_munPhRanges, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ),
this, SLOT( validate( QTableWidgetItem *, QTableWidgetItem * ) ) );
connect( m_munPkRanges, SIGNAL( currentItemChanged( QTableWidgetItem *, QTableWidgetItem * ) ),
this, SLOT( validate( QTableWidgetItem *, QTableWidgetItem * ) ) );
...
}
To copy to clipboard, switch view to plain text mode
The validate function prototype is as follows:
/**
* @brief Slot used to validate the entries in a table. Called when a cell is finished editing,
* will turn the cell background red in the event of an invalid input. Values inported from file are assumed to be correct.
* @param current Pointer to the TableWidgetItem in the current cell (not used, required by the signal).
* @param previous Pointer to the previously edited TableWidgetItem.
*/
/**
* @brief Slot used to validate the entries in a table. Called when a cell is finished editing,
* will turn the cell background red in the event of an invalid input. Values inported from file are assumed to be correct.
* @param current Pointer to the TableWidgetItem in the current cell (not used, required by the signal).
* @param previous Pointer to the previously edited TableWidgetItem.
*/
void validate( QTableWidgetItem * current, QTableWidgetItem * previous );
To copy to clipboard, switch view to plain text mode
If there's anything else you guys need, I'll try to see what I can do.
Thanks.
Bookmarks