void EnrichmentDialog::setBestSize() { ImageWidget *iw = qobject_cast<ImageWidget *>(d_widget); if (iw){ iw->setSize(iw->pixmap().size()); displayCoordinates(unitBox->currentIndex()); d_plot->multiLayer()->notifyChanges(); return; } TexWidget *tw = qobject_cast<TexWidget *>(d_widget); if (tw){ tw->setBestSize(); displayCoordinates(unitBox->currentIndex()); d_plot->multiLayer()->notifyChanges(); return; } }