[Qt-creator] Configure script file path in QtCreator options and read it in plugin code

Vidhya Arun svidhyapria at gmail.com
Fri Dec 15 11:51:54 CET 2017


Hi

 I was able to successfully add a custom option under Tools-Options of
QtCreator. I have a text box added in my custom page here to accept a
parameter.

But I would like to retain the value once entered and given an apply/Ok.
Currently every time I open the Tools-Options, the textbox is blank always.
Is there a way to save the once entered input in settings to avoid entering
input everytime ?

On Tue, 12 Dec 2017 at 6:19 PM, Vidhya Arun <svidhyapria at gmail.com> wrote:

> Thanks, I'll check it out.
>
> On Tue, 12 Dec 2017 at 1:38 PM, Eike Ziller <Eike.Ziller at qt.io> wrote:
>
>>
>>
>> > On 12. Dec 2017, at 07:40, Vidhya Arun <svidhyapria at gmail.com> wrote:
>> >
>> > Hello
>>
>> Hi,
>>
>> >
>> > I have a Qt creator plugin written where a perl script is called to
>> perform the required functionality. The perl script is located in a
>> specific path in my linux machine and there is a parameter passed to it.
>> Currently I am invoking this perl script with the hardcoded path and
>> parameter directly from my plugin. Whenever there is a change in the path
>> or parameter of the perl script, my plugin code also got to be changed.
>> >
>> > Is there a possibility where I can configure the perl script path in
>> some Tools-options of Qtcreator and read this path directly from plugin ?
>> This will ensure plugin code remains untouched for any changes in perl
>> script.
>>
>> Core::ICore::settings() returns a QSettings object that works on the Qt
>> Creator settings (on Linux located at ~/.config/QtProject/QtCreator.ini).
>> You can use that in your plugin to write and read any settings, also custom
>> ones for your plugin.
>> If you want to add a page to Tools > Options, have a look at the
>> Core::IOptionsPage class (<coreplugin/dialogs/optionspage.h>) and how it is
>> used in the other plugins.
>>
>> Br, Eike
>>
>> --
>> Eike Ziller
>> Principal Software Engineer
>>
>> The Qt Company GmbH
>> Rudower Chaussee 13
>> D-12489 Berlin
>> eike.ziller at qt.io
>> http://qt.io
>> Geschäftsführer: Mika Pälsi,
>> Juha Varelius, Mika Harjuaho
>> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht
>> Charlottenburg, HRB 144331 B
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20171215/2a524553/attachment.html>


More information about the Qt-creator mailing list