Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-68458

QHeaderView crashes if without a parent while mouse moves

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.1
    • 5.11.0
    • Widgets: Itemviews
    • None
    • f9b11bcf786eb3ab189f0402fd1b0f023910c2df

    Description

      QHeaderView crashed if without a parent.

      +++ src/widgets/itemviews/qheaderview.cpp
      @@ -2530,8 +2530,20 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
                   if (handle != -1 && (sectionResizeMode(handle) == Interactive)) {
                       if (!hasCursor)
                           setCursor(d->orientation == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor);
      -            } else if (hasCursor) {
      -                unsetCursor();
      +            } else {
      +                if (hasCursor)
      +                    unsetCursor();
      +#ifndef QT_NO_STATUSTIP
      +                int logical = logicalIndexAt(pos);
      +                QString statusTip;
      +                if (logical != -1)
      +                    statusTip = d->model->headerData(logical, d->orientation, Qt::StatusTipRole).toString();
      +                if (d->shouldClearStatusTip || !statusTip.isEmpty()) {
      +                    QStatusTipEvent tip(statusTip);
      +                    {{{{!!!QCoreApplication::sendEvent(d->parent, &tip); !!!!}}}
      +                    d->shouldClearStatusTip = !statusTip.isEmpty();
      +                }
      +#endif // !QT_NO_STATUSTIP
      

      {{!!! line is where segment faults !!!!}

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              andysh Andy Shaw
              yulong.bai Bai Yulong
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes