Please help me explain unexpected crash!!!
I have:
x.h
class x: QObject
struct
{
struct
{
struct
{
int state;
double curstring;
QTimer timer_scroll;
QTimer timer_done;
}color;
struct
{
int state;
double curstring;
QTimer timer_scroll;
QTimer timer_done;
}mono;
}S2L_NOTIFY;
….etc
x.cpp
void x::draw(const int type, QString str, bool isNeedAnswer)
{
if(type == 3)
{
//here is crash!
if(bitmap.S2L_NOTIFY.mono.state == 3 && bitmap.S2L_NOTIFY.color.state == 3)
{
if((bitmap.S2L_NOTIFY.mono.state == 3)) -< not crash here
if((bitmap.S2L_NOTIFY.color.state == 3)) -< not crash here
Please tell me where am i wrong or compilator wrong?
The problem is that you have x in your condition, but the function
x::rndfunc()is a member function of class x… not a variable. It should be:or simply:
(as you wrote).
EDIT: Okay, so there was a typo in the original question, so the above is no longer relevant. The new answer is:
fdoes not have a member variablenmb1, onlynmb2.EDIT #2: More typos. My new answer:
What you’re trying to do looks really messy. Don’t do it.