Return value of QHeaderView ::logicalIndexAt is not accurate
-
code as below, what's the bug?
void MyTreeView::OnHeaderViewMouseRClick(bool checked) { QHeaderView * hv = header(); QPoint pt = QCursor::pos(); pt = hv->mapFromGlobal(pt); int logical_index = hv->logicalIndexAt(pt); QString s = QString::asprintf("%d", logical_index); QMessageBox::information(this, "info", s); } -
Hi,
What's the values you get ?
What's the values you expect ? -
You should print out
pt- I would guess x is not 0 when you click on the very left side of the header view.
