Project

General

Profile

Actions

Bug #713

closed

WTableView and WStandardItem UrlRole bug

Added by Marios Hadjieleftheriou about 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/07/2011
Due date:
% Done:

0%

Estimated time:

Description

When using a WTableView with a WStandardItemModel, setting the UrlRole of a WStandardItem results in the table view rendering the URL without any text (it results in an empty cell that is clickable and links to the specified URL, but there is no label).

The problem seems to be in WItemDelegate::update. When a WAnchor is created for the specific item, WAnchor::setRef is called, but WAnchor::setText is never called, which leaves the anchor text empty.

Adding in line 132 of WItemDelegate.C:

132: std::string s = asString(index.data(UserRole)).toUTF8();

133: a->setText(s);

fixes the issue

It would be preferable to be able to directly add a WAnchor through WStandardItemModel::setData. That way the user would be able to also customize the anchor (e.g., the setTarget functionality). Currently, passing a WAnchor to WTableView results in an unsupported exception.


Files

Table.C (1.86 KB) Table.C Pieter Libin, 02/16/2011 10:17 AM
#1

Updated by Koen Deforche about 14 years ago

  • Status changed from New to Feedback
#2

Updated by Pieter Libin about 14 years ago

#3

Updated by Koen Deforche almost 14 years ago

  • Status changed from Feedback to Resolved
#4

Updated by Koen Deforche almost 14 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF