Embed external application

Embed external application

tagopinath
Enthusiast Enthusiast
600 Views
4 Replies
Message 1 of 5

Embed external application

tagopinath
Enthusiast
Enthusiast

Hello everyone,

 

I am trying to embed as external application inside 3ds Max through Qt dialog in our plugin.

This is working fine, but issue is, i am not able to see the Title and Menu bar of that external application.

 

Here is the code what i am trying.

 

            QWindow* window = QWindow::fromWinId(hWnd);
            QWidget* container = QWidget::createWindowContainer(window);// , centralWidget);
           
            QMdiSubWindow* subWindow = new QMdiSubWindow(this);
            subWindow->setWidget(container);
            subWindow->setAttribute(Qt::WA_DeleteOnClose);
            subWindow->setWindowTitle("Program 1");
            subWindow->setWindowState(Qt::WindowMaximized);

            Qt::WindowFlags flags = subWindow->windowFlags();
            flags |= Qt::FramelessWindowHint;
            flags |= Qt::WindowSystemMenuHint;
            subWindow->setWindowFlags(flags); 
            container->show();
            
            QHBoxLayout* buttonLayout = new QHBoxLayout(this);
            buttonLayout->addWidget(container);

            QVBoxLayout* mainLayout = new QVBoxLayout(this);
            //// ... add other widgets ...
            mainLayout->addLayout(buttonLayout);
            mainLayout->addStretch();
            setLayout(mainLayout);

 

in Qt, they are saying no option to show the menu.

 

i tried the other way without using Qt (using SetParent), in that method, its showing menu and title bar.  But issue is, whenever a dialog is opened in the external application, then this embedded dialog is getting hidden. and click on viewport again, its showing again.

 

Is there any other way to implement this ? Please suggest.

 

Regards,

Gopinath.

 

0 Likes
601 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor

What kind of external application?

 
0 Likes
Message 3 of 5

istan
Advisor
Advisor

@tagopinath wrote:

I am trying to embed..


What do you mean with "embed"? How you did that in Max?

0 Likes
Message 4 of 5

denisT.MaxDoctor
Advisor
Advisor

Let's make our list of questions complete...
Why do you need to embed? 😁

0 Likes
Message 5 of 5

tagopinath
Enthusiast
Enthusiast

Hi Denis and istan,

Thanks for your questions.

 

I just wanted to bring one other application inside 3ds max.

 

I found a simple way to do that by making max window as parent and external application hwnd as child, which is working fine.

 

Thanks again for your time.

Regards,

Gopi.

 

0 Likes