summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-06-16 11:16:27 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-06-16 11:17:06 (GMT)
commitacc764552c552df31719af561e285886085371e9 (patch)
tree0b5acde3ecca870b6fedc1d4d9ceef2ce8192d29 /doc
parenta685ede74282c7add19a2da11b0d45fe3575218c (diff)
downloadQt-acc764552c552df31719af561e285886085371e9.zip
Qt-acc764552c552df31719af561e285886085371e9.tar.gz
Qt-acc764552c552df31719af561e285886085371e9.tar.bz2
doc: Added info on two ways to customize the style.
Diffstat (limited to 'doc')
-rw-r--r--doc/src/snippets/code/src_gui_qproxystyle.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp
index 7633160..a9c55b3 100644
--- a/doc/src/snippets/code/src_gui_qproxystyle.cpp
+++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp
@@ -13,3 +13,33 @@ public:
};
//! [0]
+
+//! [1]
+#include "textedit.h"
+#include <QApplication>
+#include <QProxyStyle>
+
+class MyProxyStyle : public QProxyStyle
+{
+ public:
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
+ {
+ if (hint == QStyle::SH_UnderlineShortcut)
+ return 0;
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(textedit);
+
+ QApplication a(argc, argv);
+ a.setStyle(new MyProxyStyle);
+ TextEdit mw;
+ mw.resize(700, 800);
+ mw.show();
+ //...
+}
+//! [1]