本文整理汇总了C++中KIconLoader::loadIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ KIconLoader::loadIcon方法的具体用法?C++ KIconLoader::loadIcon怎么用?C++ KIconLoader::loadIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIconLoader
的用法示例。
在下文中一共展示了KIconLoader::loadIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skipGuiItem
KMyMoneyBriefSchedule::KMyMoneyBriefSchedule(QWidget *parent, const char *name )
: kScheduleBriefWidget(parent,name, WStyle_Customize | WStyle_NoBorder)
{
KIconLoader *ic = KGlobal::iconLoader();
m_nextButton->setPixmap(BarIcon(QString::fromLatin1("1rightarrow")));
m_prevButton->setPixmap(BarIcon(QString::fromLatin1("1leftarrow")));
connect(m_prevButton, SIGNAL(clicked()), this, SLOT(slotPrevClicked()));
connect(m_nextButton, SIGNAL(clicked()), this, SLOT(slotNextClicked()));
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(m_skipButton, SIGNAL(clicked()), this, SLOT(slotSkipClicked()));
connect(m_buttonEnter, SIGNAL(clicked()), this, SLOT(slotEnterClicked()));
KGuiItem skipGuiItem( i18n("&Skip"),
QIconSet(ic->loadIcon("player_fwd", KIcon::Small, KIcon::SizeSmall)),
i18n("Skip this transaction"),
i18n("Use this button to skip this transaction"));
m_skipButton->setGuiItem(skipGuiItem);
KGuiItem enterGuiItem( i18n("&Enter"),
QIconSet(ic->loadIcon("key_enter", KIcon::Small, KIcon::SizeSmall)),
i18n("Record this transaction into the register"),
i18n("Use this button to record this transaction"));
m_buttonEnter->setGuiItem(enterGuiItem);
}
示例2: KListView
/**
* Initialize this object.
*/
PortageTreeView::PortageTreeView( QWidget* parent, const char* name )
: KListView( parent, name )
{
portageTree = NULL;
// load root and category item icons
KIconLoader* iconLoader = KGlobal::iconLoader();
pxRootItem = iconLoader->loadIcon( ALLPACKAGESICON, KIcon::Small );
pxCategoryItem = iconLoader->loadIcon( CATEGORYICON, KIcon::Small );
this->header()->hide();
this->addColumn( "Categories" );
this->setColumnWidthMode( 0, QListView::Maximum );
this->setRootIsDecorated( true );
rootItem = new KListViewItem( this, ALLPACKAGESTEXT );
rootItem->setExpandable( true );
rootItem->setOpen( true );
rootItem->setPixmap( 0, pxRootItem );
this->setFullWidth( true );
connect( this, SIGNAL(selectionChanged(QListViewItem*)),
this, SLOT(emitSelectionChanged(QListViewItem*)) );
}
示例3: upButtonItem
KSettingsHome::KSettingsHome(QWidget* parent) :
KSettingsHomeDecl(parent),
m_noNeedToUpdateList(false)
{
m_homePageList->setSortingEnabled(false);
KIconLoader* il = KIconLoader::global();
KGuiItem upButtonItem(i18nc("Move item up", "&Up"),
il->loadIcon("go-up", KIconLoader::Small, KIconLoader::SizeSmall),
i18n("Move selected item up"),
i18n("Use this to move the selected item up by one position in the list."));
KGuiItem downButtonItem(i18n("&Down"),
il->loadIcon("go-down", KIconLoader::Small, KIconLoader::SizeSmall),
i18n("Move selected item down"),
i18n("Use this to move the selected item down by one position in the list."));
KGuiItem::assign(m_upButton, upButtonItem);
m_upButton->setEnabled(false);
KGuiItem::assign(m_downButton, downButtonItem);
m_downButton->setEnabled(false);
// connect this, so that the list gets loaded once the edit field is filled
connect(kcfg_ItemList, SIGNAL(textChanged(QString)), this, SLOT(slotLoadItems()));
connect(m_homePageList, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectHomePageItem()));
connect(m_homePageList, SIGNAL(clicked(QModelIndex)), this, SLOT(slotUpdateItemList()));
connect(m_upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
connect(m_downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown()));
// Don't show it to the user, we only need it to load and save the settings
kcfg_ItemList->hide();
}
示例4: nbSelectionPoints
ClusterView::ClusterView(KlustersDoc& doc,KlustersView& view,QColor backgroundColor,int timeInterval,KStatusBar * statusBar,QWidget* parent, const char* name,
int minSize, int maxSize, int windowTopLeft ,int windowBottomRight, int border) :
ViewWidget(doc,view,backgroundColor,statusBar,parent,name,minSize,maxSize,windowTopLeft,windowBottomRight,border),
selectionPolygon(0), nbSelectionPoints(0),polygonClosed(false),existLastMovingLine(false)
{
//Set the default mode
mode = ZOOM;
//Initialize internal variables
timeDimension = doc.data().timeDimension();
samplingInterval = doc.data().intervalOfSampling();
setTimeStepInSecond(timeInterval);
//Update the dimension of the window and the values of dimensionX and dimensionY
updatedDimensions(view.abscissaDimension(),view.ordinateDimension());
KIconLoader *loader = KGlobal::iconLoader();
newClusterCursor = QCursor(loader->loadIcon("new_cluster_cursor", KIcon::User),0,0);
newClustersCursor = QCursor(loader->loadIcon("new_clusters_cursor", KIcon::User),0,0);
deleteNoiseCursor = QCursor(loader->loadIcon("delete_noise_cursor", KIcon::User),0,0);
deleteArtefactCursor = QCursor(loader->loadIcon("delete_artefact_cursor", KIcon::User),0,0);
selectTimeCursor = QCursor(loader->loadIcon("select_time_cursor", KIcon::User),0,0);
//The default tool is the zoom.
setCursor(zoomCursor);
//Allowed the mouse tracking to draw the tracking lines and write the mouse coordinates
setMouseTracking(true) ;
}
示例5: testUnknownIconNotCached
void testUnknownIconNotCached()
{
// This is a test to ensure that "unknown" icons do not pin themselves
// in the icon loader. Or in other words, if an "unknown" icon is
// returned, but the appropriate icon is subsequently installed
// properly, the next request for that icon should return the new icon
// instead of the unknown icon.
// Since we'll need to create an icon we'll need a temporary directory,
// and we want that established before creating the icon loader.
QString tempRoot = QDir::tempPath() + QLatin1String("/kiconloader_unittest");
QString temporaryDir = tempRoot + QLatin1String("/hicolor/22x22/actions");
QVERIFY(QDir::root().mkpath(temporaryDir));
QVERIFY(KGlobal::dirs()->addResourceDir("icon", tempRoot, false));
KIconLoader iconLoader;
// First find an existing icon. The only ones installed for sure by
// kdelibs are the kimproxy ones.
QString loadedIconPath = iconLoader.iconPath(
QLatin1String("presence_online"),
KIconLoader::DefaultState,
false /* Ensure "unknown" icon can't be returned */
);
QVERIFY(!loadedIconPath.isEmpty());
QString nonExistingIconName = QLatin1String("fhqwhgads_homsar");
// Find a non-existent icon, allowing unknown icon to be returned
QPixmap nonExistingIcon = iconLoader.loadIcon(
nonExistingIconName, KIconLoader::Toolbar);
QCOMPARE(nonExistingIcon.isNull(), false);
// Install the existing icon by copying.
QFileInfo existingIconInfo(loadedIconPath);
QString newIconPath = temporaryDir + QLatin1String("/")
+ nonExistingIconName + QLatin1String(".png");
QVERIFY(QFile::copy(loadedIconPath, newIconPath));
// Verify the icon can now be found.
QPixmap nowExistingIcon = iconLoader.loadIcon(
nonExistingIconName, KIconLoader::Toolbar);
QVERIFY(nowExistingIcon.cacheKey() != nonExistingIcon.cacheKey());
QCOMPARE(iconLoader.iconPath(nonExistingIconName, KIconLoader::Toolbar),
newIconPath);
// Cleanup
QFile::remove(newIconPath);
QStringList entries(QDir(tempRoot).entryList(
QDir::Dirs | QDir::NoDotAndDotDot,
QDir::Name | QDir::Reversed));
Q_FOREACH(const QString &dirName, entries) {
QDir::root().rmdir(dirName);
}
示例6: getFolderIcon
QPixmap KWalletFolderItem::getFolderIcon(KIcon::Group group){
KIconLoader *loader = KGlobal::instance()->iconLoader();
QPixmap pix = loader->loadIcon( _name, group, 0,
KIcon::DefaultState, 0, true );
if (pix.isNull())
pix = loader->loadIcon( _name.lower(), group, 0,
KIcon::DefaultState, 0, true);
if (pix.isNull())
pix = loader->loadIcon( "folder_red", group, 0,
KIcon::DefaultState, 0, true);
return pix;
}
示例7: getFolderIcon
QPixmap KWalletFolderItem::getFolderIcon(KIconLoader::Group group){
KIconLoader *loader = KIconLoader::global();
QPixmap pix = loader->loadIcon( _name, group, 0,
KIconLoader::DefaultState, QStringList(),0, true );
if (pix.isNull())
pix = loader->loadIcon( _name.toLower(), group, 0,
KIconLoader::DefaultState, QStringList(),0, true);
if (pix.isNull())
pix = loader->loadIcon( QLatin1String( "folder-red" ), group, 0,
KIconLoader::DefaultState, QStringList(),0, true);
return pix;
}
示例8: icoLoad
void ViewWidget::icoLoad()
{
KIconLoader iconLoader;
QIcon icoLeft(iconLoader.loadIcon(QString("object-rotate-left"),(KIconLoader::Group)4));
ui->pushButton_2->setIcon(icoLeft);
QIcon icoRight(iconLoader.loadIcon(QString("object-rotate-right"),(KIconLoader::Group)4));
ui->pushButton_3->setIcon(icoRight);
QIcon icoDownload(iconLoader.loadIcon(QString("download"),(KIconLoader::Group)4));
ui->pushButton_4->setIcon(icoDownload);
QIcon icoDel(iconLoader.loadIcon(QString("edit-delete"),(KIconLoader::Group)4));
ui->pushButton->setIcon(icoDel);
}
示例9: main
int main(int argc, char *argv[])
{
KAboutData about("kiconloadertest", 0, ki18n("kiconloadertest"), "version");
KCmdLineArgs::init(argc, argv, &about);
KApplication app;
KIconLoader * mpLoader = KIconLoader::global();
KIconLoader::Context mContext = KIconLoader::Application;
QTime dt;
dt.start();
int count = 0;
for ( int mGroup = 0; mGroup < KIconLoader::LastGroup ; ++mGroup )
{
kDebug() << "queryIcons " << mGroup << "," << mContext;
const QStringList filelist = mpLoader->queryIcons(mGroup, mContext);
kDebug() << " -> found " << filelist.count() << " icons.";
int i=0;
for(QStringList::ConstIterator it = filelist.begin();
it != filelist.end() /*&& i<10*/;
++it, ++i )
{
//kDebug() << ( i==9 ? "..." : (*it) );
mpLoader->loadIcon( (*it), (KIconLoader::Group)mGroup );
++count;
}
}
kDebug() << "Loading " << count << " icons took " << (float)(dt.elapsed()) / 1000 << " seconds";
}
示例10: slotPlayButtonToggled
void SlidePlaybackWidget::slotPlayButtonToggled()
{
if (m_playButton->isChecked())
{
m_canHide = false;
KIconLoader* loader = KIconLoader::global();
m_playButton->setIcon(loader->loadIcon("media-playback-start", KIconLoader::NoGroup, 22));
emit signalPause();
}
else
{
m_canHide = true;
KIconLoader* loader = KIconLoader::global();
m_playButton->setIcon(loader->loadIcon("media-playback-pause", KIconLoader::NoGroup, 22));
emit signalPlay();
}
}
示例11: setState
void setState(enum STATE state)
{
m_state = state;
KIconLoader *loader = KIconLoader::global();
switch (state)
{
case InitialState:
setIcon(0, QIcon());
break;
case SaveOKState:
setIcon(0, loader->loadIcon("dialog-ok", KIconLoader::NoGroup,/*height()*/16));
// "ok" icon should probably be "dialog-success", but we don't have that icon in KDE 4.0
break;
case SaveFailedState:
setIcon(0, loader->loadIcon("dialog-error", KIconLoader::NoGroup,/*height()*/16));
break;
}
}
示例12: SIGNAL
KFFOpt_scenery::KFFOpt_scenery( QWidget *parent )
: KFFOpt_skeleton( parent )
{
KIconLoader loader;
ui_widget.setupUi ( this );
m_aircraftIcon = loader.loadIcon( "kffplane", KIconLoader::Small );
m_weatherIcon = loader.loadIcon( "kffweather", KIconLoader::Small );
m_shipIcon = loader.loadIcon( "kffboat", KIconLoader::Small );
m_trainIcon = loader.loadIcon( "kfftrain", KIconLoader::Small );
m_unknowIcon = KIconLoader::unknown();
connect( ui_widget.btn_refresh,
SIGNAL( clicked() ),
SLOT( reload() )
);
}
示例13: slotNexPrevClicked
void SlidePlaybackWidget::slotNexPrevClicked()
{
if (!m_playButton->isChecked())
{
m_playButton->setChecked(true);
m_canHide = false;
KIconLoader* loader = KIconLoader::global();
m_playButton->setIcon(loader->loadIcon("media-playback-start", KIconLoader::NoGroup, 22));
emit signalPause();
}
}
示例14: getSystemIcon
QPixmap Util::getSystemIcon( const QString& name )
{
#ifdef QT_ONLY
QPixmap pix;
pix.convertFromImage( qembed_findImage( name ) );
return pix;
#else
KIconLoader loader;
return loader.loadIcon( name, KIcon::Toolbar);
#endif
}
示例15: showFavoriteContextMenu
void KFFWin_Flightplan::showFavoriteContextMenu( const QPoint &pos )
{
KIconLoader loader;
QPixmap pixmap;
QIcon icon;
QAction* remove;
QAction* clear;
QAction* edit;
QAction* moveup;
QAction* movedown;
QAction* calc;
KMenu menu( this );
pixmap = loader.loadIcon( "edit-delete", KIconLoader::Small );
icon.addPixmap( pixmap );
remove = new QAction( icon, i18n( "&Remove waypoint" ), this );
remove->setStatusTip( i18n( "Remove this waypoint" ) );
connect( remove, SIGNAL( triggered() ), this, SLOT( removeNavaids() ) );
pixmap = loader.loadIcon( "edit-clear-list", KIconLoader::Small );
icon.addPixmap( pixmap );
clear = new QAction( icon, i18n( "&Clear all waypoints" ), this );
clear->setStatusTip( i18n( "Clear waypoint list" ) );
connect( clear, SIGNAL( triggered() ), ui_widget.treewidget_navaids, SLOT( clear() ) );
pixmap = loader.loadIcon( "edit-rename", KIconLoader::Small );
icon.addPixmap( pixmap );
edit = new QAction( icon, i18n( "&Edit waypoint altitude" ), this );
edit->setStatusTip( i18n( "Edit this waypoint" ) );
connect( edit, SIGNAL( triggered() ), this, SLOT( edit() ) );
pixmap = loader.loadIcon( "arrow-up", KIconLoader::Small );
icon.addPixmap( pixmap );
moveup = new QAction( icon, i18n( "&Move waypoint up" ), this );
moveup->setStatusTip( i18n( "Move this waypoint up" ) );
connect( moveup, SIGNAL( triggered() ), this, SLOT( moveItemUp() ) );
pixmap = loader.loadIcon( "arrow-down", KIconLoader::Small );
icon.addPixmap( pixmap );
movedown = new QAction( icon, i18n( "&Move waypoint down" ), this );
movedown->setStatusTip( i18n( "Move this waypoint down" ) );
connect( movedown, SIGNAL( triggered() ), this, SLOT( moveItemDown() ) );
pixmap = loader.loadIcon( "view-refresh", KIconLoader::Small );
icon.addPixmap( pixmap );
calc = new QAction( icon, i18n( "&Recalculate Distance" ), this );
calc->setStatusTip( i18n( "Force recalculate distance between all waypoints" ) );
connect( calc, SIGNAL( triggered() ), this, SLOT( recalculate() ) );
menu.addAction( remove );
menu.addAction( edit );
menu.addSeparator();
menu.addAction( clear );
menu.addSeparator();
menu.addAction( moveup );
menu.addAction( movedown );
menu.addSeparator();
menu.addAction( calc );
menu.exec( mapToGlobal( pos + ui_widget.treewidget_navaids->pos() ) );
}