Hi,<br><br>Please let me know if you have any suggestions in this regard.<br><br>Thanks,<br>Pandu<br><br><div class="gmail_quote">On Thu, Sep 27, 2012 at 9:41 AM, Pandu tech <span dir="ltr">&lt;<a href="mailto:pandu4tech@gmail.com" target="_blank">pandu4tech@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br>In my application, I would like to set 3D render view &quot;Use Parallel Projection&quot; option to checked by default. I understood that &quot;CameraParallelProjection&quot; is the property associated with this.<br>


<br>I tried to modify the settings.ini file created by pqSettings class. I tried the following in myMainWindow.cxx file:<br><br>code:--<br>//creating a new settings file if not exists<br>  QString settingsRoot;<br>#if defined(Q_OS_WIN)<br>


  settingsRoot = QString::fromLocal8Bit(getenv(&quot;APPDATA&quot;));<br>#else<br>  settingsRoot = QString::fromLocal8Bit(getenv(&quot;HOME&quot;)) +<br>                 QDir::separator() + QString::fromLocal8Bit(&quot;.config&quot;);<br>


#endif<br>  QString settingsPath = QString(&quot;%2%1%3&quot;);<br>  settingsPath = settingsPath.arg(QDir::separator());<br>  settingsPath = settingsPath.arg(settingsRoot);<br>  settingsPath = settingsPath.arg(QApplication::organizationName());<br>


<br>  QString filename = settingsPath.append(&quot;/&quot; +QApplication::applicationName() + QApplication::applicationVersion()+&quot;.ini&quot;);<br><br>  QSettings *settings = 0;<br>  QFile file;<br>  if(!file.exists(filename))<br>


  {<br>      settings = new QSettings(QSettings::IniFormat,QSettings::UserScope,<br>                                          QApplication::organizationName(),<br>                                          QApplication::applicationName() + QApplication::applicationVersion(), this);<br>


<br>      settings-&gt;beginGroup(&quot;renderModule&quot;);<br>      settings-&gt;setValue(&quot;CameraParallelProjection&quot;, 1); // setting value to 1<br>      settings-&gt;endGroup();<br>      settings-&gt;sync();<br>

  }<br><br>Using this code, I am able to create .ini file with CameraParallelProjection value set to 1. But for the first time, when I run my application, UseParallelProjection is not checked. <br>
<br>Whenever I switch b/w views or restart the application once again, because .ini file already present, then I can see UseParallelProjection option checked.<br><br>How can I set UseParallelProjection option to be checked even in the first time? Please let me know if there is any better approach regarding this.<br>


<br>Truly appreciate your help reg. this.<br><br>Thanks,<br>Pandu.<br>
</blockquote></div><br>