[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kexi/koproperty2/koproperty/test
From: Jaroslaw Staniek <js () iidea ! pl>
Date: 2009-03-25 19:13:12
Message-ID: 1238008392.634553.4379.nullmailer () svn ! kde ! org
[Download RAW message or body]
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 <QFont>
+
+#include <KApplication>
+#include <KAboutData>
+#include <KCmdLineArgs>
+#include <KLocale>
+
#include "test.h"
-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <klocale.h>
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 <name>", 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 <size>",
+ ki18n("Set font size to <size> (in points)\n"
+ "(useful for testing whether editors keep the font settings)"));
+ options.add("property <name>",
+ 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();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic