[PyQt] Design issues; refreshing a list view
Entity Reborn
entityreborn at gmail.com
Thu Feb 3 02:10:58 GMT 2011
I am trying to write a AbstractListView where items can either be text-only,
have a checkbox, or belong to a radiobutton group.
While I have succeeded in this, I'm having refresh issues with my
implementation, in regard to the radiobutton groups and the way that the
'exclusivity' is implemented. Basically, when one selects one of the
radiobuttons, and another button was selected previously, the new one IS
selected, yet the old one -appears- to still be selected, until one forces a
refresh via resizing the window. While the socket dataChanged() is called
for the item that was clicked, I can't easily see a way to do the same for
items that were programmatically unchecked. Full code is attached. Please
excuse the lame implementation for differentiating text items from checkbox
items and radiobutton items (namely, "x" or "o" to define checkboxes or
radiobuttons, in the text document provided).
Ideally, I'd like to find a way to generate QModelIndexes for the affected
items, and refresh each one as needed, but if there is a shotgun approach of
forcing a full refresh, that can be an option as well.
Based largely off of the SimpleTreeModel example.
--
~EntityReborn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110202/dccd8c1b/attachment-0001.html>
-------------- next part --------------
xGetting Started xHow to familiarize yourself with Qt Designer
oLaunching Designer oRunning the Qt Designer application
oThe User Interface oHow to interact with Qt Designer
xDesigning a Component Creating a GUI for your application
xCreating a Dialog How to create a dialog
oComposing the Dialog xPutting widgets into the dialog example
oCreating a Layout xArranging widgets on a form
Signal and Slot Connections Making widget communicate with each other
Using a Component in Your Application Generating code from forms
The Direct Approach Using a form without any adjustments
The Single Inheritance Approach Subclassing a form's base class
The Multiple Inheritance Approach Subclassing the form itself
Automatic Connections Connecting widgets using a naming scheme
A Dialog Without Auto-Connect How to connect widgets without a naming scheme
A Dialog With Auto-Connect Using automatic connections
Form Editing Mode How to edit a form in Qt Designer
Managing Forms Loading and saving forms
Editing a Form Basic editing techniques
The Property Editor Changing widget properties
The Object Inspector Examining the hierarchy of objects on a form
Layouts Objects that arrange widgets on a form
Applying and Breaking Layouts Managing widgets in layouts
Horizontal and Vertical Layouts Standard row and column layouts
The Grid Layout Arranging widgets in a matrix
Previewing Forms Checking that the design works
Using Containers How to group widgets together
General Features Common container features
Frames QFrame
Group Boxes QGroupBox
Stacked Widgets QStackedWidget
Tab Widgets QTabWidget
Toolbox Widgets QToolBox
Connection Editing Mode Connecting widgets together with signals and slots
Connecting Objects Making connections in Qt Designer
Editing Connections Changing existing connections
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simpletreemodel2.py
Type: application/octet-stream
Size: 8261 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110202/dccd8c1b/attachment-0001.obj>
More information about the PyQt
mailing list