Jump to content

Translations:Development/Tutorials/First program/KDE4/14/en: Difference between revisions

From KDE TechBase
FuzzyBot (talk | contribs)
Importing a new version from external source
 
(No difference)

Latest revision as of 10:34, 11 March 2016

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/First program/KDE4)
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;
}
</syntaxhighlight>
The first KDE specific code we come across in this program is {{class|KAboutData}}. This is the class used to store information about the program such as a short description, authors or license information. Pretty much every KDE application should use this class.

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;

} </syntaxhighlight> The first KDE specific code we come across in this program is KAboutData. This is the class used to store information about the program such as a short description, authors or license information. Pretty much every KDE application should use this class.