Project

General

Profile

Actions

Bug #10976

closed

WAbstractItemView#setHeaderAlignment does not update vertical alignment

Added by Roel Standaert over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Category:
-
Target version:
Start date:
09/27/2022
Due date:
% Done:

100%

Estimated time:

Description

When setHeaderAlignment is used the vertical alignment is not updated. This is due to a translation error from Wt to JWt:

if (alignment.test(AlignVerticalMask))

Is translated to:

if (alignment.contains(AlignmentFlag.AlignVerticalMask))

The latter is always false, since EnumSet<AlignmentFlag> will only ever contain AlignmentFlags, not EnumSet<AlignmentFlag>s.

We get the correct translation when the C++ code is changed to:

if (!(alignment & AlignVerticalMask).empty())

The original code incidentally works in C++, since the type of AlignVerticalMask (WFlags<AlignmentFlag>) gets implicitly converted to AlignmentFlag. We may want to consider making this explicit, to avoid more errors like this.

Actions #2

Updated by Roel Standaert over 1 year ago

  • Status changed from InProgress to Review
  • Assignee changed from Roel Standaert to Korneel Dumon
Actions #3

Updated by Roel Standaert over 1 year ago

  • Status changed from Review to Implemented @Emweb
Actions #4

Updated by Roel Standaert over 1 year ago

  • Assignee changed from Korneel Dumon to Roel Standaert
Actions #5

Updated by Roel Standaert over 1 year ago

  • % Done changed from 0 to 100
Actions #6

Updated by Roel Standaert over 1 year ago

  • Status changed from Implemented @Emweb to Closed
  • Target version changed from 4.9.0 to 4.8.2
Actions

Also available in: Atom PDF