diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-19 02:06:21 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-19 02:06:21 (GMT) |
commit | fb6775d423f1ebe7e624951edf39d79ca0433d4a (patch) | |
tree | 4b5b93d3c2d835b268ce16f2fe9a91e4b89ecfde /doc/src/snippets/code/src_gui_qproxystyle.cpp | |
parent | 9c7c859647771d5d2fa466b0a3ff9d408edecd38 (diff) | |
parent | f9f08de9d41fd55d9c7d01578191ef5d4099c9e6 (diff) | |
download | Qt-fb6775d423f1ebe7e624951edf39d79ca0433d4a.zip Qt-fb6775d423f1ebe7e624951edf39d79ca0433d4a.tar.gz Qt-fb6775d423f1ebe7e624951edf39d79ca0433d4a.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
configure.exe
tools/qdoc3/htmlgenerator.cpp
Diffstat (limited to 'doc/src/snippets/code/src_gui_qproxystyle.cpp')
-rw-r--r-- | doc/src/snippets/code/src_gui_qproxystyle.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp new file mode 100644 index 0000000..a9c55b3 --- /dev/null +++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp @@ -0,0 +1,45 @@ +//! [0] +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 1; + return QProxyStyle::styleHint(hint, option, widget, returnData); + } +}; + +//! [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] |