Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_gui_qproxystyle.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5#include "textedit.h"
6#include <QApplication>
7#include <QProxyStyle>
8
10{
11 public:
13 const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
14 {
16 return 0;
17 return QProxyStyle::styleHint(hint, option, widget, returnData);
18 }
19};
20
21int main(int argc, char **argv)
22{
23 Q_INIT_RESOURCE(textedit);
24
25 QApplication a(argc, argv);
26 a.setStyle(new MyProxyStyle);
27 TextEdit mw;
28 mw.resize(700, 800);
29 mw.show();
30 //...
31}
33
35...
37proxy->setParent(widget); // take ownership to avoid memleak
39...
int styleHint(StyleHint hint, const QStyleOption *option=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const override
Returns an integer representing the specified style hint for the given widget described by the provid...
The QApplication class manages the GUI application's control flow and main settings.
static QStyle * style()
Returns the application's style object.
The QProxyStyle class is a convenience class that simplifies dynamically overriding QStyle elements.
Definition qproxystyle.h:17
int styleHint(StyleHint hint, const QStyleOption *option=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
\variable QStyleOptionGraphicsItem::exposedRect
The QStyleOption class stores the parameters used by QStyle functions.
StyleHint
This enum describes the available style hints.
Definition qstyle.h:584
@ SH_UnderlineShortcut
Definition qstyle.h:626
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void setStyle(QStyle *)
Sets the widget's GUI style to style.
Definition qwidget.cpp:2630
QOpenGLWidget * widget
[1]
int main()
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint name
GLuint GLenum option
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_INIT_RESOURCE(name)
Definition qtresource.h:14
auto proxy
[1]