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

Crash when changing background color of text document #453

Closed
in3otd opened this issue Feb 6, 2016 · 2 comments
Closed

Crash when changing background color of text document #453

in3otd opened this issue Feb 6, 2016 · 2 comments

Comments

@in3otd
Copy link
Contributor

in3otd commented Feb 6, 2016

When changing a text documents background color (using the Application Settings dialog) Qucs crashes.
To reproduce, open Qucs, create a new text document (File->New Text) and change the Application background color.

The problem comes from here, as now TextDoc is derived from QPlainTextEdit.

I'll put a fix together with the other stuff for #446 but feel free to push a separate hotfix if you would like to be sure that it will be in 0.0.19 😁

EDIT:
a grep -r "inherits" --include \*.cpp . shows also some other suspect things:

./qucs/dialogs/simmessage.cpp:  if(DocWidget->inherits("QTextEdit"))
./qucs/dialogs/simmessage.cpp:  if(!DocWidget->inherits("QTextEdit")) {
./qucs/dialogs/simmessage.cpp:  if(DocWidget->inherits("QTextEdit")) {
@guitorri guitorri added this to the 0.0.19 milestone Feb 7, 2016
@guitorri
Copy link
Member

guitorri commented Feb 7, 2016

Confirmed on OSX. If you find a fix please inform.

@in3otd
Copy link
Contributor Author

in3otd commented Feb 7, 2016

...well, fix is just to use inherits("QPlainTextEdit") instead of inherits("QTextEdit"), as said it will be in the PR for #446, not sure I can finish it today.

Could you/someone please take a look if there is a similar bug related to the inherits("QTextEdit") in simmessage.cpp ? At a first glance it's about simulating VHDL/Verilog text files in Qucs, but I never did this, so I cannot check if it's a real issue.

BTW, there is a function QucsApp::isTextDocument which is extensively used in qucs.cpp for this check, will be nice to reuse it around, so if we change the TextDoc inheritance another time just changing this function will be enough.
What will be the best way to do this? Declare it static? Or outside of a class, in misc.cpp ?

guitorri added a commit that referenced this issue Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants