My “EditorView” (a QGLWidget) is being resized twice when it’s created. It starts at say 846×630, then shrinks to 846×607 (losing 23 pixels in height). Created like this:
EditorWindow::EditorWindow() {
Q_INIT_RESOURCE(icons);
readSettings();
setWindowTitle("Q2D Map Editor");
createActions();
createMenus();
createToolBars();
createStatusBar();
editorView = new EditorView;
setCentralWidget(editorView);
}
And then this automatically gets called twice:
void EditorView::resizeGL(int w, int h) {
printf("%d x %d\n", w, h);
glViewport(0, 0, w, h);
updateView();
}
I figure 23 pixels is about the size of the status bar, but the status bar should be already in place before the central widget is initialized, no? Or is it delayed for some reason?
Callstack 1
http://img259.imageshack.us/img259/8881/callstack1.png
Callstack 2
You should set a breakpoint in the resizeGL method, and check the call stack, to see, in both cases, what was the reason for calling resizeGL. From code you provided, it is not obvious.