QCustomPlot Discussion and Comments

LayoutInset above LayoutGridReturn to overview

HI

My class is derived from QCPLayoutGrid and i would like to overlay it with a QCPLayoutInset.

As the method initializeParentPlot and setParentLayerable are protected, i can't use them and so my insetLayout is not well placed.

Any idea on how i could get around this problem ?

My first attempt lead me to use a QCPAxisRect to take advantage of its internal insetLayout but i don't use any features of QCPAxisRect so it's not very clean...

Thanks

B

Ok, by overriding the update method, it seems to be ok.
(inspired by what is done in QCPAxisRect)

Is it the best way to do ?

void Cell::update(QCPLayoutElement::UpdatePhase phase)
{
    mInsetLayout->setOuterRect(rect());
    mInsetLayout->update(phase);
    QCPLayoutGrid::update(phase);
}