How to detect user changing DzPane size [Solved]

I have a QLabel containing a Pixmap that I keep at a fixed aspect ratio as the Pane changes size.
That works fine, but I have to trigger the pixmap redraw but touching one on the controls on the pane so I know I need to redraw.

Neither QLabel not DzPane has a 'resized' signal.
I would think this a very common need.

How do you get notified when a user resizes the pane so you can auto adjust its contents?

Thanks

Post edited by Greenbriar Studio on

Comments

  • Greenbriar StudioGreenbriar Studio Posts: 32
    edited December 2015

    Simple addition. For anyone like me who didn't know how it worked -

    the DzPane is of course a QWidget subclass, so you add

    protected:
          virtual void resizeEvent(QResizeEvent * event);

    to your DzPane derived class .h file and


    void yourclass::resizeEvent(QResizeEvent * event){
          // whatever you want it to do. I didn't need the event info, just to know when it happened to call my redraw routine.
    }

    to your .cpp file
     

    Thanks to the DAZ programming team for the tip

     

    Post edited by Greenbriar Studio on
Sign In or Register to comment.