当前位置: 首页>>代码示例>>C++>>正文


C++ KToolBar::setFrameShape方法代码示例

本文整理汇总了C++中KToolBar::setFrameShape方法的典型用法代码示例。如果您正苦于以下问题:C++ KToolBar::setFrameShape方法的具体用法?C++ KToolBar::setFrameShape怎么用?C++ KToolBar::setFrameShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KToolBar的用法示例。


在下文中一共展示了KToolBar::setFrameShape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

CoverManager::CoverManager()
        : QSplitter( 0, "TheCoverManager" )
        , m_timer( new QTimer( this ) )    //search filter timer
        , m_fetchCounter( 0 )
        , m_fetchingCovers( 0 )
        , m_coversFetched( 0 )
        , m_coverErrors( 0 )
{
    DEBUG_BLOCK

    s_instance = this;

    // Sets caption and icon correctly (needed e.g. for GNOME)
    kapp->setTopWidget( this );
    setCaption( kapp->makeStdCaption( i18n("Cover Manager") ) );
    setWFlags( WDestructiveClose );
    setMargin( 4 );

    //artist listview
    m_artistView = new KListView( this );
    m_artistView->addColumn(i18n( "Albums By" ));
    m_artistView->setFullWidth( true );
    m_artistView->setSorting( -1 );    //no sort
    m_artistView->setMinimumWidth( 180 );
    KListViewItem *item = new KListViewItem( m_artistView, i18n( "All Albums" ) );
    item->setPixmap( 0, SmallIcon("cdrom_unmount") );

    //load artists from the collection db
    const QStringList artists = CollectionDB::instance()->artistList( false, false );
    foreach( artists )  {
        item = new KListViewItem( m_artistView, item, *it );
        item->setPixmap( 0, SmallIcon("personal") );
    }
    QueryBuilder qb;
    qb.addReturnValue( QueryBuilder::tabAlbum, QueryBuilder::valName );
    qb.setOptions( QueryBuilder::optOnlyCompilations | QueryBuilder::optRemoveDuplicates );
    qb.setLimit( 0, 1 );
    if ( qb.run().count() ) {
        item = new KListViewItem( m_artistView, item, i18n( "Various Artists" ) );
        item->setPixmap( 0, SmallIcon("personal") );
    }

    QVBox *vbox = new QVBox( this );
    QHBox *hbox = new QHBox( vbox );

    vbox->setSpacing( 4 );
    hbox->setSpacing( 4 );

    { //<Search LineEdit>
        QHBox *searchBox = new QHBox( hbox );
        KToolBar* searchToolBar = new Browser::ToolBar( searchBox );
        KToolBarButton *button = new KToolBarButton( "locationbar_erase", 0, searchToolBar );
        m_searchEdit = new ClickLineEdit( i18n( "Filter here..." ), searchToolBar );
        m_searchEdit->setFrame( QFrame::Sunken );

        searchToolBar->setStretchableWidget( m_searchEdit );
        connect( button, SIGNAL(clicked()), m_searchEdit, SLOT(clear()) );

        QToolTip::add( button, i18n( "Clear filter" ) );
        QToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to filter albums" ) );

        hbox->setStretchFactor( searchBox, 1 );
    } //</Search LineEdit>

    // view menu
    m_viewMenu = new KPopupMenu( this );
    m_viewMenu->insertItem( i18n("All Albums"), AllAlbums );
    m_viewMenu->insertItem( i18n("Albums With Cover"), AlbumsWithCover );
    m_viewMenu->insertItem( i18n("Albums Without Cover"), AlbumsWithoutCover );
    m_viewMenu->setItemChecked( AllAlbums, true );
    connect( m_viewMenu, SIGNAL( activated(int) ), SLOT( changeView(int) ) );

    #ifdef AMAZON_SUPPORT
    // amazon locale menu
    m_amazonLocaleMenu = new KPopupMenu( this );
    m_amazonLocaleMenu->insertItem( i18n("International"), International );
    m_amazonLocaleMenu->insertItem( i18n("Canada"), Canada );
    m_amazonLocaleMenu->insertItem( i18n("France"), France );
    m_amazonLocaleMenu->insertItem( i18n("Germany"), Germany );
    m_amazonLocaleMenu->insertItem( i18n("Japan"), Japan);
    m_amazonLocaleMenu->insertItem( i18n("United Kingdom"), UK );
    connect( m_amazonLocaleMenu, SIGNAL( activated(int) ), SLOT( changeLocale(int) ) );
    #endif

    KToolBar* toolBar = new KToolBar( hbox );
    toolBar->setIconText( KToolBar::IconTextRight );
    toolBar->setFrameShape( QFrame::NoFrame );
    toolBar->insertButton( "view_choose", 1, m_viewMenu, true, i18n( "View" ) );
    #ifdef AMAZON_SUPPORT
    const QString babelfish = locate( "data", QString( "amarok/images/babelfish.png" ) );
    toolBar->insertButton( babelfish, 2, m_amazonLocaleMenu, true, i18n( "Amazon Locale" ) );

    QString locale = AmarokConfig::amazonLocale();

         if( locale == "fr" ) m_currentLocale = France;
    else if( locale == "de" ) m_currentLocale = Germany;
    else if( locale == "jp" ) m_currentLocale = Japan;
    else if( locale == "uk" ) m_currentLocale = UK;
    else if( locale == "ca" ) m_currentLocale = Canada;
    else {
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的KToolBar::setFrameShape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。