Project

General

Profile

Actions

Bug #11505

closed
TM RM

Calling WStandardItemModel::setHeaderData() on an empty model crashes

Bug #11505: Calling WStandardItemModel::setHeaderData() on an empty model crashes

Added by Tibor Miseta over 3 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
04/07/2023
Due date:
% Done:

0%

Estimated time:

Description

Calling WStandardItemModel::setHeaderData() on an empty model crashes the whole application. The program exits unexpectedly.


Files

wt_bug_setHeaderData.cpp (1.29 KB) wt_bug_setHeaderData.cpp Tibor Miseta, 04/07/2023 07:37 PM

RS Updated by Roel Standaert over 3 years ago Actions #1

  • Target version set to future

setHeaderData() on an empty model indeed does not work, that's a limitation of WStandardItemModel, and you should set the column count first.

However, I do think that instead of crashing it should probably either:

  • throw, or
  • return false (this is what Qt's QStandardItemModel does)

RM Updated by Romain Mardulyn over 1 year ago Actions #2

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn

RM Updated by Romain Mardulyn over 1 year ago Actions #3

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)

MV Updated by Matthias Van Ceulebroeck about 1 year ago Actions #4

  • Target version changed from future to 4.12.3

MV Updated by Matthias Van Ceulebroeck 7 months ago Actions #5

  • Assignee set to Matthias Van Ceulebroeck

RM Updated by Romain Mardulyn 7 months ago Actions #6

  • Target version changed from 4.12.3 to 4.12.4

RM Updated by Romain Mardulyn 7 months ago Actions #7

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn

RM Updated by Romain Mardulyn 7 months ago Actions #8

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom