Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Error : Assert: “nativeExtra” in file kernel\qwidget_win.cpp line 1804
Forum Updated to NodeBB v4.3 + New Features

Qt Error : Assert: “nativeExtra” in file kernel\qwidget_win.cpp line 1804

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tabi
    wrote on last edited by
    #1

    The above error is appearing when I close the application. When I comment following code error disappears, so source of error is in this code:

    @if(f)
    {
    this->tfwidget = new TFWidget();//twwidget inherits QWidget

        QHBoxLayout* lay = new QHBoxLayout();
        lay->addWidget(tfwidget);
    
        delete ui->TabVisualization->layout();//adding tab to the tabwidget
        ui->TabVisualization->setLayout(lay);
    
        ui->ToolArea->setCurrentWidget(ui->TabVisualization);
        ui->TabVisualization->raise();
    }
    else
    {
        delete this->tfwidget;//if user uncheck button remove widget from tab
        delete ui->TabVisualization->layout();
    }@
    

    If I keep only layout insertion and deletion there is no any error. it appears only when I initialze and add widget to the layout. I have no clue why it is happening and how to resolve. Please help.

    What I think the classes in TFWidget having some problem, I have tested widget without this way like removing layout and it is working fine. I don know what is the matter while including widget in this way.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you are using a QTabWidget, why are you deleting it's layout ? It's not the proper way to use that widget.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tabi
        wrote on last edited by
        #3

        I removed all the code of delete and all. But if I just add my widget to the tab it is causing error by this I got that that the my widget is having some issue, though the code of widget i tested without definition too and it was working very well but when I encapsulated that code into widget it is causing error. Is it due to moc? because when I tested before i tested code with all setup in mainwindow it was working fine. The third party widget that I am using in tfwidget uses QGraphicsView. I am still wandering.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved