Translations:Development/Tutorials/Using Actions/12/en: Difference between revisions

From KDE TechBase
(Importing a new version from external source)
 
(No difference)

Latest revision as of 07:31, 26 October 2019

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/Using Actions)
#include "mainwindow.h"
 
int main (int argc, char *argv[])
{
   QApplication app(argc, argv);
   KLocalizedString::setApplicationDomain("tutorial3");
    
   KAboutData aboutData(
                         // The program name used internally. (componentName)
                         QStringLiteral("tutorial3"),
                         // A displayable program name string. (displayName)
                         i18n("Tutorial 3"),
                         // The program version string. (version)
                         QStringLiteral("1.0"),
                         // Short description of what the app does. (shortDescription)
                         i18n("A simple text area using QAction etc."),
                         // The license this code is released under
                         KAboutLicense::GPL,
                         // Copyright Statement (copyrightStatement = QString())
                         i18n("(c) 2015"),
                         // Optional text shown in the About box.
                         // Can contain any information desired. (otherText)
                         i18n("Some text..."),
                         // The program homepage string. (homePageAddress = QString())
                         QStringLiteral("http://example.com/"),
                         // The bug report email address
                         // (bugsEmailAddress = QLatin1String("[email protected]")
                         QStringLiteral("[email protected]"));
   aboutData.addAuthor(i18n("Name"), i18n("Task"), QStringLiteral("[email protected]"),
                       QStringLiteral("http://your.website.com"), QStringLiteral("OSC Username"));
   KAboutData::setApplicationData(aboutData);
 
   QCommandLineParser parser;
   aboutData.setupCommandLine(&parser);
   parser.process(app);
   aboutData.processCommandLine(&parser);
    
   MainWindow* window = new MainWindow();
   window->show();
    
   return app.exec();
}
</syntaxhighlight>
  1. include "mainwindow.h"

int main (int argc, char *argv[]) {

   QApplication app(argc, argv);
   KLocalizedString::setApplicationDomain("tutorial3");
   
   KAboutData aboutData(
                        // The program name used internally. (componentName)
                        QStringLiteral("tutorial3"),
                        // A displayable program name string. (displayName)
                        i18n("Tutorial 3"),
                        // The program version string. (version)
                        QStringLiteral("1.0"),
                        // Short description of what the app does. (shortDescription)
                        i18n("A simple text area using QAction etc."),
                        // The license this code is released under
                        KAboutLicense::GPL,
                        // Copyright Statement (copyrightStatement = QString())
                        i18n("(c) 2015"),
                        // Optional text shown in the About box.
                        // Can contain any information desired. (otherText)
                        i18n("Some text..."),
                        // The program homepage string. (homePageAddress = QString())
                        QStringLiteral("http://example.com/"),
                        // The bug report email address
                        // (bugsEmailAddress = QLatin1String("[email protected]")
                        QStringLiteral("[email protected]"));
   aboutData.addAuthor(i18n("Name"), i18n("Task"), QStringLiteral("[email protected]"),
                       QStringLiteral("http://your.website.com"), QStringLiteral("OSC Username"));
   KAboutData::setApplicationData(aboutData);

   QCommandLineParser parser;
   aboutData.setupCommandLine(&parser);
   parser.process(app);
   aboutData.processCommandLine(&parser);
   
   MainWindow* window = new MainWindow();
   window->show();
   
   return app.exec();

} </syntaxhighlight>