enthought / enthought/traitsui

Qt IconButton should let its owner be responsible for connecting signals

Open
#888 0 comments 0 reactions 0 assignees View on GitHub
type: refactor
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

`traitsui.qt4.helper.IconButton` extends `QtGui.QPushButton`, and its `__init__` does two things:
(1) Configure the visual things, e.g. setting the size limit
(2) Connect a slot to its `clicked` signal.

The widget would be more reusable if it does not perform the second step, but instead let its caller (e.g. `FileEditor`) does the signal connections. This will make the signal connection/disconnection more obvious too.

It could just be me: I don't normally expect instantiating the widget should have the side-effect of connecting any signals.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.