QSA-interest Archive, October 2005
about QWidgetStack
Message 1 in thread
have developed flashplayer at qtopia now.
i have almost finished,but there are something wrong with GUI.
the code belows:
playerStack = new QWidgetStack( this );
playerStack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,
QSizePolicy::Expanding ) );
setCentralWidget( playerStack );
player = new FlashWidget( playerStack );
playerStack->addWidget( player,0 );
fileSelector = new FileSelector( "flash/" "*", playerStack,
"fileselector" , FALSE, FALSE );
playerStack->addWidget( fileSelector,1 );
connect( fileSelector, SIGNAL( fileSelected(const DocLnk&) ), this, SLOT(
openFile(const DocLnk&) ) );
setIcon( Resource::loadPixmap( "FlashPlayer" ) );
playerStack->raiseWidget( fileSelector );
//play the file at document tab
if ( qApp->argc() == 2 )
display();
}
void FlashPlayer::display ()-----------------1
{
playerStack->raiseWidget(player);
player->setDocument(qApp->argv()[1]);
}
void FlashPlayer::openFile (const DocLnk &dlk)
{
playerStack->raiseWidget(player);##############################
player->setDocument( dlk.file() );
}
my problem is i can play the swf at document tab.but i can't do it at
application tab.the error is playerStack->raiseWidget(player);(marked
##########).but why i can raiseWidget(player) at function
display(----------1)?but at the openFile it can't.
anyone can tell me the reason?
thank you in advance.