本文整理汇总了C++中KToolBar::setIconDimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ KToolBar::setIconDimensions方法的具体用法?C++ KToolBar::setIconDimensions怎么用?C++ KToolBar::setIconDimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToolBar
的用法示例。
在下文中一共展示了KToolBar::setIconDimensions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: placesModel
FileBrowser::Private::Private( FileBrowser *parent )
: placesModel( 0 )
, showingPlaces( false )
, q( parent )
{
KHBox *topHBox = new KHBox( q );
KToolBar *navigationToolbar = new KToolBar( topHBox );
navigationToolbar->setToolButtonStyle( Qt::ToolButtonIconOnly );
navigationToolbar->setIconDimensions( 16 );
backAction = KStandardAction::back( q, SLOT(back()), topHBox );
forwardAction = KStandardAction::forward( q, SLOT(forward()), topHBox );
backAction->setEnabled( false );
forwardAction->setEnabled( false );
upAction = KStandardAction::up( q, SLOT(up()), topHBox );
homeAction = KStandardAction::home( q, SLOT(home()), topHBox );
placesAction = new KAction( KIcon( "folder-remote" ),
i18nc( "Show Dolphin Places the user configured", "Places" ),
topHBox );
navigationToolbar->addAction( backAction );
navigationToolbar->addAction( forwardAction );
navigationToolbar->addAction( upAction );
navigationToolbar->addAction( homeAction );
navigationToolbar->addAction( placesAction );
searchWidget = new SearchWidget( topHBox, false );
searchWidget->setClickMessage( i18n( "Filter Files" ) );
fileView = new FileView( q );
}
示例2: placesModel
FileBrowser::Private::Private( FileBrowser *parent )
: placesModel( 0 )
, q( parent )
{
KHBox *topHBox = new KHBox( q );
KToolBar *navigationToolbar = new KToolBar( topHBox );
navigationToolbar->setToolButtonStyle( Qt::ToolButtonIconOnly );
navigationToolbar->setIconDimensions( 16 );
backAction = KStandardAction::back( q, SLOT(back()), topHBox );
forwardAction = KStandardAction::forward( q, SLOT(forward()), topHBox );
backAction->setEnabled( false );
forwardAction->setEnabled( false );
upAction = KStandardAction::up( q, SLOT(up()), topHBox );
homeAction = KStandardAction::home( q, SLOT(home()), topHBox );
refreshAction = new KAction( KIcon("view-refresh"), i18n( "Refresh" ), topHBox );
QObject::connect( refreshAction, SIGNAL(triggered(bool)), q, SLOT(refresh()) );
navigationToolbar->addAction( backAction );
navigationToolbar->addAction( forwardAction );
navigationToolbar->addAction( upAction );
navigationToolbar->addAction( homeAction );
navigationToolbar->addAction( refreshAction );
searchWidget = new SearchWidget( topHBox, false );
searchWidget->setClickMessage( i18n( "Filter Files" ) );
fileView = new FileView( q );
}
示例3: QDockWidget
MessageDock::MessageDock( const QString& title, QWidget* parent, Qt::WindowFlags flags )
: QDockWidget( title, parent, flags ),
d( new MessageDockPrivate )
{
setObjectName( "MessageDock" );
d->view = new QListWidget( this );
d->view->addItem( new QListWidgetItem( i18n( "Welcome to Gluon Creator %1", GluonCore::Global::versionString() ), d->view ) );
d->view->setSelectionMode( QAbstractItemView::ExtendedSelection );
connect( GluonEngine::Game::instance(), SIGNAL( showDebug( const QString& ) ), SLOT( showDebug( const QString& ) ) );
QWidget* widget = new QWidget( this );
QVBoxLayout* layout = new QVBoxLayout();
layout->setContentsMargins( 0, 0, 0, 0 );
layout->setSpacing( 0 );
widget->setLayout( layout );
KToolBar* toolBar = new KToolBar( this );
toolBar->setIconDimensions( 16 );
QAction* selectAll = toolBar->addAction( KIcon( "edit-select-all" ), i18n( "Select All" ), this, SLOT( selectAll() ) );
d->view->addAction( selectAll );
QAction* copy = toolBar->addAction( KIcon( "edit-copy" ), i18n( "Copy" ), this, SLOT( copy() ) );
d->view->addAction( copy );
KAction* separator = new KAction( d->view );
separator->setSeparator( true );
d->view->addAction( separator );
QAction* clearSelection = toolBar->addAction( KIcon( "edit-clear-list" ), i18n( "Clear Selection" ), this, SLOT( clearSelection() ) );
d->view->addAction( clearSelection );
QAction* clearAll = toolBar->addAction( KIcon( "edit-clear" ), i18n( "Clear All" ), d->view, SLOT( clear() ) );
d->view->addAction( clearAll );
layout->addWidget( toolBar );
layout->addWidget( d->view );
setWidget( widget );
}
示例4: KVBox
Playlist::Widget::Widget( QWidget* parent )
: KVBox( parent )
{
setContentsMargins( 1, 1, 1, 1 );
m_searchWidget = new ProgressiveSearchWidget( this );
//this is really only useful for debugging at the moment, so dont show it to users and testers
/*m_sortBox = new QComboBox( this );
m_sortBox->insertItem( 0, "Album", Album);
m_sortBox->insertItem( 1, "AlbumArtist", Album);
m_sortBox->insertItem( 2, "Artist", Artist );
m_sortBox->insertItem( 3, "Bitrate", Bitrate );
m_sortBox->insertItem( 4, "Bpm", Bpm );
m_sortBox->insertItem( 5, "Comment", Comment );
m_sortBox->insertItem( 6, "Composer", Composer );
m_sortBox->insertItem( 7, "Directory", Directory );
m_sortBox->insertItem( 8, "DiscNumber", DiscNumber );
m_sortBox->insertItem( 9, "Filename", Filename );
m_sortBox->insertItem( 10, "Filesize", Filesize );
m_sortBox->insertItem( 11, "Genre", Genre );
m_sortBox->insertItem( 12, "LastPlayed", LastPlayed );
m_sortBox->insertItem( 13, "Length", Length );
m_sortBox->insertItem( 14, "Mood", Mood );
m_sortBox->insertItem( 15, "PlayCount", PlayCount );
m_sortBox->insertItem( 16, "Rating", Rating );
m_sortBox->insertItem( 17, "SampleRate", SampleRate );
m_sortBox->insertItem( 18, "Score", Score );
m_sortBox->insertItem( 29, "Source", Source );
m_sortBox->insertItem( 30, "Title", Title );
m_sortBox->insertItem( 31, "TrackNumber", TrackNumber );
m_sortBox->insertItem( 32, "Type", Type );
m_sortBox->insertItem( 33, "Year", Year );
connect( m_sortBox, SIGNAL( activated( int ) ), this, SLOT( sort( int ) ) );*/
QWidget * layoutHolder = new QWidget( this );
QVBoxLayout* mainPlaylistlayout = new QVBoxLayout( layoutHolder );
mainPlaylistlayout->setContentsMargins( 0, 0, 0, 0 );
m_playlistView = new PrettyListView( this );
m_playlistView->show();
connect( m_searchWidget, SIGNAL( filterChanged( const QString &, int, bool ) ), m_playlistView, SLOT( find( const QString &, int, bool ) ) );
connect( m_searchWidget, SIGNAL( next( const QString &, int ) ), m_playlistView, SLOT( findNext( const QString &, int ) ) );
connect( m_searchWidget, SIGNAL( previous( const QString &, int ) ), m_playlistView, SLOT( findPrevious( const QString &, int ) ) );
connect( m_searchWidget, SIGNAL( filterCleared() ), m_playlistView, SLOT( clearSearchTerm() ) );
connect( m_searchWidget, SIGNAL( showOnlyMatches( bool ) ), m_playlistView, SLOT( showOnlyMatches( bool ) ) );
connect( m_searchWidget, SIGNAL( activateFilterResult() ), m_playlistView, SLOT( playFirstSelected() ) );
connect( m_searchWidget, SIGNAL( downPressed() ), m_playlistView, SLOT( setFocus() ) );
connect( m_playlistView, SIGNAL( found() ), m_searchWidget, SLOT( match() ) );
connect( m_playlistView, SIGNAL( notFound() ), m_searchWidget, SLOT( noMatch() ) );
connect( LayoutManager::instance(), SIGNAL( activeLayoutChanged() ), m_playlistView, SLOT( reset() ) );
mainPlaylistlayout->setSpacing( 0 );
mainPlaylistlayout->addWidget( m_playlistView );
KHBox *barBox = new KHBox( this );
barBox->setMargin( 0 );
KToolBar *plBar = new Amarok::ToolBar( barBox );
plBar->setObjectName( "PlaylistToolBar" );
Model::instance();
// the Controller ctor creates the undo/redo actions that we use below, so we want
// to make sure that it's been constructed and the the actions registered
Controller::instance();
{
//START Playlist toolbar
plBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred );
plBar->setIconDimensions( 22 );
plBar->setMovable( false );
plBar->addAction( new KToolBarSpacerAction( this ) );
plBar->addAction( Amarok::actionCollection()->action( "playlist_clear" ) );
//FIXME this action should go in ActionController, but we don't have any visibility to the view
KAction *action = new KAction( KIcon( "music-amarok" ), i18n("Show active track"), this );
connect( action, SIGNAL( triggered( bool ) ), m_playlistView, SLOT( scrollToActiveTrack() ) );
plBar->addAction( action );
plBar->addSeparator();
plBar->addAction( Amarok::actionCollection()->action( "playlist_undo" ) );
plBar->addAction( Amarok::actionCollection()->action( "playlist_redo" ) );
plBar->addSeparator();
plBar->addAction( Amarok::actionCollection()->action( "playlist_save" ) );
plBar->addAction( Amarok::actionCollection()->action( "playlist_export" ) );
plBar->addSeparator();
Playlist::LayoutConfigAction *layoutConfigAction = new Playlist::LayoutConfigAction( this );
plBar->addAction( layoutConfigAction );
QToolButton *tbutton = qobject_cast<QToolButton*>(plBar->widgetForAction( layoutConfigAction ) );
if( tbutton )
tbutton->setPopupMode( QToolButton::InstantPopup );
//.........这里部分代码省略.........