Results 1 to 11 of 11

Thread: QDockWidget: Debugging crash

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDockWidget: Debugging crash

    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:
    1. m_dockWin = new QDockWidget("test");
    2. Q_CHECK_PTR( m_dockWin );
    3.  
    4. m_toolbox = new QToolBox( this );
    5. Q_CHECK_PTR( m_toolbox );
    6.  
    7. m_dockWin->setWidget( m_toolbox );
    8. 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
    QLayout::addChildWidget: QToolBox "" in wrong parent; moved to correct parent
    class Kalzium is:

    Qt Code:
    1. Kalzium::Kalzium()
    2. : KMainWindow( 0, "Kalzium" )
    3. {
    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Re: QDockWidget: Debugging crash

    Like axeljaeger said, you should also use addDockWidget().
    Qt 5.3 Opensource & Creator 3.1.2

  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDockWidget: Debugging crash

    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.

Similar Threads

  1. QDockWidget magically disapear
    By 1111 in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2009, 11:44
  2. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  3. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.