From kde-commits Wed Mar 25 19:13:12 2009 From: Jaroslaw Staniek Date: Wed, 25 Mar 2009 19:13:12 +0000 To: kde-commits Subject: koffice/kexi/koproperty2/koproperty/test Message-Id: <1238008392.634553.4379.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123800840824515 SVN commit 944583 by staniek: KoProperty = test: added --font-size option M +28 -7 main.cpp --- trunk/koffice/kexi/koproperty2/koproperty/test/main.cpp #944582:944583 @@ -17,11 +17,14 @@ * Boston, MA 02110-1301, USA. */ +#include + +#include +#include +#include +#include + #include "test.h" -#include -#include -#include -#include static const char description[] = "A test application for the KoProperty library"; @@ -35,13 +38,31 @@ KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; - options.add("flat", ki18n("Flat display: don't display groups\n(useful for testing)")); - options.add("ro", ki18n("Set all properties as read-only:\n(useful for testing read-only mode)")); - options.add("property ", ki18n("Display only specified property\n(useful when we want to focus on testing a single property editor)")); + options.add("flat", + ki18n("Flat display: don't display groups\n" + "(useful for testing)")); + options.add("font-size ", + ki18n("Set font size to (in points)\n" + "(useful for testing whether editors keep the font settings)")); + options.add("property ", + ki18n("Display only specified property\n" + "(useful when we want to focus on testing a single\n" + "property editor)")); + options.add("ro", + ki18n("Set all properties as read-only:\n" + "(useful for testing read-only mode)")); KCmdLineArgs::addCmdLineOptions(options); KApplication app; TestWindow test; + bool ok; + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + const int fontSize = args->getOption("font-size").toInt(&ok); + if (fontSize > 0 && ok) { + QFont f(test.font()); + f.setPointSize(fontSize); + test.setFont(f); + } test.show(); return app.exec();