View Issue Details

IDProjectCategoryView StatusLast Update
0001772Slicer4Core: Usabilitypublic2012-08-25 11:58
Reporterfedorov Assigned Tofedorov  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.0.1 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0001772: Key modifier + volume selector in 2D Slice viewers
Description

Key modifier + volume selector in 2D Slicer viewers: modify linking behavior: if the viewers are linked, do not link volume selector (Andrey discussed with Jim, Jim supports this idea and will look if this functionality is supported by Qt)

TagsNo tags attached.

Relationships

related to 0001878 closedmillerjv improved options for linkage behavior 

Activities

finetjul

finetjul

2012-02-29 19:35

administrator   ~0003756

How about a Modifier Key that, once down, temporarily disable the link mode? (icon would be updated to give a visual feedback)
Once the key released, the link mode is back on.

Can be done by reimplementing:
virtual void QWidget::keyPressEvent(QKeyEvent event);
and
virtual void QWidget keyReleaseEvent(QKeyEvent
event);

fedorov

fedorov

2012-07-03 12:06

developer   ~0005061

See test branch here: https://github.com/fedorov/Slicer/branches/link-modifier

fedorov

fedorov

2012-07-03 12:06

developer   ~0005062

---------- Forwarded message ----------
From: Julien Finet <julien.finet@kitware.com>
Date: Sun, Jan 29, 2012 at 10:30 PM
Subject: Re: qLineEdit in a ctkPopupWidget
To: Jim Miller <millerjv@gmail.com>
Cc: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

Hi Jim,
It seems that it's not possible. I spent some try to debug and my observations are:

  • to get focus on click, QLineEdit must be in a window that is active. For some reasons, ctkPopupWidget is not a window but it belongs to the window of the base widget. I changed the code to make it an active window, but a 2nd problem appears.
  • once the ctkPopupWidget is an activeWindow, QLineEdit still doesn't receive key events, only the base widget receives them. I've no idea why, but it might be because ctkPopupWidget is considered as a Qt::ToolTip type and not a regular type. :-/

The only work around I found is to make the QLineEdit into a popup inside the popup.
ctkPopupWidget popupWidget(baseWidget);
...
layout->addWidget(&button);
popup.setLayout(layout);

QMenu menu = new QMenu;
QWidgetAction
lineEditAction = new QWidgetAction(menu);
lineEditAction->setDefaultWidget(new QLineEdit);
menu->addAction(lineEditAction);
button.setMenu(menu);

But then I face some always-on-top issues. I'm not sure there is an easy fix :-/ I wonder, maybe ctkPopupWidget should be a Qt::Popup (or Qt::Tool) instead of a Qt::ToolTip...

Julien.

On Sun, Jan 29, 2012 at 5:03 PM, Jim Miller <millerjv@gmail.com> wrote:
Julien, JC,

I am trying to use a qLineEdit widget inside a ctkPopupWidget. I can set the text for the QLineEdit fine. I can pull up the context menu and paste text into the QLineEdit fine. But I cannot type any text. It is like the LineEdit never gets the focus. I click in the entry area but not cursor appears. It looks like the widget is enabled.

Is there something special in the ctkPopupWidget that would prevent widgets like the LineEdit widget?

Looking at the code, there appears to be code managing "something" on mouse over.

Jim

fedorov

fedorov

2012-07-11 04:32

developer   ~0005115

Per discussion with JC, J2, Tobias and Andrey, it was agreed:

  • to add a method SliceLinkLogic::SetLinkScopeModifier(LinkPropertiesModifier)
  • LinkPropertiesModifier will be defined as a bitset that would allow turning off individual linking modes (eg, Bg, Fg, Label)
  • the modifier will be set in the python startup script
  • the option to add an application setting, visual feedback for the user (changing color of the volume selector or icon) will be considered later
fedorov

fedorov

2012-08-21 11:00

developer   ~0005650

Suggested patch is available here: https://github.com/fedorov/Slicer/tree/1772-linking-modifier

Currently waiting for Jim to approve/comment.

jcfr

jcfr

2012-08-21 11:46

administrator   ~0005653

If resolving that issue before Sept 1st does not sound reasonable, please let me know. Thanks Jc

fedorov

fedorov

2012-08-25 11:58

developer   ~0005788

Link modifier API added in r20856 and r20857

Issue History

Date Modified Username Field Change
2012-02-29 19:32 finetjul New Issue
2012-02-29 19:32 finetjul Status new => assigned
2012-02-29 19:32 finetjul Assigned To => millerjv
2012-02-29 19:32 finetjul Reporter finetjul => fedorov
2012-02-29 19:35 finetjul Note Added: 0003756
2012-04-09 08:55 fedorov Relationship added related to 0001878
2012-07-03 12:02 fedorov Assigned To millerjv => fedorov
2012-07-03 12:06 fedorov Note Added: 0005061
2012-07-03 12:06 fedorov Note Added: 0005062
2012-07-11 04:32 fedorov Note Added: 0005115
2012-08-21 11:00 fedorov Note Added: 0005650
2012-08-21 11:01 fedorov Severity feature => block
2012-08-21 11:01 fedorov Reproducibility N/A => always
2012-08-21 11:01 fedorov Category GUI => Usability
2012-08-21 11:45 jcfr Target Version => Slicer 4.2.0 - Feature freeze Sept 1st 2012
2012-08-21 11:46 jcfr Note Added: 0005653
2012-08-25 11:58 fedorov Note Added: 0005788
2012-08-25 11:58 fedorov Status assigned => closed
2012-08-25 11:58 fedorov Resolution open => fixed
2012-08-25 11:58 fedorov Fixed in Version => Slicer 4.2.0 - Feature freeze Sept 1st 2012