Hi there,
I have a Qt test program with a main window with a QScrollArea, with a QMathGL widget (graph) as child.
The program crashes (exits) if i try to resize the main window (no scollbars appear).
If I set
graph->autoResize = true
, nothing crashes but graph just adopts its parent size and rescales. Still no scrollbars.
Why does the program crash with resizing? What is the best approach?
Thank you!
By the way, it QMathGL does work with QSplitter as parent container
The crash is caused by a segmentation fault.
Not that that is very helpful ;)
Ok, narrowed it down to the calling of resize(int, int)
void QMathGL::resizeEvent(QResizeEvent *ev) { if (autoResize && ev->size().width() > 0 && ev->size().height() > 0) { graph->SetSize(ev->size().width(), ev->size().height()); update(); } else { resize(graph->GetWidth(), graph->GetHeight()); // this causes the exit } }
Ha, cool! Its causing an infinite loop of resizing! (Probably still caused by the construction within the parent QScrollArea)
Still no luck with the scrollbars though. Seems that the parent QScrollArea doesn't see the size of its child QMathGL.
Checked it out: Looks like a result of working with QDesigner forms...
But why?
Anyway, I'll try to re-implement without using the form designer...
Ok, not using QDesigner works great!!!
Which version do you use? Because I was comment this call sometime ago (at least in SVN version).
I use Qt Creator 2.2.1 with QMake version 2.01a using Qt version 4.7.4 in /usr/lib/x86_64-linux-gnu on Ubuntu.
No, the question was -- do you try latest SVN version?
Oh, excuse me. Using Ubuntu package mathgl 1.11.2-2ubuntu1.
Log in to post a comment.
Hi there,
I have a Qt test program with a main window with a QScrollArea, with a QMathGL
widget (graph) as child.
The program crashes (exits) if i try to resize the main window (no scollbars
appear).
If I set
, nothing crashes but graph just adopts its parent size and rescales. Still no
scrollbars.
Why does the program crash with resizing? What is the best approach?
Thank you!
By the way, it QMathGL does work with QSplitter as parent container
The crash is caused by a segmentation fault.
Not that that is very helpful ;)
Ok, narrowed it down to the calling of resize(int, int)
Ha, cool! Its causing an infinite loop of resizing! (Probably still caused by
the construction within the parent QScrollArea)
Still no luck with the scrollbars though. Seems that the parent QScrollArea
doesn't see the size of its child QMathGL.
Checked it out: Looks like a result of working with QDesigner forms...
But why?
Anyway, I'll try to re-implement without using the form designer...
Ok, not using QDesigner works great!!!
Which version do you use? Because I was comment this call sometime ago (at
least in SVN version).
I use
Qt Creator 2.2.1
with
QMake version 2.01a
using
Qt version 4.7.4 in /usr/lib/x86_64-linux-gnu
on
Ubuntu.
No, the question was -- do you try latest SVN version?
Oh, excuse me. Using Ubuntu package mathgl 1.11.2-2ubuntu1.