Oh yes, "lcd2" was a typo, sorry. There's at least a classical mix up with local and member variables. You have declared a member variable:
QLCDNumber *lcdX;
To copy to clipboard, switch view to plain text mode
But you are assigning to a local variable:
QLCDNumber *lcdX = new QLCDNumber(X);
To copy to clipboard, switch view to plain text mode
Now if you try to dereference it in another function:
ldcX->something();
ldcX->something();
To copy to clipboard, switch view to plain text mode
You'll get a crash because you are using an uninitialized pointer. So you should make it:
lcdX = new QLCDNumber(X);
To copy to clipboard, switch view to plain text mode
Bookmarks