Re: [PyQt] Model/view: values of type Decimal not shown

2012-07-27 Thread Hans-Peter Jansen
Am Thursday 26 July 2012 20:24:13 schrieb Sibylle Koczian:
 Hello,

 I don't know how to get numeric data from my model to my GUI, if they
 aren't floats but decimal.Decimal. In the following example the last
 column of the view and the last QLineEdit of the form both stay
 empty. The model data are printed to the console and it can be seen
 that the model contains the correct data for the last column and that
 they have the right type. But the GUI doesn't show them. What should
 I change?

You need to supply a QStyledItemDelegate to handle decimals. It might be 
feasible to wrap QDoubleSpinBox as editor widget and access the value 
with cleanText...

I contributed the star delegate demo to demonstrate the delegation 
facility.

Hth,
Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] dip: question about changing UI elements based on task

2012-07-27 Thread Darren Dale
I'm developing an application that has to support various loosely
coupled tasks. For example, take an IDE where you switch between code
editing and UI design tasks. These two tasks would each contribute
their own central window, dock windows, menu items, and tools bars to
the main window. Each task would probably be a plugin, but only one
task would be active (and its ui elements visible) at a time.

Is it possible for dip to compose the main window using elements
contributed by such tasks? Any advise that could get me started in
the right direction?

Thanks,
Darren
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] dip: question about changing UI elements based on task

2012-07-27 Thread Phil Thompson
On Fri, 27 Jul 2012 16:16:58 -0400, Darren Dale dsdal...@gmail.com
wrote:
 I'm developing an application that has to support various loosely
 coupled tasks. For example, take an IDE where you switch between code
 editing and UI design tasks. These two tasks would each contribute
 their own central window, dock windows, menu items, and tools bars to
 the main window. Each task would probably be a plugin, but only one
 task would be active (and its ui elements visible) at a time.

I don't really understand what you mean by the ui elements being visible
when the task is active. The central window, dock windows, menu items? If
you really want them invisible then using two different main windows for
the tasks may be the easiest solution.

 Is it possible for dip to compose the main window using elements
 contributed by such tasks? Any advise that could get me started in
 the right direction?

If you want a single main window to contain the elements of the the two
tasks (or tools to use the dip terminology) and to have all the different
elements enabled or not according to the currently active tool - then
that's what a dip shell does. The shell examples cover this - and you could
look at the current metasip code for a real example (although metasip is
still being migrated to being a fully fledged dip application).

I'm not sure I've understood the question properly...

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt