[Kde-games-devel] KZoomMainWindow and adjustSize() tale :)

Albert Astals Cid aacid at kde.org
Tue Aug 1 20:24:45 CEST 2006


A Dimarts 01 Agost 2006 17:55, Dmitry Suzdalev va escriure:
> Well, I moved KZoomMainWindow to libkdegames.
> But I left it unchanged, i.e. didn't implemented things that I suggested
> yesterday. And here's why.
>
> The idea of
>
> class ZoomableWidget : public QWidget
> {
> public:
>  virtual zoomChanged();
> }

class Zoomable
{
    public:
        virtual void zoomChanged() = 0;
}

AFAIK that should work.

Albert


>
> and then...
>
> class SomeGameWidget : public ZoomableWidget
> {
>    // reimplement zoomChanged here
> }
>
> won't work out, because in current code each "SomeGameWidget" already has
> QWidget as its base class (direct or indirect). For example BaseBoard in
> libksirtet is "public QGraphicsView".
> And double-inheriting from QWidget is impossible (and even if it were
> possible i wouldn't do it ;) ).
>
> If I made ZoomableWidget to not inherit from QWidget (to remove this
> double-inheriting), than code in KZoomMainWindow becomes a rude hack filled
> with casts here and there :).
>
> Earlier all worked just fine - adjustSize() was in QWidget and it was
> inherited by all classes that use KZoomMainWindow.
>
> So, any ideas, solutions? :)
>
> Cheers,
> Dmitry.
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-games-devel


More information about the kde-games-devel mailing list