Results 1 to 2 of 2

Thread: ASSERTION errors in 4.7.0 file qlayoutengine_p.h

  1. #1
    Join Date
    Oct 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default ASSERTION errors in 4.7.0 file qlayoutengine_p.h

    I created a Qt (qtsdk-2010.04 (ver 4.6.3 I think)) application on my Ubuntu Linux box, it works quite nicely.

    Currently I need to port the app to Windows. I am using an instance of XP SP1 running on Sun's VirtulBox, with Visual Studio 2008 installed. I installed the Qt4.7.0 sources and compiled it with VS2008 and there were no issues. I also installed the VS Qt add-in.


    After a little work and massage I finally got the project to build, but when I run it I get this error:


    Module: 4.7.0
    File: global\qglobal.cpp
    Line: 2239

    ASSERT: "uniformSpacer >= 0 || spacing >= 0" in file e:\qt\4.7.0\include\qtgui\private\../../../src/gui/kernel/qlayoutengine_p.h, line 78



    this is the code snippet from the file qlayoutengine_p.h:

    77 int effectiveSpacer(int uniformSpacer) const {
    78 Q_ASSERT(uniformSpacer >= 0 || spacing >= 0);
    79 return (uniformSpacer >= 0) ? uniformSpacer : spacing;
    80 }


    So I am assuming that my 'QLayoutStruct.spacing' is a value less than 0. Why? I don't know.


    Here is a snippet from my app:


    contactsLayout = new QVBoxLayout;

    contacts[nCONTACT_TYPE] = new contactWidget(nCONTACT_TYPE,this);
    contacts[nBILLING_TYPE] = new contactWidget(nBILLING_TYPE,this);
    contacts[nSHIPPING_TYPE] = new contactWidget(nSHIPPING_TYPE,this);

    tabWidget = new QTabWidget;
    --> tabWidget->addTab(contacts[nCONTACT_TYPE], tr("Contact ID")); <-- error occurs at this line of execution
    tabWidget->addTab(contacts[nBILLING_TYPE], tr("Billing ID"));
    tabWidget->addTab(contacts[nSHIPPING_TYPE], tr("Shipping ID"));


    The current parent widget (vendorWidget) and the contactWidget are BOTH derived from the same base class.

    I have almost exactly the same arrangement in another class, "employeeWidget" and "emplyeeContact" are also both derived from the same base class as the vendor widgets, and they suffer exactly the same problems.

    IF I build the project minus the offending widgets the rest of the code runs as it should.

    This is very similar to QTBUG-13652 which was submitted 17/Sep/10.

    One last item, I also tried building the app with qmake and the MinGW tools. That version had the same issues.

    Any assistance would be greatly appreciated, thank you.

    Jon Aldrich

    PS: Did I mention this does not happen at all in the Linux environment ;-)

  2. #2
    Join Date
    Dec 2010
    Posts
    18
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: ASSERTION errors in 4.7.0 file qlayoutengine_p.h

    Did you ever find a solution to this problem? I'm finding exactly the same error, but I can't debug it properly, because as soon as I run the application through mingw-gdb, it receives an unknown exception on QSettings::setPath()...


    Added after 59 minutes:


    Hm, using debug()s I managed to locate the problem... sort of. In a specific form layout, if I enter only one row, everything goes well, but if I add the label of the second row, it breaks. However, if I move the whole form layout somewhere else, it works. What the?

    Finally I fixed it selecting the stacked widget my form was on, and making it use a vertical layout instead of a grid layout.

    Oh well. What a fun evening indeed.
    Last edited by RazZziel; 8th December 2010 at 18:22.

Similar Threads

  1. Missing file errors when Rebuilding example projects
    By Thomas Wrobel in forum Newbie
    Replies: 1
    Last Post: 8th January 2010, 12:13
  2. setPixmap cause assertion?
    By Equilibrium in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2007, 00:34
  3. QGLWIdget renderText() assertion...
    By adonel in forum Qt Programming
    Replies: 3
    Last Post: 22nd October 2007, 21:30
  4. QTreeWidget, double-clicks and assertion errors
    By Byngl in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 14:29
  5. ASSERT(Failed assertion in Qt == Qt bug)
    By 0xBulbizarre in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 19:06

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.