
Originally Posted by
amleto
int* p;
*p; <--- bang!
Ah, okay this is what you meant with un-initialized. Yes that is very likely. I thought this was what d_stranz was referring to when he mentioned memory corruption, since an un-initialized pointer easily can lead to memory corruption (I guess), and I thought you were referring to an uninitialized float (since the bug was that I got a very strange value for a float, although I didn't mention it).

Originally Posted by
amleto
Did you use your debugger yet?
No, I'm sorry I haven't had the opportunity yet, so maybe it's stupid of me to ask more questions. But I am going to do it soon and get back to this thread when I have found the reason for the bug.

Originally Posted by
amleto
edit: oh yes, you said you can't expand it. Didn't that seem strange to you? I wonder why it's not working? Probably because it hasn't been initialised...
Do you mean that the ui object hasn't been initialized? The ui object must have been initialized, since my main window constructor definition starts like this:
mainwin
::mainwin(QWidget *parent
) : ui(new Ui::mainwin)
{
mainwin::mainwin(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::mainwin)
{
To copy to clipboard, switch view to plain text mode
and that's the constructor I use when I'm creating the mainwin object, so the ui object has been initialized with an initializer.
I'm thinking that the ui object has been corrupted, and that I have some uninitialized pointer somewhere that I'm using, like you said. But how can I find places where I'm dereferring uninitialized pointers?
Bookmarks