Project

General

Profile

Bug #10976

WAbstractItemView#setHeaderAlignment does not update vertical alignment

Added by Roel Standaert 2 months ago. Updated 12 days ago.

Status:
Closed
Priority:
Normal
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.

#2

Updated by Roel Standaert 2 months ago

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

Updated by Roel Standaert about 2 months ago

  • Status changed from Review to Implemented @Emweb
#4

Updated by Roel Standaert about 2 months ago

  • Assignee changed from Korneel Dumon to Roel Standaert
#5

Updated by Roel Standaert about 2 months ago

  • % Done changed from 0 to 100
#6

Updated by Roel Standaert 12 days ago

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

Also available in: Atom PDF