Results 1 to 1 of 1

Thread: what would lead to crash while getting QwtPlotItem rtti value ?

  1. #1
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: what would lead to crash while getting QwtPlotItem rtti value ?

    I have a snap of code like this :

    void updateCurves {
    QwtPlotItemList list = plot->itemList();
    foreach (QwtPlotItem * item, list) {
    qDebug() << " updateCurvesPosition1 " << item;
    qDebug() << "updateCurvesPosition 1 " << item->rtti();
    if (item->rtti() == QwtPlotItem::RttiValues(BaseCurve::Rtti_BaseCurveS tyle) ) {
    BaseCurve *curve = static_cast<BaseCurve *>(item);
    BaseLegendConfigData::CurveType type = curve->curveConfig()->getCurveType();
    ......

    }
    }

    replot();

    QwtPlotItemList curlist = plot->itemList();
    foreach (QwtPlotItem *item, curlist) {
    qDebug() << " updateCurvesPosition 2" << item;
    qDebug() << "updateCurvesPosition 2 " << item->rtti(); /// crash here .
    if (item->rtti() == QwtPlotItem::RttiValues(BaseCurve::Rtti_BaseCurveS tyle)) {
    BaseCurve *curve = static_cast<BaseCurve *>(item);
    .........
    }
    }
    }
    }



    The first part and the second part are almost the same, but the red line would cause crash.


    Added after 16 minutes:


    o , i know why , sorry ,my mistake.
    Last edited by lwz; 21st April 2014 at 04:52.

Similar Threads

  1. Replies: 0
    Last Post: 18th January 2011, 02:19
  2. Replies: 3
    Last Post: 16th May 2009, 10:16
  3. rtti option
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th January 2007, 15:10
  4. rtti() of derived class
    By quickNitin in forum Newbie
    Replies: 4
    Last Post: 8th October 2006, 14:20
  5. Speed penalty when using RTTI?
    By pir in forum General Programming
    Replies: 5
    Last Post: 19th May 2006, 00:36

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.