Created
July 28, 2012 09:10
-
-
Save shamsuzzamansadi/3192586 to your computer and use it in GitHub Desktop.
KDE programming tutorial -- Hello world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdlib> | |
| #include <KApplication> | |
| #include <KAboutData> | |
| #include <KCmdLineArgs> | |
| #include <KMessageBox> | |
| #include <KLocale> | |
| int main (int argc, char *argv[]) | |
| { | |
| KAboutData aboutData( | |
| // The program name used internally. | |
| "tutorial1", | |
| // The message catalog name | |
| // If null, program name is used instead. | |
| 0, | |
| // A displayable program name string. | |
| ki18n("Tutorial 1"), | |
| // The program version string. | |
| "1.0", | |
| // Short description of what the app does. | |
| ki18n("Displays a KMessageBox popup"), | |
| // The license this code is released under | |
| KAboutData::License_GPL, | |
| // Copyright Statement | |
| ki18n("(c) 2007"), | |
| // Optional text shown in the About box. | |
| // Can contain any information desired. | |
| ki18n("Some text..."), | |
| // The program homepage string. | |
| "http://example.com/", | |
| // The bug report email address | |
| "submit@bugs.kde.org"); | |
| KCmdLineArgs::init( argc, argv, &aboutData ); | |
| KApplication app; | |
| KGuiItem yesButton( i18n( "Hello" ), QString(), | |
| i18n( "This is a tooltip" ), | |
| i18n( "This is a WhatsThis help text." ) ); | |
| return | |
| KMessageBox ::questionYesNo | |
| (0, i18n( "Hello World" ), i18n( "Hello" ), yesButton ) | |
| == KMessageBox ::Yes? EXIT_SUCCESS: EXIT_FAILURE; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment