[Qt-interest] Generic input widgets for varying types - how to?
Andreas Pakulat
apaku at gmx.de
Fri Mar 27 20:43:03 CET 2009
On 27.03.09 20:18:05, Helge Preuss wrote:
> Question 1:
> Is this a good way to do it? Differently put, is there a /better/ way
> ;-) ? In particular, I am a bit concerned about deriving the concrete
> input widgets from QWidget twice - once via ParameterInput and once via
> QSlider/QLineEdit.
Thats not supported by Qt, you can only derive from QObject once. So
make the input class a pure interface and inherit first from the gui
widgets.
> Question 2:
> This does not really work. The ParameterInput widgets are not displayed.
> I assume I must implement some QWidget methods to make the widgets
> display. Which methods would that be?
I suggest to fix the above first and then revisit this, all kinds of
weird things may happen when you subclass twice from qwidget. In
particular in your case probably the paintEvent of QWidget is being
called (just painting a grey background) instead of the one from the
actual widgets.
Andreas
--
Future looks spotty. You will spill soup in late evening.
More information about the Qt-interest-old
mailing list