本文整理汇总了C++中SmallIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ SmallIcon函数的具体用法?C++ SmallIcon怎么用?C++ SmallIcon使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SmallIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Q_ASSERT
/** @return the Job's current status icon */
QIcon Job::statusIcon() const
{
static const char* icons[] =
{
"dialog-information",
"dialog-ok",
"dialog-error"
};
Q_ASSERT(status() >= 0 && static_cast<quint32>(status()) < sizeof(icons) / sizeof(icons[0]));
if (status() < 0 || static_cast<quint32>(status()) >= sizeof(icons) / sizeof(icons[0]))
return QIcon();
return SmallIcon(icons[status()]);
}
示例2: KDialog
KTimerDialog::KTimerDialog( int msec, TimerStyle style, QWidget *parent,
const char *name, bool modal,
const QString &caption,
int buttonMask, ButtonCode defaultButton,
bool separator,
const KGuiItem &user1,
const KGuiItem &user2,
const KGuiItem &user3 )
: KDialog( parent )
{
setObjectName( name );
setModal( modal );
setCaption( caption );
setButtons( (ButtonCodes)buttonMask );
setDefaultButton( defaultButton );
showButtonSeparator( separator );
setButtonGuiItem( User1, user1 );
setButtonGuiItem( User2, user2 );
setButtonGuiItem( User3, user3 );
totalTimer = new QTimer( this );
totalTimer->setSingleShot( true );
updateTimer = new QTimer( this );
updateTimer->setSingleShot( false );
msecTotal = msecRemaining = msec;
updateInterval = 1000;
tStyle = style;
KWindowSystem::setIcons( winId(), DesktopIcon("randr"), SmallIcon("randr") );
// default to canceling the dialog on timeout
if ( buttonMask & Cancel )
buttonOnTimeout = Cancel;
connect( totalTimer, SIGNAL( timeout() ), SLOT( slotInternalTimeout() ) );
connect( updateTimer, SIGNAL( timeout() ), SLOT( slotUpdateTime() ) );
// create the widgets
mainWidget = new KVBox( this );
timerWidget = new KHBox( mainWidget );
timerLabel = new QLabel( timerWidget );
timerProgress = new QProgressBar( timerWidget );
timerProgress->setRange( 0, msecTotal );
timerProgress->setTextVisible( false );
KDialog::setMainWidget( mainWidget );
slotUpdateTime( false );
}
示例3: foreach
void AltLangStrEdit::loadLangAltListEntries()
{
d->languageCB->blockSignals(true);
d->languageCB->clear();
// In first we fill already assigned languages.
QStringList list = d->values.keys();
if (!list.isEmpty())
{
foreach(const QString& item, list)
{
d->languageCB->addItem(item);
d->languageCB->setItemIcon(d->languageCB->count()-1, SmallIcon("dialog-ok"));
}
示例4: KXmlGuiWindow
TopWidget::TopWidget() : KXmlGuiWindow(0) {
// Check command line args for "-kppp"
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
bool kpppmode = args->isSet("kppp");
args->clear();
setCaption(i18n("KPPP Log Viewer"));
w = new QWidget(this);
QBoxLayout *l = new QVBoxLayout(w);
l->setSpacing(5);
td = new QTabWidget(w);
mw = new MonthlyWidget();
td->addTab(mw, i18n("Monthly Log"));
// remove buttons
if(!kpppmode) {
// create menu
mb = new KMenuBar;
l->addWidget(mb);
l->addWidget(td);
QMenu *fm = new QMenu;
QAction *action = fm->addAction(QIcon(SmallIcon("application-exit")), KStandardGuiItem::quit().text());
action->setShortcut(Qt::CTRL + Qt::Key_Q);
connect(action,SIGNAL(triggered()), this, SLOT(slotExit()));
fm->setTitle(i18n("&File"));
mb->addMenu(fm);
} else {
l->addWidget(td);
mb = 0;
QPushButton *but = new KPushButton(KStandardGuiItem::close(),w);
QHBoxLayout *lh = new QHBoxLayout();
l->addItem(lh);
lh->addStretch(10);
lh->addWidget(but);
connect(but, SIGNAL(clicked()),
kapp, SLOT(quit()));
}
setMinimumSize(mw->sizeHint().width() + 15,
mw->sizeHint().height() + 120);
setCentralWidget(w);
}
示例5: KDevLanguageSupport
RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStringList& )
: KDevLanguageSupport (&data, parent, name ? name : "RubySupportPart" )
{
setInstance(RubySupportFactory::instance());
setXMLFile("kdevrubysupport.rc");
KAction *action;
action = new KAction( i18n("&Run"), "exec", SHIFT + Key_F9,
this, SLOT(slotRun()),
actionCollection(), "build_execute" );
action->setToolTip(i18n("Run"));
action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));
action->setIcon("ruby_run.png");
action = new KAction( i18n("Run Test Under Cursor"), "exec", ALT + Key_F9,
this, SLOT(slotRunTestUnderCursor()),
actionCollection(), "build_execute_test_function" );
action->setToolTip(i18n("Run Test Under Cursor"));
action->setWhatsThis(i18n("<b>Run Test Under Cursor</b><p>Runs the function under the cursor as test."));
action = new KAction( i18n("Launch Browser"), "network", 0, this, SLOT(slotBrowse()), actionCollection(), "build_launch_browser" );
action->setToolTip(i18n("Launch Browser"));
action->setWhatsThis(i18n("<b>Launch Browser</b><p>Opens a web browser pointing to the Ruby Rails server") );
action = new KAction( i18n("Switch To Controller"), 0, CTRL+ALT+Key_1, this, SLOT(slotSwitchToController()), actionCollection(), "switch_to_controller" );
action = new KAction( i18n("Switch To Model"), 0, CTRL+ALT+Key_2, this, SLOT(slotSwitchToModel()), actionCollection(), "switch_to_model" );
action = new KAction( i18n("Switch To View"), 0, CTRL+ALT+Key_3, this, SLOT(slotSwitchToView()), actionCollection(), "switch_to_view" );
action = new KAction( i18n("Switch To Test"), 0, CTRL+ALT+Key_4, this, SLOT(slotSwitchToTest()), actionCollection(), "switch_to_test" );
kdDebug() << "Creating RubySupportPart" << endl;
m_shellWidget = new KDevShellWidget( 0, "irb console");
m_shellWidget->setIcon( SmallIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
m_shellWidget->setCaption(i18n("Ruby Shell"));
mainWindow()->embedOutputView( m_shellWidget, i18n("Ruby Shell"), i18n("Ruby Shell"));
mainWindow()->raiseView( m_shellWidget );
connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
connect( partController(), SIGNAL(savedFile(const KURL&)),
this, SLOT(savedFile(const KURL&)) );
connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
this, SLOT(projectConfigWidget(KDialogBase*)) );
}
示例6: setLockStatus
void BasketStatusBar::setLockStatus(bool isLocked)
{
if (!m_lockStatus)
return;
if (isLocked) {
m_lockStatus->setPixmap(SmallIcon("encrypted.png"));
m_lockStatus->setToolTip(i18n(
"<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").replace(" ", " "));
// QToolTip::add(m_lockStatus, i18n("This basket is locked.\nClick to unlock it."));
} else {
m_lockStatus->clear();
m_lockStatus->setToolTip(i18n(
"<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").replace(" ", " "));
// QToolTip::add(m_lockStatus, i18n("This basket is unlocked.\nClick to lock it."));
}
}
示例7: QGraphicsView
SingleView::SingleView(Plasma::Corona *corona, Plasma::Containment *containment, const QString &pluginName, int appletId, const QVariantList &appletArgs, QWidget *parent)
: QGraphicsView(parent),
m_applet(0),
m_containment(containment),
m_corona(corona)
{
setScene(m_corona);
QFileInfo info(pluginName);
if (!info.isAbsolute()) {
info = QFileInfo(QDir::currentPath() + '/' + pluginName);
}
if (info.exists()) {
m_applet = Plasma::Applet::loadPlasmoid(info.absoluteFilePath(), appletId, appletArgs);
}
if (!m_applet) {
m_applet = Plasma::Applet::load(pluginName, appletId, appletArgs);
}
if (!m_applet) {
kDebug() << "failed to load" << pluginName;
return;
}
m_containment->addApplet(m_applet, QPointF(-1, -1), false);
m_containment->resize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
m_applet->setPos(0, 0);
m_applet->setFlag(QGraphicsItem::ItemIsMovable, false);
setSceneRect(m_applet->sceneBoundingRect());
setWindowTitle(m_applet->name());
setWindowIcon(SmallIcon(m_applet->icon()));
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFrameStyle(QFrame::NoFrame);
QAction *action = m_applet->action("remove");
delete action;
QAction *quitAction = KStandardAction::quit(this, SLOT(close()), this);
m_applet->addAction(QString("remove"), quitAction);
addAction(quitAction);
// enforce the applet being our size
connect(m_applet, SIGNAL(geometryChanged()), this, SLOT(updateGeometry()));
}
示例8: i18n
/**
* @short Shows a popup
* @author Rene Schmidt <[email protected]>
* @version 0.1
*/
void KLAidWidget::showPopUp(QString &caption, QString &text, uint &tOut)
{
// Tell user when the next popup will be shown
QToolTip::add(tray, i18n("K Learning Aid %1").arg(VER) + "\nNext PopUp will be shown at " + aut->projectTime(aut->getInterval()));
// this is a candidate for subclassing... Copied in part from kpassivepopup.cpp (c) by KDE Team
KPassivePopup *pop = new KPassivePopup( tray );
pop->setPaletteForegroundColor(*tmpFgColor);
pop->setPaletteBackgroundColor(*tmpBgColor);
QVBox *vb = new QVBox( pop );
vb->setSpacing( KDialog::spacingHint() );
QHBox *hb=0;
hb = new QHBox(vb);
hb->setMargin(0);
hb->setSpacing(KDialog::spacingHint() );
QLabel *ttlIcon=0;
ttlIcon = new QLabel( hb, "title_icon" );
ttlIcon->setPixmap( SmallIcon("ktimer") );
ttlIcon->setAlignment( AlignLeft );
if ( !caption.isEmpty() ) {
QLabel *ttl=0;
ttl = new QLabel(caption, hb ? hb : vb, "title_label");
ttl->setFont( *fntCaption );
ttl->setAlignment( Qt::AlignHCenter );
if ( hb )
hb->setStretchFactor( ttl, 10 ); // enforce centering
}
if ( !text.isEmpty() ) {
QLabel *msg=0;
msg = new QLabel( text, vb, "msg_label" );
msg->setFont( *fntBody );
msg->setAlignment( AlignLeft );
}
pop->setTimeout(tOut);
//pop->setView( title, txt, SmallIcon("ktimer"));
pop->setView(vb);
pop->show();
}
示例9: dlg
void MonthWidget::mouseReleaseEvent(QMouseEvent* event)
{
if (!contentsRect().contains(event->pos())) return;
if (event->button() == Qt::LeftButton)
{
KIPIPlugins::ImageDialog dlg( this, interface_, true );
setImage(dlg.url());
}
else if (event->button() == Qt::RightButton)
{
imagePath_ = QString("");
CalSettings::instance()->setImage(month_,imagePath_);
setThumb(QPixmap(SmallIcon("image-x-generic",
KIconLoader::SizeMedium,
KIconLoader::DisabledState)));
}
}
示例10: KDialog
/**
* Initializes the ui.
* @param parent the parent widget
* @param name the name of this widget
*/
Login::Login(QWidget *parent, const char *name) : KDialog(parent,name),
progress(NULL),
lastLoginName(""),
loggingOnError(false),
logingIn(false),
manualLogOff(false){
setCaption("Kinkatta - Login");
setIcon(SmallIcon("kinkatta"));
i_aimSettings = setup::settings();
initDialog();
KConfig &config = *KGlobal::config();
config.setGroup("Login Window Location");
int x = config.readNumEntry("x", -1);
int y = config.readNumEntry("y", -1);
if( x != -1 && y != -1)
setGeometry(x, y, 300, 200);
}
示例11: QObject
UiStyle::UiStyle(QObject *parent)
: QObject(parent),
_channelJoinedIcon(SmallIcon("irc-channel-active")),
_channelPartedIcon(SmallIcon("irc-channel-inactive")),
_userOfflineIcon(SmallIcon("im-user-offline")),
_userOnlineIcon(SmallIcon("im-user")),
_userAwayIcon(SmallIcon("im-user-away")),
_categoryOpIcon(SmallIcon("irc-operator")),
_categoryVoiceIcon(SmallIcon("irc-voice")),
_opIconLimit(UserCategoryItem::categoryFromModes("o")),
_voiceIconLimit(UserCategoryItem::categoryFromModes("v"))
{
// register FormatList if that hasn't happened yet
// FIXME I don't think this actually avoids double registration... then again... does it hurt?
if (QVariant::nameToType("UiStyle::FormatList") == QVariant::Invalid) {
qRegisterMetaType<FormatList>("UiStyle::FormatList");
qRegisterMetaTypeStreamOperators<FormatList>("UiStyle::FormatList");
Q_ASSERT(QVariant::nameToType("UiStyle::FormatList") != QVariant::Invalid);
}
_uiStylePalette = QVector<QBrush>(NumRoles, QBrush());
// Now initialize the mapping between FormatCodes and FormatTypes...
_formatCodes["%O"] = Base;
_formatCodes["%B"] = Bold;
_formatCodes["%S"] = Italic;
_formatCodes["%U"] = Underline;
_formatCodes["%R"] = Reverse;
_formatCodes["%DN"] = Nick;
_formatCodes["%DH"] = Hostmask;
_formatCodes["%DC"] = ChannelName;
_formatCodes["%DM"] = ModeFlags;
_formatCodes["%DU"] = Url;
setTimestampFormatString("[hh:mm:ss]");
// BufferView / NickView settings
UiStyleSettings s;
_showBufferViewIcons = _showNickViewIcons = s.value("ShowItemViewIcons", true).toBool();
s.notify("ShowItemViewIcons", this, SLOT(showItemViewIconsChanged(QVariant)));
_allowMircColors = s.value("AllowMircColors", true).toBool();
s.notify("AllowMircColors", this, SLOT(allowMircColorsChanged(QVariant)));
loadStyleSheet();
}
示例12: QDialog
SettingsDlg::SettingsDlg(QWidget *parent)
: QDialog(parent),
_currentPage(0)
{
ui.setupUi(this);
setModal(true);
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowIcon(SmallIcon("configure"));
updateGeometry();
ui.settingsTree->setRootIsDecorated(false);
connect(ui.settingsTree, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelected()));
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
setButtonStates();
}
示例13: generateId
void KXmlCommandAdvancedDlg::slotAddGroup()
{
if (m_view->currentItem())
{
TQString ID = generateId(m_opts);
DrGroup *grp = new DrGroup;
grp->setName(ID);
grp->set("text", i18n("New Group"));
m_opts[ID] = grp;
TQListViewItem *item = new TQListViewItem(m_view->currentItem(), i18n("New Group"), ID);
item->setRenameEnabled(0, true);
item->setPixmap(0, SmallIcon("folder"));
m_view->ensureItemVisible(item);
item->startRename(0);
}
}
示例14: it
void BracketStackList::slotThumbnail(const KUrl& url, const QPixmap& pix)
{
QTreeWidgetItemIterator it(this);
while (*it)
{
BracketStackItem* item = static_cast<BracketStackItem*>(*it);
if (item->url() == url)
{
if (pix.isNull())
item->setThumbnail(SmallIcon("image-x-generic", iconSize().width(), KIconLoader::DisabledState));
else
item->setThumbnail(pix.scaled(iconSize().width(), iconSize().height(), Qt::KeepAspectRatio));
return;
}
++it;
}
}
示例15: KDevPlugin
ValgrindPart::ValgrindPart( QObject *parent, const char *name, const QStringList& )
: KDevPlugin( &data, parent, name ? name : "ValgrindPart" )
{
setInstance( ValgrindFactory::instance() );
setXMLFile( "kdevpart_valgrind.rc" );
proc = new KShellProcess();
connect( proc, SIGNAL(receivedStdout( KProcess*, char*, int )),
this, SLOT(receivedStdout( KProcess*, char*, int )) );
connect( proc, SIGNAL(receivedStderr( KProcess*, char*, int )),
this, SLOT(receivedStderr( KProcess*, char*, int )) );
connect( proc, SIGNAL(processExited( KProcess* )),
this, SLOT(processExited( KProcess* )) );
connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
connect( core(), SIGNAL(projectOpened()),
this, SLOT(projectOpened()) );
m_widget = new ValgrindWidget( this );
m_widget->setIcon( SmallIcon("fork") );
m_widget->setCaption(i18n("Valgrind Output"));
QWhatsThis::add( m_widget, i18n( "<b>Valgrind</b><p>Shows the output of the valgrind. Valgrind detects<br>"
"use of uninitialized memory<br>"
"reading/writing memory after it has been free'd<br>"
"reading/writing off the end of malloc'd blocks<br>"
"reading/writing inappropriate areas on the stack<br>"
"memory leaks -- where pointers to malloc'd blocks are lost forever<br>"
"passing of uninitialised and/or unaddressable memory to system calls<br>"
"mismatched use of malloc/new/new [] vs free/delete/delete []<br>"
"some abuses of the POSIX pthread API." ) );
KAction* action = new KAction( i18n("&Valgrind Memory Leak Check"), 0, this,
SLOT(slotExecValgrind()), actionCollection(), "tools_valgrind" );
action->setToolTip(i18n("Valgrind memory leak check"));
action->setWhatsThis(i18n("<b>Valgrind memory leak check</b><p>Runs Valgrind - a tool to help you find memory-management problems in your programs."));
action = new KAction( i18n("P&rofile with KCachegrind"), 0, this,
SLOT(slotExecCalltree()), actionCollection(), "tools_calltree" );
action->setToolTip(i18n("Profile with KCachegrind"));
action->setWhatsThis(i18n("<b>Profile with KCachegrind</b><p>Runs your program in calltree and then displays profiler information in KCachegrind."));
mainWindow()->embedOutputView( m_widget, "Valgrind", i18n("Valgrind memory leak check") );
}