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
mywidget.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
<
QtGui
>
5
#
include
<
QtUiTools
>
6
7
#
include
"mywidget.h"
8
9
//! [0]
10
MyWidget
::
MyWidget
(QWidget *parent)
11
:
QWidget
(
parent
)
12
{
13
QFile file(
":/forms/myform.ui"
);
14
if
(!file.open(QFile::ReadOnly))
15
qFatal(
"Cannot open resource file"
);
16
17
QUiLoader loader;
18
QWidget *myWidget = loader.load(&file,
this
);
19
20
QVBoxLayout *layout =
new
QVBoxLayout;
21
layout->addWidget(myWidget);
22
setLayout(layout);
23
}
24
//! [0]
MyWidget
[24]
Definition
src_corelib_kernel_qobject.cpp:264
MyWidget::MyWidget
MyWidget(QWidget *parent=nullptr)
[0]
Definition
mywidget.cpp:10
qttools
src
uitools
doc
snippets
quiloader
mywidget.cpp
Generated on
for Qt by
1.14.0