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. Application is getting crashed ..while adding elements to QTableView
QtWS25 Last Chance

Application is getting crashed ..while adding elements to QTableView

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.6k Views
  • 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.
  • M Offline
    M Offline
    M_31
    wrote on last edited by
    #1

    I have used QTableView to display my result value and i have QlistWidget to select which result should be displayed in my QTableView.

    here is the code ..
    @

    void CResultModel::listSelected(QModelIndex& index)
    {
    int nRow = index.row();
    if( m_listResults.size() > nRow )
    {
    CResult *result = m_listResults.at( nRow );
    if( result )
    {

                 QList<CMyResult* > item = result->m_listMyResult ;
                 addItems( items );
          }
     }
    

    }

    void CResultModel::addItems( QList<CMyResult*> items )
    {
    clearAll();

    beginInsertRows(QModelIndex(), 0, items.size() -1 );
    m_listMyResult = items;
    endInsertRows();
    }

    void CResultModel::clearAll()
    {
    if ( m_listMyResult.size() > 0 )
    {
    beginRemoveRows(QModelIndex(), 0, m_listMyResult.size() -1 );
    m_listMyResult.clear()
    endRemoveRows();
    }
    }

    @

    From this code i am able to see my different result in my QtableView...but after certain time...my Application is getting crashed... even if i didnt do any operation in my application...

    finally its showing the error on
    @
    inline bool QBasicAtomicInt::ref()
    {
    unsigned char ret;
    asm volatile("lock\n"
    "incl %0\n"
    "setne %1"
    : "=m" (_q_value), "=qm" (ret)
    : "m" (_q_value)
    : "memory");
    return ret != 0;
    } @

    Please let me know..whether i am doing anything wrong on this...

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fluca1978
      wrote on last edited by
      #2

      Silly question: are you sure there is not a delete somewhere that is causing the crash? Usually this happens if you reference a memory location that no longer exists (or never existed).

      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