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

Zoom Scaling Issue - Embedded Widgets #293

Open
xemjeff opened this issue Nov 15, 2021 · 3 comments
Open

Zoom Scaling Issue - Embedded Widgets #293

xemjeff opened this issue Nov 15, 2021 · 3 comments
Labels

Comments

@xemjeff
Copy link

xemjeff commented Nov 15, 2021

When I embed a combo box in a Node, the scaling of the node does not correctly scale the combo box. In this case, both combo boxes are in a QWidget with a vertical box layout.

See image:

NodeZoomProblem

.
@paceholder
Copy link
Owner

paceholder commented Nov 15, 2021 via email

@xemjeff
Copy link
Author

xemjeff commented Nov 15, 2021

Here's the short version of code for the embedded widget, which is simply created in the constructor:

In FrameDisplayModel.cpp

FrameDisplayModel::
FrameDisplayModel()
  : _embeddedWidget(new QWidget()),
    _cboManipulator(new QComboBox()),
    _cboLink(new QComboBox())
{
  QVBoxLayout *layout = new QVBoxLayout();

  _cboManipulator->addItems(QStringList({"System", "Robot1", "Robot2"}));
  _cboLink->addItems(QStringList({"Link1", "Link2", "Wrist3"}));
  layout->addWidget(_cboManipulator);
  layout->addWidget(_cboLink);
  _embeddedWidget->setLayout(layout);
}

In FrameDisplayModel.hpp:

  QWidget *
  embeddedWidget() override { return _embeddedWidget; }

. . .

private:

  NodeValidationState modelValidationState = NodeValidationState::Valid;
  QString modelValidationError = QStringLiteral("Not Connected");
  

  QWidget   * _embeddedWidget;
  QComboBox * _cboManipulator;
  QComboBox * _cboLink;
};

@paceholder paceholder added the bug label Dec 6, 2022
@paceholder
Copy link
Owner

Just wanted to confirm that I saw the same issue in other qt-based projects. I'll try to submit a bug to Qt if the issue is reproducible on a minimal example.

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

No branches or pull requests

2 participants