Their code compiles without problems, but it continually crashes, usually within the bowels of the minimumSizeHint or sizeHint, but it's impossible to find (using vc++). I haven't modified it at all. The only code of mine that's relevant I posted above where I call it using a QLineEdit, or rather 2 of them. I renamed CardLayout to HomeLayout, and that's the only modification I made to their code.
frButtons is just a frame that contains the 2 qlineedits.
HomeLayout1
= new HomeLayout
((QWidget *)frButtons,
6);
leA
= new QLineEdit( frButtons,
"lineEditA" );
leB
= new QLineEdit( frButtons,
"lineEditB" );
HomeLayout1->addItem( leA );
HomeLayout1->addItem( leB );
HomeLayout1 = new HomeLayout((QWidget *)frButtons, 6);
leA = new QLineEdit( frButtons, "lineEditA" );
leB = new QLineEdit( frButtons, "lineEditB" );
HomeLayout1->addItem( leA );
HomeLayout1->addItem( leB );
To copy to clipboard, switch view to plain text mode
This doesn't compile, I get error: error C2664: 'HomeLayout::addItem' : cannot convert parameter 1 from 'QLineEdit *' to 'QLayoutItem *'
So, I tried casting leA and leB to ('QLayoutItem *) in the call to addItem which does compile, and then crashes on running, somewhere within minimumSizeHint or sizeHint (access violation).
How do you call addItem? Can you show me what you did for the testing code?
Thank you for the help,
Jay
Bookmarks