Skip to content
  • Jason Harris's avatar
    Make Calculator work. Instead of deleting and creating widgets when a · 2c58ad7e
    Jason Harris authored
    module is selected, all modules are now loaded into a QStackedWidget.  
    This presizes the calculator to fit the largest module (LSR velocity).
    
    I also solved one problem with layouts of UI-designed widgets.  I kept 
    getting crashes when opening the calculator with messages like "Cannot 
    add layout to 'modCalcJD', it already has a layout.  This will cause 
    memory leaks".  I tried several things to solve it, but what finally 
    worked was simply modifying the setupUi line in each of the classes 
    derived from a UI-generated class.  For example, modCalcJD is derived 
    from modCalcJdDlg (created in Qt designer).  It's ctor looked like this:
    
    modCalcJD::modCalcJD(QWidget *parentSplit) : QFrame(parentSplit) {
    	setupUi(parentSplit);
    	showCurrentTime();
    	show();
    }
    
    I simply changed the first line to "setupUi(this);".  The argument to 
    setupUi(QWidget*) must be the derived widget itself, *not* the parent 
    of that widget.  This problem exists elsewhere in the code; I'm going to 
    fix that next.
    
    I suspect this is the same issue Jasem was having with layouts of the 
    Details window a while ago.
    
    CCMAIL: kstars-devel@kde.org
    
    
    svn path=/trunk/KDE/kdeedu/kstars/; revision=519561
    2c58ad7e