Results 1 to 7 of 7

Thread: Application crashing on setting Model in QComboBox.

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Application crashing on setting Model in QComboBox.

    Hi,

    My app is crashing when i set the QSortFilterProxyModel in the combo box.
    below is the code snippet that i use to set the model to the comboBox

    Qt Code:
    1. m_TxPowerProxyModel->setDynamicSortFilter(true);
    2. m_TxPowerProxyModel->setSourceModel(m_Model);
    3. m_Ui.txPowerCombo->setModel(m_TxPowerProxyModel);
    4. m_Ui.txPowerCombo->setModelColumn(DevicesModel::TX_POWER);
    5. m_TxPowerProxyModel->SetModelSearchStr(m_BandProxyModel->data(index).toString());
    To copy to clipboard, switch view to plain text mode 

    Please Help......

    Regards,
    GK

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application crashing on setting Model in QComboBox.

    did u see which line exactly it is crashing?

  3. #3
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Application crashing on setting Model in QComboBox.

    The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..
    The app is crashing in m_Model's setData() funciton.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Application crashing on setting Model in QComboBox.

    The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..
    I cant see any lines in your post !!

  5. #5
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Application crashing on setting Model in QComboBox.

    Quote Originally Posted by kaushal_gaurav View Post
    The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..
    The app is crashing in m_Model's setData() funciton.
    So maybe it's crashing because setData() is written wrong? Can we see it?
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  6. #6
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Application crashing on setting Model in QComboBox.

    The app is crashing because of

    Qt Code:
    1. m_Ui.txPowerCombo->clear();
    To copy to clipboard, switch view to plain text mode 

    If i comment the line the app works fine.
    I need to clear the contents of the combo box because it is coming out to be junk in index 0.
    and rest of the combo is populated with the values from the model.

    Help...

    GK

  7. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application crashing on setting Model in QComboBox.

    try to trace clear method, maybe somewhere invalid pointer is used.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.