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
7
class
MyGroupBoxWidget
:
public
QGraphicsWidget
8
{
9
Q_OBJECT
10
public
:
11
void
initStyleOption
(
QStyleOption
*
option
)
const
;
12
void
examples
(QGraphicsWidget *a, QGraphicsWidget *b,
13
QGraphicsWidget *c, QGraphicsWidget *d);
14
bool
isFlat
()
const
;
15
};
16
17
//! [0]
18
void
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
30
void
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
}
MyGroupBoxWidget
Definition
src_gui_graphicsview_qgraphicswidget.cpp:8
MyGroupBoxWidget::examples
void examples(QGraphicsWidget *a, QGraphicsWidget *b, QGraphicsWidget *c, QGraphicsWidget *d)
[0]
Definition
src_gui_graphicsview_qgraphicswidget.cpp:30
MyGroupBoxWidget::isFlat
bool isFlat() const
qtbase
src
widgets
doc
snippets
code
src_gui_graphicsview_qgraphicswidget.cpp
Generated on
for Qt by
1.16.1