Project

General

Profile

Actions

Bug #8392

closed

Porting from wt3 to wt4: Error requesting WToolbar widget

Added by José Luis Rey almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
04/21/2021
Due date:
% Done:

100%

Estimated time:

Description

Hello, I'm trying to convert a big application to wt4,

I'm getting some errors that I will post here, first one is with toolbar widgets, I'm using the "widget()" method of the WToolbar to get a non owning pointer of the items:

auto lang_toolbar = make_unique<WToolBar>();
lang_toolbar->addWidget(make_unique<WComboBox>(), AlignmentFlag::Right);
WComboBox* lang_select = (WComboBox*)lang_toolbar->widget(lang_toolbar->count()-1);

But each call to lang_toolbar->widget(lang_toolbar->count()-1); fails, any idea ?

Kind regards
J.

Actions #1

Updated by Korneel Dumon almost 3 years ago

  • Status changed from New to InProgress
  • Assignee set to Korneel Dumon

Hi,

definitely something weird going on here. It seems WToolBar assumes that it only contains WSplitButton or WPushButton.
Maybe you're better off changing to one of these, you can use setMenu() on either one to make it seem like a combobox. I will fix the crash, but I expect there may be some styling issues.

Actions #2

Updated by Roel Standaert almost 3 years ago

  • Description updated (diff)
Actions #3

Updated by Roel Standaert almost 3 years ago

  • Status changed from InProgress to Resolved
  • Target version set to 4.6.0
Actions #4

Updated by Roel Standaert over 2 years ago

  • % Done changed from 0 to 100
Actions #5

Updated by Roel Standaert over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF