本文整理汇总了C++中KApplication::setWindowIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ KApplication::setWindowIcon方法的具体用法?C++ KApplication::setWindowIcon怎么用?C++ KApplication::setWindowIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KApplication
的用法示例。
在下文中一共展示了KApplication::setWindowIcon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
KAboutData aboutData("liri-control-kde4",
0,
ki18n("Liri Control"), //programname
ABOUT_VERSION, //version
ki18n(ABOUT_SUMMARY), //short Desc
KAboutData::License_LGPL_V3, //license
ki18n(ABOUT_COPYRIGHT), //copywrite statement
ki18n("Status of liri components"), //text
"http://cerebro.webhop.net/liri", //homepage
ABOUT_AUTHOR_EMAIL); //bugsemail address
aboutData.addAuthor(ki18n(ABOUT_AUTHOR), ki18n("Lead developer"), ABOUT_AUTHOR_EMAIL);
aboutData.setProgramIconName(QLatin1String("liri-control"));
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication app;
app.setWindowIcon(KIcon(QLatin1String("liri-control")));
app.setQuitOnLastWindowClosed(true);
BusConnection* busconnection = new BusConnection();
/* self freeing object! */
MainWindow* window = new MainWindow(busconnection);
window->show();
int res = app.exec();
delete busconnection;
return res;
}
示例2: main
int main(int argc, char *argv[]) {
printf("Kamerka version %s\n Copyright (C) 2011-2014 Sebastian Krzyszkowiak\n", VERSION);
printf(" Kamerka comes with ABSOLUTELY NO WARRANTY.\n");
printf(" This is free software, and you are welcome to redistribute it\n");
printf(" under certain conditions; type `./kamerka --license' for details.\n\n");
fflush(stdout);
QApplication::setGraphicsSystem("raster"); // improves performance a lot, should be default on modern systems
KAboutData aboutData("kamerka", 0, ki18n("Kamerka"), VERSION,
ki18n("Simple photo taking application with fancy animated interface"),
KAboutData::License_GPL, ki18n("Copyright (C) 2011-2014 Sebastian Krzyszkowiak") );
KCmdLineArgs::init(argc, argv, &aboutData);
KApplication a;
QIcon icon(":/icons/kamerka.png");
a.setWindowIcon(icon);
new MainWindow();
return a.exec();
}
示例3: kScreenSaverMain
int kScreenSaverMain( int argc, char** argv, KScreenSaverInterface& screenSaverInterface )
{
KLocale::setMainCatalog("libkscreensaver");
KCmdLineArgs::init(argc, argv, screenSaverInterface.aboutData());
KCmdLineOptions options;
options.add("setup", ki18n("Setup screen saver"));
options.add("window-id wid", ki18n("Run in the specified XWindow"));
options.add("root", ki18n("Run in the root XWindow"));
options.add("demo", ki18n("Start screen saver in demo mode"), "default");
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
// Set a useful default icon.
app.setWindowIcon(KIcon("preferences-desktop-screensaver"));
if (!pipe(termPipe))
{
#ifndef Q_WS_WIN
struct sigaction sa;
sa.sa_handler = termHandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, 0);
#endif
QSocketNotifier *sn = new QSocketNotifier(termPipe[0], QSocketNotifier::Read, &app);
QObject::connect(sn, SIGNAL(activated(int)), &app, SLOT(quit()));
}
#ifdef Q_WS_X11
oldXErrorHandler = XSetErrorHandler(xErrorHandler);
#endif
KCrash::setCrashHandler( crashHandler );
KGlobal::locale()->insertCatalog("klock");
KGlobal::locale()->insertCatalog("kscreensaver");
DemoWindow *demoWidget = 0;
Window saveWin = 0;
KScreenSaver *target;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->isSet("setup"))
{
QDialog *dlg = screenSaverInterface.setup();
args->clear();
dlg->exec();
delete dlg;
return 0;
}
if (args->isSet("window-id"))
{
#ifdef Q_WS_WIN
saveWin = (HWND)(args->getOption("window-id").toULong());
#else
saveWin = args->getOption("window-id").toInt();
#endif
}
#ifdef Q_WS_X11 //FIXME
if (args->isSet("root"))
{
QX11Info inf;
saveWin = RootWindow(QX11Info::display(), inf.screen());
}
#endif
if (args->isSet("demo"))
{
saveWin = 0;
}
if (saveWin == 0)
{
demoWidget = new DemoWindow();
demoWidget->setAttribute(Qt::WA_NoSystemBackground);
demoWidget->setAttribute(Qt::WA_PaintOnScreen);
demoWidget->show();
app.processEvents();
saveWin = demoWidget->winId();
}
target = screenSaverInterface.create( saveWin );
target->setAttribute(Qt::WA_PaintOnScreen);
target->show();
if (demoWidget)
{
target->installEventFilter( demoWidget );
}
//.........这里部分代码省略.........