Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded widget with wrong size when content has changed #408

Closed
yvanblanchard opened this issue Jan 24, 2024 · 3 comments
Closed

Embedded widget with wrong size when content has changed #408

yvanblanchard opened this issue Jan 24, 2024 · 3 comments

Comments

@yvanblanchard
Copy link

yvanblanchard commented Jan 24, 2024

Hello,

I have a node with an embedded widget (QtLabel).
This Label widget contained a quite long text, and after updating the flow graph, this node was updated and text was shorter.
Problem is that the lable widget kept its previous size, instead of being resized as expected.
The node (container) of this widget was correctly resized (smaller), but not the widget child..

Before:
image

After:
image

Any idea ?

@mariusalexander
Copy link

Can you try to use a QLayout to manage the size of the label?

QWidget* embeddedWidget() {
    auto* widget = new QWidget;
    auto* lay = new QVBoxLayout; // or QHBoxLayout
    auto* label = new QLabel; // your label
    lay->addWidget(label);
    widget->setLayout(lay);
    return widget;
}

@yvanblanchard
Copy link
Author

yvanblanchard commented Apr 2, 2024

@mariusalexander
thank you, but I had already used layout for my embedded widget.
it seems like this issue is possibly related to a Qt bug (related to zooming effect): #121

@yvanblanchard
Copy link
Author

yvanblanchard commented May 15, 2024

...when also using 'embeddedWidgetSizeUpdated' in eventFilter of the widget (Qlabel orother), it works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants