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"><<a href="mailto:pandu4tech@gmail.com" target="_blank">pandu4tech@gmail.com</a>></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 "Use Parallel Projection" option to checked by default. I understood that "CameraParallelProjection" 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("APPDATA"));<br>#else<br> settingsRoot = QString::fromLocal8Bit(getenv("HOME")) +<br> QDir::separator() + QString::fromLocal8Bit(".config");<br>
#endif<br> QString settingsPath = QString("%2%1%3");<br> settingsPath = settingsPath.arg(QDir::separator());<br> settingsPath = settingsPath.arg(settingsRoot);<br> settingsPath = settingsPath.arg(QApplication::organizationName());<br>
<br> QString filename = settingsPath.append("/" +QApplication::applicationName() + QApplication::applicationVersion()+".ini");<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->beginGroup("renderModule");<br> settings->setValue("CameraParallelProjection", 1); // setting value to 1<br> settings->endGroup();<br> settings->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>