Solved Problem with successive attempts to embed external app in QT Widget
-
Hi,
Did you ensure that the layout is empty after removing that embedded application ?
-
@SGaist thanks for the reply,
Is there a programmatic way to check if the layout is empty?I used: layout->count() but oddly, the number of items before and after calling
layout->addWidget() is 0. -
Do you have any stretch added ?
-
@SGaist no, the QX11EmbedContainer object's parent is a QWidget and its size policy is [Preffered, Preffered].
Regarding the QX11EmbedContainer itself I didn't explicitly define any stretching. -
Interesting fact:
I now noticed that after the second execution of the external application and embedding, and seeing that the embedded app is offset from bottom of layout as mentioned,
If I double click the GUI of the qt app in order to minimize the whole window ("restore down") and then maximizing it, the external app suddenly fits in place.
Is there some sort of refresh method i need to invoke ? -
Does it also happen on resize ?
-
@SGaist if i understood the question correctly, then when resizing the qt gui main window the embedded external app doesn't get offset. It behaves properly.
The offset is introduced only on the second attempt to embed it. -
Sorry, I meant: after the second embedding, if you resize the container widget, does it also fix the positioning issue ?
-
@SGaist It seems it did. This is very interesting.
I called the containers resize() method right after the embedClient().
The remote application didn't actually change size to what i specified in resize() and stills fits as intended to it's dedicated layout.
After the second execution of external app again the resize() and embedClient() are called but now the offset has disappeared.
Any conclusion ? -
@walle19 said in Problem with successive attempts to embed external app in QT Widget:
Any conclusion ?
Embedding is tricky ! But also, you are using a version of Qt that is way more than outdated. If locked to Qt 4, you should check with the latest release of that series which is 4.8.7.