Home > other >  For help! Embedding external programs related to qt interface
For help! Embedding external programs related to qt interface

Time:12-08

The small white recently want to apply a useful search everything embedded in their development of interface, met a very strange question, gives full source https://wws.lanzous.com/iAzuLj4a2hc
Everying's official website: https://www.voidtools.com/zh-cn/support/everything/installing_everything/

Because don't know this knowledge, so the reference is also a way of the Internet, after browsing for a lot of this kind of blog finally delivered such a thing, however, found out the major problems, program didn't embedded in qt interface!!!!! The beginning in the design of interface by means of drag drag a widget, idea is to embed the external program this widget, then in order to detect problems with the methods such as the code 1, then I found that the problem appeared to be! I create QWindow object inside is empty, no everything the external program in it! Here can beats me, how to also don't understand! For bosses to help analyze a wave, improve once, just the last a little bit of progress!

This is part of the bosses may not download the complete can see question:
Mainwindow. CPP:
# include "mainwindow. H"
# include "ui_mainwindow. H"
# include "qpushbutton. H"//button controls the header file
# include & lt; QProcess>
H # include "Windows."
# include "stdio.h"
# include & lt; QDebug>
# include & lt; QMainWindow>
# include & lt; QWindow>
MainWindow: : MainWindow (QWidget * parent) : QMainWindow (parent), UI (new UI: : MainWindow)
{
QProcess * pro=new QProcess (this);
Pro - & gt; Start (" C:/Program Files/Everything/Everything. Exe ", QStringList (" C:/Program Files/Everything/Everything. Exe ")); The UI - & gt; SetupUi (this);
}
Void MainWindow: : both ()
{QString Name="Everything";
QString Name2="MainWindow";
WId HWND=(WId) FindWindow (L "EVERYTHING", (LPCTSTR) Name. Unicode ());
WId m_hWnd=(WId) FindWindow (L "Qt5QWindowIcon", (LPCTSTR) Name2. Unicode ());
QDebug () & lt; QDebug () & lt; QWindow * m_window;
M_window=QWindow: : fromWinId (WId (HWND));
QWidget * m_widget;
M_widget=QWidget: : createWindowContainer (m_window, this);
//method 1
SetCentralWidget (m_widget);
}
Void MainWindow: : on_pushButton_clicked ()
{
//QProcess * pro=new QProcess (this);
//pro - & gt; Start (" C:/Program Files/Everything/Everything. Exe ", QStringList (" C:/Program Files/Everything/Everything. Exe "));
Both (the);
}
MainWindow: : ~ MainWindow () {delete UI; }

CodePudding user response:

New findings: trying to embed other system at different programs such as calculators, also does not have embedded a success? Because the embedded widget interface is a piece of white, no calculator interface, and embedded when everything is all grey, seems not container is empty but other problems?
  • Related