71 lines
2.4 KiB
Diff
71 lines
2.4 KiB
Diff
qt5_textedit_example.patch
|
|
|
|
From: Christian Prochaska <christian.prochaska@genode-labs.com>
|
|
|
|
|
|
---
|
|
qtbase/examples/widgets/richtext/textedit/main.cpp | 20 ++++++++++++++++----
|
|
.../widgets/richtext/textedit/textedit.pro | 4 ----
|
|
2 files changed, 16 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/qtbase/examples/widgets/richtext/textedit/main.cpp b/qtbase/examples/widgets/richtext/textedit/main.cpp
|
|
index 1de6d99..b802866 100644
|
|
--- a/qtbase/examples/widgets/richtext/textedit/main.cpp
|
|
+++ b/qtbase/examples/widgets/richtext/textedit/main.cpp
|
|
@@ -31,6 +31,10 @@
|
|
**
|
|
****************************************************************************/
|
|
|
|
+/* Genode includes */
|
|
+#include <os/config.h>
|
|
+
|
|
+/* Qt includes */
|
|
#include "textedit.h"
|
|
|
|
#include <QApplication>
|
|
@@ -42,6 +46,16 @@ int main(int argc, char *argv[])
|
|
{
|
|
Q_INIT_RESOURCE(textedit);
|
|
|
|
+ unsigned int x = 300;
|
|
+ unsigned int y = 0;
|
|
+ unsigned int w = 700;
|
|
+ unsigned int h = 700;
|
|
+
|
|
+ try { Genode::config()->xml_node().attribute("xpos").value(&x); } catch (...) { }
|
|
+ try { Genode::config()->xml_node().attribute("ypos").value(&y); } catch (...) { }
|
|
+ try { Genode::config()->xml_node().attribute("width").value(&w); } catch (...) { }
|
|
+ try { Genode::config()->xml_node().attribute("height").value(&h); } catch (...) { }
|
|
+
|
|
QApplication a(argc, argv);
|
|
QCoreApplication::setOrganizationName("QtProject");
|
|
QCoreApplication::setApplicationName("Rich Text");
|
|
@@ -55,10 +69,8 @@ int main(int argc, char *argv[])
|
|
|
|
TextEdit mw;
|
|
|
|
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mw);
|
|
- mw.resize(availableGeometry.width() / 2, (availableGeometry.height() * 2) / 3);
|
|
- mw.move((availableGeometry.width() - mw.width()) / 2,
|
|
- (availableGeometry.height() - mw.height()) / 2);
|
|
+ mw.move(x, y);
|
|
+ mw.resize(w, h);
|
|
|
|
if (!mw.load(parser.positionalArguments().value(0, QLatin1String(":/example.html"))))
|
|
mw.fileNew();
|
|
diff --git a/qtbase/examples/widgets/richtext/textedit/textedit.pro b/qtbase/examples/widgets/richtext/textedit/textedit.pro
|
|
index c32bf68..704f738 100644
|
|
--- a/qtbase/examples/widgets/richtext/textedit/textedit.pro
|
|
+++ b/qtbase/examples/widgets/richtext/textedit/textedit.pro
|
|
@@ -9,10 +9,6 @@ SOURCES = textedit.cpp \
|
|
main.cpp
|
|
|
|
RESOURCES += textedit.qrc
|
|
-build_all:!build_pass {
|
|
- CONFIG -= build_all
|
|
- CONFIG += release
|
|
-}
|
|
|
|
EXAMPLE_FILES = textedit.qdoc
|
|
|