Unsolved QPushButton set checked causes program to crash
-
hi
do
SetWidgetProperty
called setChecked ?
if that triggers clicked(bool) u get infinite calls. -
@mrjj The thing is, If I do this:
cButton->setChecked(true); //on_button1_clicked(true);
I still get the same crash. Which tells me on_button1_clicked(bool) is irrelevant. Right?
-
@Qtstarter121
yeah, seems so.
so it seems to crash on ?
cButton->setChecked(true);
since you dont have debugger
use qDebugqDebug() << "before";
cButton->setChecked(true);
qDebug() << "after";to fidn WHAT makes it crash
-
Hold on I might be wrong about that. Let me try something and get back to you.
-
@Qtstarter121
You really should install debugger. :)
Its ment to find stuff like this :) -
Okay so it looks like i am having an off-day because I just found out the source of my problem.
Turns out the issue was with code in the slot ( not Qt stuff but c++ using a proprietary framework) I neglected to post which was using an uninitialized variable. facepalmI neglected to include it because I wrongly assumed the code wasn't relevant.
Sorry for wasting your time and thanks for the help.
-
@mrjj I actually do have a debugger available and installed. The problem is that the way my program is launched, i'm not sure how I can run it with gdb. if I attempt a command such as " gdb < my usual program launch command>
I get an error like this: not in executable format: File format not recognizedHowever I can attach a debugger once my process is running via gdb attach < pid > but in this case the issue was in my constructor so that would run immediately and no time to attach the debugger to catch the crash issue so print statements are my only option.
-
@Qtstarter121
You are not using Creator? -
@mrjj nope, gdb.
-
@Qtstarter121
Ok so you compile outside of Creator and not using the dgb integration ?