Results 1 to 9 of 9

Thread: Crash after updating from Qt4.3 to Qt4.4.0-rc1

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Crash after updating from Qt4.3 to Qt4.4.0-rc1

    Could you show us the backtrace from a debugger?
    J-P Nurmi

  2. #2
    Join Date
    May 2007
    Posts
    301
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    46
    Thanked 3 Times in 3 Posts

    Default Re: Crash after updating from Qt4.3 to Qt4.4.0-rc1

    Sure can,

    Here is the actual line the crash ends up at :
    Qt Code:
    1. inline int size() const { return d->size; }
    To copy to clipboard, switch view to plain text mode 

    Which is in qstring.h

    Stack trace :

    QtCored4.dll!QString::size() Line 84 + 0xa bytes

    QtCored4.dll!QString:perator==(const QString & other={...}) Line 1738 + 0x12 bytes

    QtGuid4.dll!QSpinBoxPrivate::validateAndInterpret( QString & input={...}, int & pos=0x0045ee74, QValidator::State & state=0x00083ec4) Line 1011 + 0x16 bytes

    QtGuid4.dll!QSpinBox::validate(QString & text={...}, int & pos=0x0045ee74) Line 479 + 0x18 bytes

    QtGuid4.dll!QAbstractSlider::setValue(int value=0x00d41668) Line 511

    DACanMonitor.exe!SliderDelegate::setEditorData(QWi dget * editor=0x05901790, const QModelIndex & index={...}) Line 55

    QtGuid4.dll!QAbstractItemView::dataChanged(const QModelIndex & topLeft={...}, const QModelIndex & bottomRight={...}) Line 2805

    QtGuid4.dll!QAbstractItemView::setIndexWidget(cons t QModelIndex & index={...}, QWidget * widget=0x05901790) Line 2731


    Regards,
    Steve

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Crash after updating from Qt4.3 to Qt4.4.0-rc1

    Can we see SliderDelegate::setEditorData() implementation?
    J-P Nurmi

  4. #4
    Join Date
    May 2007
    Posts
    301
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    46
    Thanked 3 Times in 3 Posts

    Default Re: Crash after updating from Qt4.3 to Qt4.4.0-rc1

    Of course,

    Qt Code:
    1. void SliderDelegate::setEditorData(QWidget *editor,
    2. const QModelIndex &index) const
    3. {
    4. switch( index.column() )
    5. {
    6. case 1:
    7. {
    8. int value = index.model()->data(index, Qt::DisplayRole).toInt();
    9. QSlider *spinBox = static_cast<QSlider*>(editor);
    10. spinBox->setValue(value);
    11. break;
    12. }
    13. case 0:
    14. {
    15. QString value = index.model()->data(index, Qt::DisplayRole).toString();
    16. QCheckBox *checkbox = static_cast<QCheckBox*>(editor);
    17. if( value == "1" )
    18. checkbox->setCheckState( Qt::Checked );
    19. else
    20. checkbox->setCheckState( Qt::Unchecked );
    21. break;
    22. }
    23. }
    24. }
    To copy to clipboard, switch view to plain text mode 

    Looks like it is a simple case of checking whether value is zero in case 1.

    Kind regards,
    Steve

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Crash after updating from Qt4.3 to Qt4.4.0-rc1

    Looks like you static_cast something, which is not a QSpinBox, as QSpinBox. Rewrite it as using dynamic_cast or qobject_cast and check the return value.
    J-P Nurmi

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.