Project

General

Profile

Feature #8295

Improve handling of WStringListModel methods insertString and addString

Added by Stefan Bn 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/30/2021
Due date:
% Done:

0%

Estimated time:

Description

These methods of WStringListModel currently return void:

void insertString (int row, const WString &string)
void addString (const WString &string)

and it is cumbersome to perform subsequent actions on newly added items that need a WModelIndex as parameter, such as setData(const WModelIndex &index, const cpp17::any &value, ItemDataRole role=ItemDataRole::Edit).

Please consider modifying these methods so that a WModelIndex of the newly added item is returned so that subsequent actions can directly work on this.

WModelIndex& insertString (int row, const WString &string)
WModelIndex& addString (const WString &string)

(or alternatively provide a method to easily obtain the WModelIndex of a string value in the model)

Thanks a lot!
Stefan

No data to display

Also available in: Atom PDF