Hi
I have a QFrame *frame A and I want to place a QFrame *helpFrame in it
emit displayHelpFunction( frameA, &helpFlag);
frameA->show();
emit displayHelpFunction( frameA, &helpFlag);
frameA->show();
To copy to clipboard, switch view to plain text mode
and the code in the sub-frame is
void HelpFunction
::slotDisplayHelpFunction( QFrame *sourceFrame,
bool *flag
) {
if ( *flag == false)
{
helpFrame
= new QFrame( sourceFrame
);
helpFrame
->setFrameShape
( QFrame::StyledPanel );
helpFrame->setGeometry( 10, 10, 200, 400 );
teHelpBox->setGeometry(10,10, 180, 380);
teHelpBox->setPlainText( "Now is the time" );
helpFrame->show();
*flag = true;
}
else if ( *flag == true )
{
*flag = false;
helpFrame->hide();
}
}
void HelpFunction::slotDisplayHelpFunction( QFrame *sourceFrame, bool *flag )
{
if ( *flag == false)
{
helpFrame = new QFrame( sourceFrame );
helpFrame->setFrameShape( QFrame::StyledPanel );
helpFrame->setGeometry( 10, 10, 200, 400 );
teHelpBox= new QTextEdit( helpFrame );
teHelpBox->setGeometry(10,10, 180, 380);
teHelpBox->setPlainText( "Now is the time" );
helpFrame->show();
*flag = true;
}
else if ( *flag == true )
{
*flag = false;
helpFrame->hide();
}
}
To copy to clipboard, switch view to plain text mode
and it works fine, with the "helpFrame" in the upper left corner of "frameA", but I want line 7. in terms of the "width" and "height" of frameA.
I don't want to use "spacers" or a "paint" event to get these dimensions if I can help it.
help would be most appreciated.
Bookmarks