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


C++ KIconLoader类代码示例

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


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

示例1: setWindowIcon

void AddBackupWizard::initView()
{
  KIconLoader* loader = KIconLoader::global();
  setWindowIcon( loader->loadIcon( "tools-wizard", KIconLoader::Small ));

  page1 = new AddBackupWizardPage1(this);
  addPage(page1);

  page2 = new AddBackupWizardPage2(this);
  addPage(page2);

  page3 = new AddBackupWizardPage3(this);
  addPage(page3);
}
开发者ID:ayoy,项目名称:kaveau,代码行数:14,代码来源:addbackupwizard.cpp

示例2: showTitleFor

void ModuleTitle::showTitleFor(ConfigModule *config)
{
    if(!config)
        return;

    QWhatsThis::remove(this);
    QWhatsThis::add(this, config->comment());
    KIconLoader *loader = KGlobal::instance()->iconLoader();
    QPixmap icon = loader->loadIcon(config->icon(), KIcon::NoGroup, 22);
    m_icon->setPixmap(icon);
    m_name->setText(config->moduleName());

    show();
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:14,代码来源:dockcontainer.cpp

示例3: ServiceBase

OpmlDirectoryService::OpmlDirectoryService( OpmlDirectoryServiceFactory* parent, const QString &name, const QString &prettyName )
 : ServiceBase( name, parent, false, prettyName )
{
    setShortDescription( i18n( "A large listing of podcasts" ) );
    setIcon( KIcon( "view-services-opml-amarok" ) );

    setLongDescription( i18n( "A comprehensive list of searchable podcasts that you can subscribe to directly from within Amarok." ) );

    KIconLoader loader;
    setImagePath( loader.iconPath( "view-services-opml-amarok", -128, true ) );

    The::amarokUrlHandler()->registerRunner( this, command() );

    setServiceReady( true );
}
开发者ID:darthcodus,项目名称:Amarok,代码行数:15,代码来源:OpmlDirectoryService.cpp

示例4: reloadImages

void starter::reloadImages()
{
   KIconLoader* iLoader = KGlobal::iconLoader();
   QString pth;
   if (_VALID_(BaseURL))
      pth = configDialog->BaseURL->url();
   else
      pth = iLoader->iconPath("bStarter", KIcon::Small, true);
   if (pth)
      pixmap = QImage(pth);
   if (!pth || pixmap.isNull())
   {
      pixmap = QPixmap(22,22);
      pixmap.fill(Qt::black);
   }
   pth = QString();
   if (_VALID_(HoverURL))
      pth = configDialog->HoverURL->url();
   else
      pth = iLoader->iconPath("bStarter_hover", KIcon::Small, true);
   if (pth)
      hoverPixmap = QImage(pth);
   if (!pth || hoverPixmap.isNull())
   {
      hoverPixmap = QPixmap(22,22);
      hoverPixmap.fill(Qt::black);
   }
   pth = QString();
   if (_VALID_(DownURL))
      pth = configDialog->DownURL->url();
   else
      pth = iLoader->iconPath("bStarter_down", KIcon::Small, true);
   if (pth)
      downPixmap = QImage(pth);
   if (!pth || downPixmap.isNull())
   {
      downPixmap = QPixmap(22,22);
      downPixmap.fill(Qt::white);
   }
   int wd = pixmap.width();
   int ht = pixmap.height();
   if (wd < hoverPixmap.width()) wd = hoverPixmap.width();
   if (wd < downPixmap.width()) wd = downPixmap.width();
   if (ht < hoverPixmap.height()) ht = hoverPixmap.height();
   if (ht < downPixmap.height()) ht = downPixmap.height();
   mainView->setFixedSize(wd,ht);
   repaint();
}
开发者ID:iegor,项目名称:x11-themes-baghira,代码行数:48,代码来源:starter.cpp

示例5: icoLeft

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);

}
开发者ID:b0noI,项目名称:KBookOCR,代码行数:16,代码来源:viewwidget.cpp

示例6: _img

void
KbfxPlasmaCanvasItem::setIconPath ( QString str )
{
	KIconLoader *iconload = KGlobal::iconLoader ();
	m_iconPath =  iconload->iconPath ( str, KIcon::Desktop, false );
//	m_icon.load(m_iconPath);
	QImage _img ( m_iconPath );

	if ( _img.height() > 128 )
	{
		_img = _img.smoothScale ( 32,32 );

	}

	m_icon.convertFromImage ( _img );

}
开发者ID:plexydesk,项目名称:kbfxmenu,代码行数:17,代码来源:kbfxplasmacanvasitem.cpp

示例7: signalPause

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();
    }
}
开发者ID:UIKit0,项目名称:digikam,代码行数:17,代码来源:slideplaybackwidget.cpp

示例8: menu

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() ) );
}
开发者ID:ac001,项目名称:ffs-central,代码行数:60,代码来源:win_flightplan.cpp

示例9: KPassivePopup

/**
 * Construct the popup
 * Add extra widgets to the passive popup & connect buttons to mainwindow signals.
 */
OSUpdaterPopup::OSUpdaterPopup(QWidget * parent,MainWindow * mainWindow) : KPassivePopup(parent)
{
	setTimeout(30000);

	_popupLayout = new QVBoxLayout(this, 11, 20, "popupLayout");

	_titleLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"titleLayout");

	_title = new QLabel("<b>openSUSE updater.</b>",this);
	_title->setTextFormat(Qt::RichText);
	_title->setAlignment(Qt::SingleLine);

	_closeButton = new QPushButton("x",this,"closebutton");
	_closeButton->setMinimumSize(QSize(20,20));
	_closeButton->setMaximumSize(QSize(20,20));
	connect(_closeButton, SIGNAL(clicked()),this, SLOT(hide()));

	_titleLayout->addWidget(_title);
	_titleLayout->addStretch();
	_titleLayout->addWidget(_closeButton);
	
	_description = new QLabel(this);

	KIconLoader *loader = KGlobal::iconLoader();
	QPixmap icon = loader->loadIcon("msg_warning",KIcon::Panel);
	_iconLabel = new QLabel(this);
	_iconLabel->setPixmap(icon);
	_descriptionLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"descriptionlayout");

	_descriptionLayout->addWidget(_iconLabel);
	_descriptionLayout->addWidget(_description);
	
	_buttonLayout = new QHBoxLayout(_popupLayout,KDialog::spacingHint(),"buttonLayout");

	_installButton = new QPushButton(i18n("Install"),this,"installbutton");
	_cancelButton = new QPushButton(i18n("Ignore"),this,"ignorebutton");
	connect(_cancelButton, SIGNAL(clicked()),this, SLOT(hide()));
	connect(_installButton, SIGNAL(clicked()),mainWindow, SIGNAL(startInstall()));
	connect(_installButton, SIGNAL(clicked()),this, SLOT(hide()));

	_buttonLayout->addStretch();
	_buttonLayout->addWidget(_installButton);
	_buttonLayout->addWidget(_cancelButton);
	_buttonLayout->addStretch();
}
开发者ID:BackupTheBerlios,项目名称:kzmd-updater-svn,代码行数:49,代码来源:osupdaterpopup.cpp

示例10: KFFOpt_skeleton

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() )
	       );
}
开发者ID:ac001,项目名称:ffs-central,代码行数:18,代码来源:opt_scenery.cpp

示例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;
   }
 }
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:18,代码来源:katesavemodifieddialog.cpp

示例12: showItems

void InformationPanelContent::showItems(const KFileItemList& items)
{
    m_pendingPreview = false;

    KIconLoader iconLoader;
    QPixmap icon = iconLoader.loadIcon("dialog-information",
                                       KIconLoader::NoGroup,
                                       KIconLoader::SizeEnormous);
    m_preview->setPixmap(icon);
    setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));

    if (m_metaDataWidget) {
        m_metaDataWidget->setItems(items);
    }

    m_phononWidget->hide();

    m_item = KFileItem();
}
开发者ID:blue-shell,项目名称:folderview,代码行数:19,代码来源:informationpanelcontent.cpp

示例13: insertLibraryCataloguesAndIcons

void insertLibraryCataloguesAndIcons() {
  static const char * const catalogs[] = {
    "libkdepim",
    "libksieve",
    "libkleopatra",
    "libkpgp",
    "libkmime",
    "libmessagelist",
    "libmessagecore"
  };

  KLocale * l = KGlobal::locale();
  KIconLoader * il = KIconLoader::global();
  for ( unsigned int i = 0 ; i < sizeof catalogs / sizeof *catalogs ; ++i ) {
    l->insertCatalog( catalogs[i] );
    il->addAppDir( catalogs[i] );
  }

}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:19,代码来源:kmstartup.cpp

示例14: i18n

void
SummaryWidget::createDiskMaps()
{
    DiskList disks;

    const QCString free = i18n( "Free" ).local8Bit();
    const QCString used = i18n( "Used" ).local8Bit();

    KIconLoader loader;

    oldScheme = Config::scheme;
    Config::scheme = (Filelight::MapScheme)2000;

    for (DiskList::ConstIterator it = disks.begin(), end = disks.end(); it != end; ++it)
    {
        Disk const &disk = *it;

        if (disk.free == 0 && disk.used == 0)
            continue;

        QWidget *box = new QVBox( this );
        RadialMap::Widget *map = new MyRadialMap( box );

        QString text; QTextOStream( &text )
            << "<img src='" << loader.iconPath( disk.icon, KIcon::Toolbar ) << "'>"
            << " &nbsp;" << disk.mount << " "
            << "<i>(" << disk.device << ")</i>";

        QLabel *label = new QLabel( text, box );
        label->setAlignment( Qt::AlignCenter );
        label->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum );

        box->show(); // will show its children too

        Directory *tree = new Directory( disk.mount.local8Bit() );
        tree->append( free, disk.free );
        tree->append( used, disk.used );

        map->create( tree ); //must be done when visible

        connect( map, SIGNAL(activated( const KURL& )), SIGNAL(activated( const KURL& )) );
    }
}
开发者ID:BackupTheBerlios,项目名称:macfilelight-svn,代码行数:43,代码来源:summaryWidget.cpp

示例15: testLoadMimeTypeIcon

    void testLoadMimeTypeIcon()
    {
        QFETCH(QString, iconName);
        QFETCH(QString, expectedFileName);
        KIconLoader iconLoader;
        QString path;
        QPixmap pix = iconLoader.loadMimeTypeIcon(iconName, KIconLoader::Desktop, 24,
                                                  KIconLoader::DefaultState, QStringList(),
                                                  &path );
        QVERIFY(!pix.isNull());
        QCOMPARE(path.section('/', -1), expectedFileName);

        // do the same test using a global iconloader, so that
        // we get into the final return statement, which can only happen
        // if d->extraDesktopIconsLoaded becomes true first....
        QString path2;
        pix = KIconLoader::global()->loadMimeTypeIcon(iconName, KIconLoader::Desktop, 24,
                                                      KIconLoader::DefaultState, QStringList(),
                                                      &path2 );
        QVERIFY(!pix.isNull());
        QCOMPARE(path2, path);
    }
开发者ID:vasi,项目名称:kdelibs,代码行数:22,代码来源:kiconloader_unittest.cpp


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