diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-06-17 09:27:43 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-06-17 09:27:43 (GMT) |
commit | cd43fc3a5fed0b3c45050d1fb286cef39ee1ac52 (patch) | |
tree | 6b62676ed1a5f0e9cee9900391c1904bf51bd4c1 /doc/src/snippets/code | |
parent | d72727cb7530da54b59c51effa97263512e9238c (diff) | |
parent | fe59d3a82040e7202b4330a9da36fa4591e778c9 (diff) | |
download | Qt-cd43fc3a5fed0b3c45050d1fb286cef39ee1ac52.zip Qt-cd43fc3a5fed0b3c45050d1fb286cef39ee1ac52.tar.gz Qt-cd43fc3a5fed0b3c45050d1fb286cef39ee1ac52.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qt-main/qgraphicssceneindex
Diffstat (limited to 'doc/src/snippets/code')
-rw-r--r-- | doc/src/snippets/code/src_gui_qproxystyle.cpp | 30 |
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] |