diff options
author | Tobias Koenig <tokoe@kde.org> | 2009-07-05 08:47:45 (GMT) |
---|---|---|
committer | Tobias Koenig <tokoe@kde.org> | 2009-07-05 08:47:45 (GMT) |
commit | 5db5a9d5d878157a643a441d426ff739084ca031 (patch) | |
tree | d10017bbc11e62e44a7ced7e35de8516964e794a /doc/src/snippets/code/src_gui_qproxystyle.cpp | |
parent | 65c2d095cddfda32052925654dd1defd314ad4b3 (diff) | |
parent | 84bbac2a4d7b663e57b74094cbebf8fca16e0ed8 (diff) | |
download | Qt-5db5a9d5d878157a643a441d426ff739084ca031.zip Qt-5db5a9d5d878157a643a441d426ff739084ca031.tar.gz Qt-5db5a9d5d878157a643a441d426ff739084ca031.tar.bz2 |
Merge branch 'master' of git://gitorious.org/qt/qt
Diffstat (limited to 'doc/src/snippets/code/src_gui_qproxystyle.cpp')
-rw-r--r-- | doc/src/snippets/code/src_gui_qproxystyle.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp index 7633160..46a2a5f 100644 --- a/doc/src/snippets/code/src_gui_qproxystyle.cpp +++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp @@ -3,7 +3,7 @@ class MyProxyStyle : public QProxyStyle { public: - int styleHint(StyleHint hint, const QStyleOption *option = 0, + int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const { if (hint == QStyle::SH_UnderlineShortcut) @@ -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] |