Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_graphicsview_qgraphicswidget.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
4#include <QGraphicsWidget>
5#include <QStyleOptionGroupBox>
6
8{
10public:
12 void examples(QGraphicsWidget *a, QGraphicsWidget *b,
13 QGraphicsWidget *c, QGraphicsWidget *d);
14 bool isFlat() const;
15};
16
17//! [0]
18void MyGroupBoxWidget::initStyleOption(QStyleOption *option) const
19{
20 QGraphicsWidget::initStyleOption(option);
21 if (QStyleOptionGroupBox *box = qstyleoption_cast<QStyleOptionGroupBox *>(option)) {
22 // Add group box specific state.
23 box->text = tr("My Group Box");
24 //...
25 }
26}
27//! [0]
28
29
30void MyGroupBoxWidget::examples(QGraphicsWidget *a, QGraphicsWidget *b,
31 QGraphicsWidget *c, QGraphicsWidget *d)
32{
33 {
34 //! [1]
35 setTabOrder(a, b); // a to b
36 setTabOrder(b, c); // a to b to c
37 setTabOrder(c, d); // a to b to c to d
38 //! [1]
39 }
40
41 {
42 //! [2]
43 // WRONG
44 setTabOrder(c, d); // c to d
45 setTabOrder(a, b); // a to b AND c to d
46 setTabOrder(b, c); // a to b to c, but not c to d
47 //! [2]
48 }
49}
void examples(QGraphicsWidget *a, QGraphicsWidget *b, QGraphicsWidget *c, QGraphicsWidget *d)
[0]
bool isFlat() const