<div dir="ltr"><font color="#000000">Hello Devs</font><div style><font color="#000000">    I was trying to separate the Astrocalc tool from main application to make it accessible from command line argument:</font></div><div style="text-align:center">
<font color="#000000">./kstars --calc(or ./run.sh kstars --calc) </font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">This has been addressed here: </font><a href="https://bugs.kde.org/show_bug.cgi?id=122329">https://bugs.kde.org/show_bug.cgi?id=122329</a></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">It seemed to be easy at-first but apparently I encountered some dependency issues while separating the module.</font></div><div style><br>
</div><div style><font color="#000000">So far, I have changed the code in main.cpp(~/kde/kstars/kstars/) to accommodate the new command line argument(calc in this case). I have tried a couple of possibilities(even tried to include a separate wrapper class) but </font><span style="color:rgb(0,0,0)">but things doesnt seem to work while I am calling the AstroCalc() function from the code in main.cpp.</span></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">Here's a brief about the flow:</font></div><div style><font color="#000000">Astrocalc.cpp(~/kde/kstars/kstars/tools/) is the code responsible for the Astrocalc tool(which has some cool features viz. composition/opposition module,coordinate converter, time calculator etc)</font></div>
<div style><font color="#000000"><br>This tool is being initiated(and displayed) from slotcalculator( )<br>slotcalculator( ) has been -></font></div><div style><font color="#000000">declared in kstars.h:535 </font></div>
<div style><font color="#000000">defined at kstarsactions.cpp:210 and </font></div><div style><font color="#000000">being called from kstarsinit.cpp:360 upon user action   </font></div><div style><br></div><div style><font color="#000000">Here's the issue I have encountered. </font></div>
<div style><font color="#000000">AstroCalc is using KDialog internally to display its components. <font face="arial, helvetica, sans-serif"><span style="font-size:13px">The </span><tt style="font-size:13px">KDialog</tt><span style="font-size:13px"> needs a </span><tt style="font-size:13px">QWidget</tt><span style="font-size:13px"> to use as main widget, so we create it first but this should not be the case if we want to call it from command line right ?</span></font></font></div>
<div style>(c<span style="color:rgb(0,0,0)">urrently, a reference of KXmlGuiWindow is being passed implicitly for QWidget *parent)</span><br></div><div style><span style="color:rgb(0,0,0)">I googled a little and found Inheritance Diagram of KDialog at </span><a href="http://www.purinchu.net/kdelibs-apidocs/kdeui/html/classKDialog.html">http://www.purinchu.net/kdelibs-apidocs/kdeui/html/classKDialog.html</a></div>
<div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">So AstroCalc is dependent on KDialog </span></div><div style><span style="color:rgb(0,0,0)">KDialog uses QWidget</span></div>
<div style><span style="color:rgb(0,0,0)">and Qwidget is using </span><span style="color:rgb(0,0,0)">KXmlGuiWindow as its parent widget.</span></div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">Is there any way to break this dependency? </span><span style="color:rgb(0,0,0)">I am new to QT so might be missing something.</span></div>
<div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)">Any suggestions? <br><br></span></div><div style><span style="color:rgb(0,0,0)">Regards,<br>Nalin Chhibber (codeinjector)</span></div>
<div style><a href="http://www.nalinchhibber.com">www.nalinchhibber.com</a></div></div>