当前位置:网站首页>QT embeds the sub QT program window into the current program
QT embeds the sub QT program window into the current program
2022-06-30 11:28:00 【windSnowLi】
Subroutine main code
#include "ChildWidgets.h"
#include <QtWidgets/QApplication>
#include <QWindow>
#include <iostream>
#include <QMessageBox>
#include <thread>
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
ChildWidgets w;
w.show();
w.createWinId();
// Output
std::cerr << w.winId() << std::endl;
return a.exec();
}
The main code of the main program
InWidgets::InWidgets(QWidget* parent)
: QMainWindow(parent)
{
this->resize(600, 400);
// Get the path where the program is located
QString path = QCoreApplication::applicationDirPath();
path += "/ChildWidgets.exe";
process = new QProcess(this);
connect(process, &QProcess::readyReadStandardError, [&]() {
quint64 winId = process->readAllStandardError().toLongLong();
QWindow* childWin = QWindow::fromWinId(winId);
if (childWin)
{
QWidget* widget = QWidget::createWindowContainer(childWin);
this->setCentralWidget(widget);
}
});
process->start(path);
// Child window embeds in the current window
process->setParent(this);
}
result

Address :https://download.csdn.net/download/qq_44575789/85800705
边栏推荐
- MCU firmware packaging Script Software
- 100 important knowledge points that SQL must master: Combined Query
- A theoretical defect of relative position coding transformer and Its Countermeasures
- “新数科技”完成数千万元A+轮融资,造一体化智能数据库云管理平台
- LVGL 8.2 Simple Image button
- 数据库 级联操作
- R语言查看版本 R包查看版本
- 【西安交通大学】考研初试复试资料分享
- Esp32-c3 introductory tutorial IOT part ⑤ - Alibaba cloud Internet of things platform espaliyun RGB LED practical mass production solution
- 华三交换机清空配置
猜你喜欢

Multiparty Cardinality Testing for Threshold Private Set-2021:解读

Go language defer

以PolarDB为代表的阿里云数据库以跻身全球第一阵营

How harmful are these "unreliable" experiences in the postgraduate entrance examination?

数据库连接池 druid

It's time for the kotlin coroutine to schedule thread switching to solve the mystery

从开源项目探讨“FPGA挖矿”的本质

R语言去重操作unique duplicate filter

EMC-浪涌

建立自己的网站(13)
随机推荐
语音信号处理-基础(五):傅立叶变换
Line generation (Gauss elimination method, linear basis)
什么是微信小程序,带你推开小程序的大门
The reasoning delay on iphone12 is only 1.6 MS! Snap et al. Analyzed the transformer structure latency in detail, and used NAS to find out the efficient network structure of mobile devices
LiveData源码赏析三 —— 常见问题
100 important knowledge points that SQL must master: Combined Query
Esp32-c3 introductory tutorial basic part ⑫ - mass production burning device configuration and serial number, NVS partition confirmation, NVS partition generation program, CSV to bin
Flutter start from scratch 008 form
Problems and solutions in pyinstall packaging for pychart project
R语言查看版本 R包查看版本
200000 bonus pool! [Alibaba security × ICDM 2022] the risk commodity inspection competition on the large-scale e-commerce map is in hot registration
SQL必需掌握的100个重要知识点:使用存储过程
Qt嵌入子Qt程序窗口到当前程序
Oracle NetSuite 助力 TCM Bio,洞悉数据变化,让业务发展更灵活
【leetcode 239】滑动窗口
Win10 R package installation error: not installed in arch=i386
It's time for the kotlin coroutine to schedule thread switching to solve the mystery
SQL必需掌握的100个重要知识点:插入数据
Introduction to game theory
CVPR 2022 | 大幅减少零样本学习所需人工标注,马普所和北邮提出富含视觉信息的类别语义嵌入...