本文整理汇总了C++中KToolBar::sizeHint方法的典型用法代码示例。如果您正苦于以下问题:C++ KToolBar::sizeHint方法的具体用法?C++ KToolBar::sizeHint怎么用?C++ KToolBar::sizeHint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToolBar
的用法示例。
在下文中一共展示了KToolBar::sizeHint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KBookmarkHandler
//.........这里部分代码省略.........
//but easily disabled by commenting this line out
//Disabled for now because can't show . and .. folders.
//TODO: Find out a way to fix this?
//m_dir->setDropOptions( KFileView::AutoOpenDirs );
static_cast<QFrame*>(m_dir->viewWidget())->setFrameStyle( QFrame::NoFrame );
static_cast<QIconView*>(m_dir->viewWidget())->setSpacing( 1 );
actionCollection = m_dir->actionCollection();
searchPane = new SearchPane( this );
//setStretchFactor( container, 2 );
}
{
QPopupMenu* const menu = ((KActionMenu*)actionCollection->action("popupMenu"))->popupMenu();
menu->clear();
menu->insertItem( SmallIconSet( "fileopen" ), i18n( "&Load" ), MakePlaylist );
menu->insertItem( SmallIconSet( "1downarrow" ), i18n( "&Append to Playlist" ), AppendToPlaylist );
menu->insertItem( SmallIconSet( "filesave" ), i18n( "&Save as Playlist..." ), SavePlaylist );
menu->insertSeparator();
if (!m_medium)
menu->insertItem( SmallIconSet( amaroK::icon( "device" ) ), i18n( "Add to Media Device &Transfer Queue" ), CopyMediaDevice );
menu->insertItem( SmallIconSet( "collection" ), i18n( "&Copy to Collection" ), CopyToCollection );
menu->insertItem( SmallIconSet( "collection" ), i18n( "&Move to Collection" ), MoveToCollection );
menu->insertItem( SmallIconSet( "cdrom_unmount" ), i18n("Burn to CD"), BurnCd );
menu->insertSeparator();
menu->insertItem( i18n( "&Select All Files" ), SelectAllFiles );
menu->insertSeparator();
actionCollection->action( "delete" )->plug( menu );
menu->insertSeparator();
menu->insertItem( SmallIconSet( "info" ), i18n( "Edit Track &Information..." ), EditTags );
actionCollection->action( "properties" )->plug( menu );
menu->setItemEnabled( BurnCd, K3bExporter::isAvailable() );
connect( menu, SIGNAL(aboutToShow()), SLOT(prepareContextMenu()) );
connect( menu, SIGNAL(activated( int )), SLOT(contextMenuActivated( int )) );
}
{
KActionMenu *a;
a = (KActionMenu*)actionCollection->action( "sorting menu" );
a->setIcon( amaroK::icon( "configure" ) );
a->setDelayed( false ); //TODO should be done by KDirOperator
actionCollection->action( "delete" )->setShortcut( KShortcut( SHIFT + Key_Delete ) );
a = new KActionMenu( i18n("Bookmarks"), "bookmark", actionCollection, "bookmarks" );
a->setDelayed( false );
new KBookmarkHandler( m_dir, a->popupMenu() );
}
{
QStringList actions;
actions << "up" << "back" << "forward" << "home" << "reload" << "short view"
<< "detailed view" << "sorting menu" << "bookmarks";
foreach( actions )
if ( KAction *a = actionCollection->action( (*it).latin1() ) )
a->plug( toolbar );
if (disconnect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( cdUp() ) ))
debug() << "First disconnect succeeded" << endl;
else
debug() << "First disconnect did NOT succeed" << endl;
if (connect( actionCollection->action( "up" ), SIGNAL( activated() ), m_dir, SLOT( myCdUp() ) ))
debug() << "First connect succeeded" << endl;
else
debug() << "First connect did NOT succeed" << endl;
if (disconnect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( home() ) ))
debug() << "Second disconnect succeeded" << endl;
else
debug() << "Second disconnect did NOT succeed" << endl;
if (connect( actionCollection->action( "home" ), SIGNAL( activated() ), m_dir, SLOT( myHome() ) ))
debug() << "Second connect succeeded" << endl;
else
debug() << "Second connect did NOT succeed" << endl;
}
connect( m_filter, SIGNAL(textChanged( const QString& )), SLOT(setFilter( const QString& )) );
connect( m_combo, SIGNAL(urlActivated( const KURL& )), SLOT(setUrl( const KURL& )) );
connect( m_combo, SIGNAL(returnPressed( const QString& )), SLOT(setUrl( const QString& )) );
connect( m_dir, SIGNAL(viewChanged( KFileView* )), SLOT(slotViewChanged( KFileView* )) );
connect( m_dir, SIGNAL(fileSelected( const KFileItem* )), SLOT(activate( const KFileItem* )) );
connect( m_dir, SIGNAL(urlEntered( const KURL& )), SLOT(urlChanged( const KURL& )) );
connect( m_dir, SIGNAL(urlEntered( const KURL& )), searchPane, SLOT(urlChanged( const KURL& )) );
connect( m_dir, SIGNAL(dropped( const KFileItem*, QDropEvent*, const KURL::List& )),
SLOT(dropped( const KFileItem*, QDropEvent*, const KURL::List& )) );
//setSpacing( 4 );
setFocusProxy( m_dir ); //so the dirOperator is focussed when we get focus events
setMinimumWidth( toolbar->sizeHint().width() );
}