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


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

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


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

示例1: KonqSidebarPlugin

UniversalPana::UniversalPana(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name):
                   KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name)
{
    KGlobal::iconLoader()->addAppDir( "pana" );
    widget = new panaWidget( widgetParent );
//    widgetParent->resize(580,300);
    KToolBar *topBar = new KToolBar( widget, "Topbar" );
    topBar->setIconSize(16);
    topBar->insertButton( "today",    0, SIGNAL( clicked() ), this, SLOT( currentTrack() ) );
    topBar->insertButton( "document", 0, SIGNAL( clicked() ), this, SLOT( lyrics() ) );
    topBar->insertButton( "personal", 0, SIGNAL( clicked() ), this, SLOT( wiki() ) );

    browser = new KHTMLPart(widget, "widget-browser");
//browser=new KHTMLPart(widget);
    kdDebug() << "parentPart() << " << browser->parentPart() << endl;
    browser->setDNDEnabled( true );
    browser->setEncoding( "utf8", true );
    updateBrowser( HTML_FILE );
    browser->view()->installEventFilter( widget );
    panaDCOP = new DCOPClient();
    panaDCOP->attach();

    playerStub   = new PanaPlayerInterface_stub( panaDCOP, "pana", "player");
    playlistStub = new PanaPlaylistInterface_stub( panaDCOP, "pana", "playlist");
    contextStub = new PanaContextBrowserInterface_stub (panaDCOP, "pana", "contextbrowser");

    KToolBar* toolBar=new KToolBar(widget, "PlayerControls");

    toolBar->setIconSize(16);
    toolBar->insertButton( "player_start",0, SIGNAL( clicked() ), this, SLOT( sendPrev() ) );
    toolBar->insertButton( "player_play", 0, SIGNAL( clicked() ), this, SLOT( sendPlay() ) );
    toolBar->insertButton( "player_pause",0, SIGNAL( clicked() ), this, SLOT( sendPause() ) );
    toolBar->insertButton( "player_stop", 0, SIGNAL( clicked() ), this, SLOT( sendStop() ) );
    toolBar->insertButton( "player_end",  0, SIGNAL( clicked() ), this, SLOT( sendNext() ) );

    toolBar->insertSeparator();
    toolBar->insertButton( "arts",        0, SIGNAL( clicked() ), this, SLOT( sendMute() ) );

    vol_slider = new QSlider(0,100,1,0,Qt::Horizontal, toolBar,"volume");
    vol_slider->setLineStep(2);

    connect(vol_slider, SIGNAL( valueChanged(int) ), this, SLOT(volChanged(int ) ) );
    toolBar->insertWidget(1,2, vol_slider);

    fileInfo  = new QFileInfo(HTML_FILE);
    QTimer *t = new QTimer( this );

    connect( t, SIGNAL(timeout()), SLOT(updateStatus() ) );
    t->start( 2000, false );
    kdDebug() << "Connecting widget signal" << endl;

    connect( widget,                      SIGNAL( emitURL( const KURL &)),
             this,                        SLOT( openURLRequest( const KURL &) ) );
    connect( browser->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ),
             this,                        SLOT( openURLRequest( const KURL & ) ) );
    widget->show();
}
开发者ID:delight,项目名称:Pana,代码行数:57,代码来源:universalpana.cpp

示例2: QWidget

DataOutputWidget::DataOutputWidget(QWidget *parent)
: QWidget(parent)
, m_model(new DataOutputModel(this))
, m_view(new DataOutputView(this))
, m_isEmpty(true)
{
  m_view->setModel(m_model);

  QHBoxLayout *layout = new QHBoxLayout(this);
  m_dataLayout = new QVBoxLayout();

  KToolBar *toolbar = new KToolBar(this);
  toolbar->setOrientation(Qt::Vertical);
  toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
  toolbar->setIconSize(QSize(16, 16));

  /// TODO: disable actions if no results are displayed or selected

  KAction *action;

  action = new KAction( KIcon("distribute-horizontal-x"), i18nc("@action:intoolbar", "Resize columns to contents"), this);
  toolbar->addAction(action);
  connect(action, SIGNAL(triggered()), this, SLOT(resizeColumnsToContents()));

  action = new KAction( KIcon("distribute-vertical-y"), i18nc("@action:intoolbar", "Resize rows to contents"), this);
  toolbar->addAction(action);
  connect(action, SIGNAL(triggered()), this, SLOT(resizeRowsToContents()));

  action = new KAction( KIcon("edit-copy"), i18nc("@action:intoolbar", "Copy"), this);
  toolbar->addAction(action);
  m_view->addAction(action);
  connect(action, SIGNAL(triggered()), this, SLOT(slotCopySelected()));

  action = new KAction( KIcon("document-export-table"), i18nc("@action:intoolbar", "Export..."), this);
  toolbar->addAction(action);
  m_view->addAction(action);
  connect(action, SIGNAL(triggered()), this, SLOT(slotExport()));

  action = new KAction( KIcon("edit-clear"), i18nc("@action:intoolbar", "Clear"), this);
  toolbar->addAction(action);
  connect(action, SIGNAL(triggered()), this, SLOT(clearResults()));

  toolbar->addSeparator();

  KToggleAction *toggleAction = new KToggleAction( KIcon("applications-education-language"), i18nc("@action:intoolbar", "Use system locale"), this);
  toolbar->addAction(toggleAction);
  connect(toggleAction, SIGNAL(triggered()), this, SLOT(slotToggleLocale()));

  m_dataLayout->addWidget(m_view);

  layout->addWidget(toolbar);
  layout->addLayout(m_dataLayout);
  layout->setContentsMargins(0, 0, 0, 0);

  setLayout(layout);
}
开发者ID:azat-archive,项目名称:kate,代码行数:56,代码来源:dataoutputwidget.cpp

示例3: KToolBar

KToolBar *ComposerWebEngineWidgetPrivate::createToolBar(const QList<ComposerWebEngine::ComposerWebEngineAction> &lstActions)
{
    KToolBar *toolbar = new KToolBar(q);
    toolbar->setIconSize(QSize(22, 22));
    toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
    toolBarLayout->addWidget(toolbar);
    webEngine->createToolBar(lstActions, toolbar);
    listToolBar.append(toolbar);
    return toolbar;
}
开发者ID:KDE,项目名称:kdepim,代码行数:10,代码来源:composerwebenginewidget.cpp

示例4: fixedFont

TextOutputWidget::TextOutputWidget(QWidget *parent)
: QWidget(parent)
{
  m_succesTextColor = QColor::fromRgb(3, 191, 3);
  m_succesBackgroundColor = QColor::fromRgb(231, 247, 231);

  m_errorTextColor = QColor::fromRgb(191, 3, 3);
  m_errorBackgroundColor = QColor::fromRgb(247, 231, 231);

  m_layout = new QHBoxLayout(this);

  m_output = new QTextEdit();
  m_output->setReadOnly(true);

  QFont fixedFont(KGlobalSettings::fixedFont());

  m_output->setCurrentFont(fixedFont);

  KToolBar *toolbar = new KToolBar(this);
  toolbar->setOrientation(Qt::Vertical);
  toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
  toolbar->setIconSize(QSize(16, 16));

  /// TODO: disable actions if no results are displayed

  KAction *action;

  action = new KAction( KIcon("edit-clear"), i18nc("@action:intoolbar", "Clear"), this);
  toolbar->addAction(action);
  connect(action, SIGNAL(triggered()), m_output, SLOT(clear()));

  m_layout->addWidget(toolbar);
  m_layout->addWidget(m_output, 1);

  setLayout(m_layout);
}
开发者ID:UIKit0,项目名称:kate,代码行数:36,代码来源:textoutputwidget.cpp

示例5: init

/**
 * This function will intialize the playlist window.
 */
void PlaylistWindow::init()
{
    DEBUG_BLOCK

    //this function is necessary because amaroK::actionCollection() returns our actionCollection
    //via the App::m_pPlaylistWindow pointer since App::m_pPlaylistWindow is not defined until
    //the above ctor returns it causes a crash unless we do the initialisation in 2 stages.

    m_browsers = new BrowserBar( this );

    //<Dynamic Mode Status Bar />
    DynamicBar *dynamicBar = new DynamicBar( m_browsers->container());

    { //<Search LineEdit>
        KToolBar *bar = new KToolBar( m_browsers->container(), "NotMainToolBar" );
        bar->setIconSize( 22, false ); //looks more sensible
        bar->setFlat( true ); //removes the ugly frame
        bar->setMovingEnabled( false ); //removes the ugly frame

        QWidget *button = new KToolBarButton( "locationbar_erase", 1, bar );
        QLabel *filter_label = new QLabel( i18n("S&earch:") + " ", bar );
        m_lineEdit = new ClickLineEdit( i18n( "Enter search terms here" ), bar );

        filter_label->setBuddy( m_lineEdit );

        bar->setStretchableWidget( m_lineEdit );
        m_lineEdit->setFrame( QFrame::Sunken );
        m_lineEdit->installEventFilter( this ); //we intercept keyEvents

        connect( button, SIGNAL(clicked()), m_lineEdit, SLOT(clear()) );

        QToolTip::add( button, i18n( "Clear filter" ) );
        QString filtertip = i18n( "Enter space-separated terms to filter the playlist.\n\n"
                                  "Advanced, Google-esque syntax is also available;\n"
                                  "see the handbook (The Playlist section of chapter 4) for details." );

        QToolTip::add( filter_label, filtertip );
        QToolTip::add( m_lineEdit, filtertip );
    } //</Search LineEdit>



    QFrame *playlist = new Playlist( m_browsers->container() );
    dynamicBar->init();
    m_toolbar = new amaroK::ToolBar( m_browsers->container(), "mainToolBar" );
    m_toolbar->setShown( AmarokConfig::showToolbar() );
    QWidget *statusbar = new amaroK::StatusBar( this );

    KAction* repeatAction = amaroK::actionCollection()->action( "repeat" );
    connect( repeatAction, SIGNAL( activated( int ) ), playlist, SLOT( slotRepeatTrackToggled( int ) ) );

    connect( m_lineEdit, SIGNAL(textChanged( const QString& )), playlist, SLOT(setFilterSlot( const QString& )) );

    m_menubar = new KMenuBar( this );
    m_menubar->setShown( AmarokConfig::showMenuBar() );

    //BEGIN Actions menu
    KPopupMenu *actionsMenu = new KPopupMenu( m_menubar );
    actionCollection()->action("playlist_playmedia")->plug( actionsMenu );
    actionCollection()->action("play_audiocd")->plug( actionsMenu );
    actionsMenu->insertSeparator();
    actionCollection()->action("prev")->plug( actionsMenu );
    actionCollection()->action("play_pause")->plug( actionsMenu );
    actionCollection()->action("stop")->plug( actionsMenu );
    actionCollection()->action("next")->plug( actionsMenu );
    actionsMenu->insertSeparator();
    actionCollection()->action(KStdAction::name(KStdAction::Quit))->plug( actionsMenu );

    connect( actionsMenu, SIGNAL( aboutToShow() ), SLOT( actionsMenuAboutToShow() ) );
    //END Actions menu

    //BEGIN Playlist menu
    KPopupMenu *playlistMenu = new KPopupMenu( m_menubar );
    actionCollection()->action("playlist_add")->plug( playlistMenu );
    actionCollection()->action("playlist_save")->plug( playlistMenu );
    playlistMenu->insertSeparator();
    actionCollection()->action("playlist_undo")->plug( playlistMenu );
    actionCollection()->action("playlist_redo")->plug( playlistMenu );
    playlistMenu->insertSeparator();
    actionCollection()->action("playlist_clear")->plug( playlistMenu );
    actionCollection()->action("playlist_shuffle")->plug( playlistMenu );
    actionCollection()->action("playlist_show")->plug( playlistMenu );
    //this one has no real context with regard to the menu
    //actionCollection()->action("playlist_copy")->plug( playlistMenu );
    playlistMenu->insertSeparator();
    actionCollection()->action("queue_selected")->plug( playlistMenu );
    actionCollection()->action("playlist_remove_duplicates")->plug( playlistMenu );
    actionCollection()->action("playlist_select_all")->plug( playlistMenu );
    //END Playlist menu

    //BEGIN Mode menu
    KPopupMenu *modeMenu = new KPopupMenu( m_menubar );
    actionCollection()->action("repeat")->plug( modeMenu );
    KSelectAction *random = static_cast<KSelectAction*>( actionCollection()->action("random_mode") );
    random->plug( modeMenu );
    random->popupMenu()->insertSeparator();
    actionCollection()->action("favor_tracks")->plug( random->popupMenu() );
//.........这里部分代码省略.........
开发者ID:tmarques,项目名称:waheela,代码行数:101,代码来源:playlistwindow.cpp

示例6: BrowserCategory

PlaylistBrowserNS::DynamicCategory::DynamicCategory( QWidget* parent )
    : BrowserCategory( "dynamic category", parent )
{
    setPrettyName( i18n( "Dynamic Playlists" ) );
    setShortDescription( i18n( "Dynamically updating parameter based playlists" ) );
    setIcon( KIcon( "dynamic-amarok" ) );

    setLongDescription( i18n( "With a dynamic playlist, Amarok becomes your own personal dj, automatically selecting tracks for you, based on a number of parameters that you select." ) );

    setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_dynamic_playlists.png" ) );

    // set background
    if( AmarokConfig::showBrowserBackgroundImage() )
        setBackgroundImage( imagePath() );

    bool enabled = AmarokConfig::dynamicMode();

    setContentsMargins( 0, 0, 0, 0 );

    KHBox* controls2Layout = new KHBox( this );

    QLabel *label;
    label = new QLabel( i18n( "Previous:" ), controls2Layout );
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    m_previous = new QSpinBox( controls2Layout );
    m_previous->setMinimum( 0 );
    m_previous->setToolTip( i18n( "Number of previous tracks to remain in the playlist." ) );
    m_previous->setValue( AmarokConfig::previousTracks() );
    QObject::connect( m_previous, SIGNAL(valueChanged(int)), this, SLOT(setPreviousTracks(int)) );

    label = new QLabel( i18n( "Upcoming:" ), controls2Layout );
    // label->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    m_upcoming = new QSpinBox( controls2Layout );
    m_upcoming->setMinimum( 1 );
    m_upcoming->setToolTip( i18n( "Number of upcoming tracks to add to the playlist." ) );
    m_upcoming->setValue( AmarokConfig::upcomingTracks() );
    QObject::connect( m_upcoming, SIGNAL(valueChanged(int)), this, SLOT(setUpcomingTracks(int)) );


    QObject::connect( (const QObject*)Amarok::actionCollection()->action( "playlist_clear" ),  SIGNAL(triggered(bool)),  this, SLOT(playlistCleared()) );
    QObject::connect( (const QObject*)Amarok::actionCollection()->action( "disable_dynamic" ),  SIGNAL(triggered(bool)),  this, SLOT(playlistCleared()), Qt::DirectConnection );


    // -- the tool bar

    KHBox* presetLayout = new KHBox( this );
    KToolBar* presetToolbar = new KToolBar( presetLayout );
    presetToolbar->setIconSize( QSize( 22, 22 ) );

    presetToolbar->setToolButtonStyle( Qt::ToolButtonIconOnly );
    presetToolbar->setMovable( false );
    presetToolbar->setFloatable( false );
    presetToolbar->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );

    m_onOffButton = new QToolButton( presetToolbar );
    m_onOffButton->setText( i18nc( "Turn dynamic mode on", "On") );
    m_onOffButton->setCheckable( true );
    m_onOffButton->setIcon( KIcon( "dynamic-amarok" ) );
    m_onOffButton->setToolTip( i18n( "Turn dynamic mode on." ) );
    presetToolbar->addWidget( m_onOffButton );

    m_duplicateButton = new QToolButton( presetToolbar );
    m_duplicateButton->setText( i18n("Duplicates") );
    m_duplicateButton->setCheckable( true );
    m_duplicateButton->setChecked( allowDuplicates() );
    m_duplicateButton->setIcon( KIcon( "edit-copy" ) );
    m_duplicateButton->setToolTip( i18n( "Allow duplicate songs in result" ) );
    presetToolbar->addWidget( m_duplicateButton );

    m_addButton = new QToolButton( presetToolbar );
    m_addButton->setText( i18n("New") );
    m_addButton->setIcon( KIcon( "document-new" ) );
    m_addButton->setToolTip( i18n( "New playlist" ) );
    presetToolbar->addWidget( m_addButton );

    m_editButton = new QToolButton( presetToolbar );
    m_editButton->setText( i18n("Edit") );
    m_editButton->setIcon( KIcon( "document-properties-amarok" ) );
    m_editButton->setToolTip( i18n( "Edit the selected playlist or bias" ) );
    presetToolbar->addWidget( m_editButton );

    m_deleteButton = new QToolButton( presetToolbar );
    m_deleteButton->setText( i18n("Delete") );
    m_deleteButton->setEnabled( false );
    m_deleteButton->setIcon( KIcon( "edit-delete" ) );
    m_deleteButton->setToolTip( i18n( "Delete the selected playlist or bias") );
    presetToolbar->addWidget( m_deleteButton );

    m_repopulateButton = new QPushButton( presetLayout );
    m_repopulateButton->setText( i18n("Repopulate") );
    m_repopulateButton->setToolTip( i18n("Replace the upcoming tracks with fresh ones.") );
    m_repopulateButton->setIcon( KIcon( "view-refresh-amarok" ) );
    m_repopulateButton->setEnabled( enabled );
    // m_repopulateButton->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
    QObject::connect( m_repopulateButton, SIGNAL(clicked(bool)), The::playlistActions(), SLOT(repopulateDynamicPlaylist()) );


//.........这里部分代码省略.........
开发者ID:KDE,项目名称:amarok,代码行数:101,代码来源:DynamicCategory.cpp


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