本文整理汇总了C++中ListElement::setSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ ListElement::setSelected方法的具体用法?C++ ListElement::setSelected怎么用?C++ ListElement::setSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListElement
的用法示例。
在下文中一共展示了ListElement::setSelected方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChannelSearchParsed
void MainWindow::ChannelSearchParsed( ChannelFeedPtr Search ) {
QListWidgetItem *Item = new QListWidgetItem( ui->ItemView );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( Search->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemView->setItemWidget( Item, Widget );
}
示例2: UserParsed
void MainWindow::UserParsed( UserPtr User )
{
QListWidgetItem *Item = new QListWidgetItem( ui->ItemView );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( User->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemView->setItemWidget( Item, Widget );
}
示例3: PlaylistParsed
void MainWindow::PlaylistParsed( VideoFeedPtr Playlist )
{
QListWidgetItem *Item = new QListWidgetItem( ui->ItemView );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( Playlist->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemView->setItemWidget( Item, Widget );
}
示例4: VideosAddded
void MainWindow::VideosAddded( VideoFeedPtr Video )
{
if( Video == mCurContent ) {
for( int i=ui->ItemContent->count(); i < Video->Content.size(); i++ )
{
QListWidgetItem *Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( Video->Content.at(i)->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
}
if( !Video->HasFullFeed ) {
/// this can seem like a memory leek but it is not, then ItemContent is cleared this element is also deleted :)
mMoreItems = new QListWidgetItem( "Double click for more!", ui->ItemContent );
}
}
}
示例5: ItemDoubleClicked
void MainWindow::ItemDoubleClicked( QListWidgetItem *Item )
{
if( Item == mMoreItems )
{
if( !mCurContent.isNull() && mCurContent->getType() == IT_VideoFeed )
mParser->ParseNextPage( mCurContent->cast_VideoFeed() );
delete mMoreItems; mMoreItems = 0;
return;
}
QWidget *Widget = Item->listWidget()->itemWidget(Item);
if( Widget && typeid(*Widget) == typeid(ListElement) )
{
BasePtr Info = static_cast<ListElement*>(Widget)->getInfo();
ui->ItemContent->clear();
switch( Info->getType() ) {
case( IT_VideoInfo ):
{
QListWidgetItem *Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( Info->cast_VideoInfo()->Releated->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
Widget = new ListElement;
Widget->setInfo( Info->cast_VideoInfo()->Responces->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
break;
}
case( IT_VideoFeed ): {
if( Info->cast_VideoFeed()->ParsedPages == 0 ) {
mParser->ParseNextPage(Info->cast_VideoFeed() );
mCurContent = Info;
return;
}
VideoFeedPtr fInfo = Info->cast_VideoFeed();
for( int i=0; i < fInfo->Content.size(); i++ ) {
QListWidgetItem *Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
ListElement *Widget = new ListElement;
Widget->setInfo( fInfo->Content.at(i)->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
}
if( !fInfo->HasFullFeed ) {
/// this can seem like a memory leek but it is not, then ItemContent is cleared this element is also deleted :)
mMoreItems = new QListWidgetItem( "Double click for more!", ui->ItemContent );
}
break;
} case( IT_UserInfo ): {
// Fix this
UserPtr User = Info->cast_UserInfo();
QListWidgetItem *Item = 0;
ListElement *Widget = 0;
Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
Widget = new ListElement;
Widget->setInfo( User->Favorites->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
Widget = new ListElement;
Widget->setInfo( User->Uploads->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
/* This does not work... I think its something with my parser....
have to look it up, maybe something with that it never parsed the playlists...
Solved it, I think forgot to create a playlist feed :P */
Item = new QListWidgetItem( ui->ItemContent );
Item->setSizeHint( QSize(300,64) );
Widget = new ListElement;
Widget->setInfo( User->Playlists->cast_BaseInfo() );
Widget->setSelected(false);
ui->ItemContent->setItemWidget( Item, Widget );
break;
break;
} case( IT_PlaylistFeed ):
/// @todo
break;
case( IT_ChannelFeed ):
/// @todo
break;
default:
break;
}
mCurContent = Info;
}
}