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

qucslib: Searchboxes fix crash #399

Merged
merged 6 commits into from
Jan 25, 2016
Merged

Conversation

guitorri
Copy link
Member

Fix Qucs-lib crash while testing #303.
Because the component (symbol for) hicumL2V2p31n was not found, variables ended up uninitialized.
The variables were used to reside the window according to he symbol size. When uninitialized it could could be resized to random values, eventually crashing the application (fail assert in Qt).
This patch attempts to make it more robust and inform the user about missing default symbols.

TODO: registering each component again on qucs-lib (and copying the default symbol) seems redundant.

If a library component does not match one of the types in
SymbolWidget::createSymbol, the variables x1, x2, y1, y2 may end
up with unknown values. This can cause the `setMinimumSize` to
fail a bound size assertion crashing the application.

This patch add default values for these variables.
Issue warning message in case a (user) library contains a component
which its symbols is not yet mapped or implemented in qucs-lib.

The component may be implemented correctly in qucs, but its symbol
is not matched (and drawn) in qucs-lib.

The painting code is somewhat duplicated.
Connecting from COMPAT signal (QAction::activated(int))
@guitorri guitorri added this to the 0.0.19 milestone Oct 19, 2015
guitorri added a commit that referenced this pull request Jan 25, 2016
@guitorri guitorri merged commit 67ccb23 into Qucs:master Jan 25, 2016
@guitorri guitorri deleted the searchboxes-fix-crash branch January 25, 2016 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant