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]
10MyWidget::MyWidget(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(QWidget *parent=nullptr)
[0]
Definition mywidget.cpp:10