Did you insert Q_CHECK_PTR as I said?
Did you insert Q_CHECK_PTR as I said?
Qt 5.3 Opensource & Creator 3.1.2
I still think that the parent() of the QDockWidget is 0.
It's nice to be important but it's more important to be nice.
So, the code:
should be:Qt Code:
To copy to clipboard, switch view to plain text mode
Qt Code:
To copy to clipboard, switch view to plain text mode
Last edited by MarkoSan; 7th January 2006 at 10:37.
Qt 5.3 Opensource & Creator 3.1.2
Either this or the dock widgets should be added later using addDockWidget. I think this sets the parent too.
It's nice to be important but it's more important to be nice.
This is the current code, still crashing. As soon as I make the m_dockWin a child of "this" it is *in* the mainwindow. So that cannot be right.
Qt Code:
Q_CHECK_PTR( m_dockWin ); Q_CHECK_PTR( m_toolbox ); m_dockWin->setWidget( m_toolbox ); m_dockWin->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );To copy to clipboard, switch view to plain text mode
I noticed this in the shell when executing Kalzium
class Kalzium is:QLayout::addChildWidget: QToolBox "" in wrong parent; moved to correct parent
Qt Code:
Kalzium::Kalzium() : KMainWindow( 0, "Kalzium" ) {To copy to clipboard, switch view to plain text mode
I don't know the check-pointer-macro, but I don't see any information in the shell. Is this supposed to help in gdb?
Like axeljaeger said, you should also use addDockWidget().
Qt 5.3 Opensource & Creator 3.1.2
Ok, I just debugged a little more. The problem seems to be that KMainWindow does *not* inherit from QMainWindow but from Q3MainWindow. And Q3MainWindow doesn't know anything about QDockWidget but only about QDockWindow. Therefore, somewhere in the Q3Compatlib it crashes.
So somebody needs to port KMainWindow of KDE4 first.
Bookmarks