本文整理汇总了C++中source_ptr::isLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ source_ptr::isLocal方法的具体用法?C++ source_ptr::isLocal怎么用?C++ source_ptr::isLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source_ptr
的用法示例。
在下文中一共展示了source_ptr::isLocal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlexibleView
HistoryWidget::HistoryWidget( const source_ptr& source, QWidget* parent )
: FlexibleView( parent, m_header = new QWidget() )
{
m_header->setMaximumHeight( 160 );
/* QCalendarWidget* m_calendarFrom = new QCalendarWidget();
QCalendarWidget* m_calendarTo = new QCalendarWidget();
m_calendarFrom->setGridVisible( false );
m_calendarTo->setGridVisible( false );*/
m_calendarFrom = new QDateEdit( QDate::currentDate() );
m_calendarTo = new QDateEdit( QDate::currentDate() );
m_calendarFrom->setDisplayFormat( "yyyy MMMM dd" );
m_calendarTo->setDisplayFormat( "yyyy MMMM dd" );
// setting an empty style-sheet prevents the QDateEdits from adopting their parent's QPalette
QString calSheet = QString( "QDateEdit { }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() );
m_calendarFrom->setStyleSheet( calSheet );
m_calendarTo->setStyleSheet( calSheet );
QPalette pal = m_header->palette();
pal.setColor( QPalette::Foreground, Qt::white );
pal.setColor( QPalette::Text, Qt::white );
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
m_header->setPalette( pal );
m_header->setAutoFillBackground( true );
QHBoxLayout* layout = new QHBoxLayout( m_header );
layout->addSpacerItem( new QSpacerItem( 1, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum ) );
layout->addWidget( new QLabel( tr( "From:" ) ) );
layout->addWidget( m_calendarFrom );
layout->addSpacerItem( new QSpacerItem( 16, 0, QSizePolicy::Fixed, QSizePolicy::Minimum ) );
layout->addWidget( new QLabel( tr( "To:" ) ) );
layout->addWidget( m_calendarTo );
layout->addSpacerItem( new QSpacerItem( 1, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum ) );
m_header->setLayout( layout );
setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );
m_model = new RecentlyPlayedModel( this );
m_model->setTitle( tr( "Recently Played Tracks" ) );
if ( source->isLocal() )
m_model->setDescription( tr( "Your recently played tracks" ) );
else
m_model->setDescription( tr( "%1's recently played tracks" ).arg( source->friendlyName() ) );
PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, trackView(), trackView()->proxyModel() );
trackView()->setItemDelegate( del );
setPlayableModel( m_model );
setEmptyTip( tr( "Sorry, we could not find any recent plays!" ) );
m_model->setSource( source );
setGuid( QString( "recentplays/%1" ).arg( source->nodeId() ) );
/* connect( m_calendarFrom, SIGNAL( clicked( QDate ) ), SLOT( onDateClicked( QDate ) ) );
connect( m_calendarTo, SIGNAL( clicked( QDate ) ), SLOT( onDateClicked( QDate ) ) );*/
connect( m_calendarFrom, SIGNAL( dateChanged( QDate ) ), SLOT( onDateClicked( QDate ) ) );
connect( m_calendarTo, SIGNAL( dateChanged( QDate ) ), SLOT( onDateClicked( QDate ) ) );
}
示例2: updated
void
SourceItem::latchedOn( const source_ptr& from, const source_ptr& to )
{
if ( from->isLocal() && ( m_source == to || m_source == from ) )
{
m_latchedOn = true;
m_latchedOnTo = to;
connect( m_latchedOnTo->playlistInterface().data(), SIGNAL( latchModeChanged( Tomahawk::PlaylistInterface::LatchMode ) ), SLOT( latchModeChanged( Tomahawk::PlaylistInterface::LatchMode ) ) );
emit updated();
}
}
示例3: updated
void
SourceItem::latchedOff( const source_ptr& from, const source_ptr& to )
{
if ( from->isLocal() && ( m_source == to || m_source == from ) )
{
m_latchedOn = false;
disconnect( m_latchedOnTo->playlistInterface().data(), SIGNAL( latchModeChanged( Tomahawk::PlaylistModes::LatchMode ) ) );
m_latchedOnTo.clear();
emit updated();
}
}
示例4: FlexibleView
HistoryWidget::HistoryWidget( const source_ptr& source, QWidget* parent )
: FlexibleView( parent )
{
setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );
m_model = new RecentlyPlayedModel( this );
m_model->setTitle( tr( "Recently Played Tracks" ) );
if ( source->isLocal() )
m_model->setDescription( tr( "Your recently played tracks" ) );
else
m_model->setDescription( tr( "%1's recently played tracks" ).arg( source->friendlyName() ) );
trackView()->setIndentation( 0 );
trackView()->setUniformRowHeights( false );
setPlayableModel( m_model );
setEmptyTip( tr( "Sorry, we could not find any recent plays!" ) );
m_model->setSource( source );
setGuid( QString( "recentplays/%1" ).arg( source->nodeId() ) );
}