Is it possible to make custom properties read-only

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
Taygete
Full Member
Posts: 50
Joined: Wed May 14, 2014 8:53 am

Is it possible to make custom properties read-only

Post by Taygete » Sat May 31, 2014 4:12 pm

Hi,

I have done a search and haven't been able to find this feature.

I currently set some custom properties in a script which the user can then view and change in the property editor, however there is some data I would like to make read-only so the user cannot change it.

Ideally I would like to be able to set a flag when setting the custom property to be read-only (or another choice might be to make it visible/hidden in the property editor), is this possible?

Thanks,

Andrew.

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Is it possible to make custom properties read-only

Post by hungerburg » Sat May 31, 2014 7:40 pm

Not an authoritative answer, but I studied xdata in the dxf spec and there is no such flag there. As dxf is the standard file format in qcad such a feature would require a proprietary extension.

Taygete
Full Member
Posts: 50
Joined: Wed May 14, 2014 8:53 am

Re: Is it possible to make custom properties read-only

Post by Taygete » Sun Jun 01, 2014 6:00 am

hungerburg wrote:Not an authoritative answer, but I studied xdata in the dxf spec and there is no such flag there. As dxf is the standard file format in qcad such a feature would require a proprietary extension.
Hi hungerburg,

Thanks for the info, I guess that is why there isn't this option already.

Andrew.

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Is it possible to make custom properties read-only

Post by hungerburg » Tue Jun 03, 2014 10:19 am

You could put the data that you want to hide from the users below a different APPID than the one users are to modify themselves, so there is at least some visual separation.

Taygete
Full Member
Posts: 50
Joined: Wed May 14, 2014 8:53 am

Re: Is it possible to make custom properties read-only

Post by Taygete » Tue Jun 03, 2014 3:26 pm

hungerburg wrote:You could put the data that you want to hide from the users below a different APPID than the one users are to modify themselves, so there is at least some visual separation.
Hi hungerburg,

Thanks for the idea, I will take a look into that.

Andrew.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Is it possible to make custom properties read-only

Post by andrew » Thu Jun 05, 2014 8:38 am

There's definitely some room for improvement for the handling of custom properties.
QCAD stores custom properties as strings in the format 'key:value".

This notation is entirely QCAD specific and could be extended to contain other information such as:
ReadOnly,                  // Property is read only
Invisible,                 // Property is not displayed
Angle,                     // Property is an angle (shown in user preferred angle unit)
RichText,                  // Property is rich text and can be edited as such
Style,                     // Property is a text style (font)
Label,                     // Property is a label (suggests context menu to insert symbols)
Pattern,                   // Property is a hatch pattern name
Integer,                   // Property is an integer number
Double,                    // Property is a double (real) number
Boolean,                   // Property is a boolean (true or false)
List                       // Property is one of several choices presented in a combo box
And possibly others. Any thoughts?

Taygete
Full Member
Posts: 50
Joined: Wed May 14, 2014 8:53 am

Re: Is it possible to make custom properties read-only

Post by Taygete » Thu Jun 05, 2014 4:46 pm

andrew wrote:There's definitely some room for improvement for the handling of custom properties.
QCAD stores custom properties as strings in the format 'key:value".

This notation is entirely QCAD specific and could be extended to contain other information such as:
ReadOnly,                  // Property is read only
Invisible,                 // Property is not displayed
Angle,                     // Property is an angle (shown in user preferred angle unit)
RichText,                  // Property is rich text and can be edited as such
Style,                     // Property is a text style (font)
Label,                     // Property is a label (suggests context menu to insert symbols)
Pattern,                   // Property is a hatch pattern name
Integer,                   // Property is an integer number
Double,                    // Property is a double (real) number
Boolean,                   // Property is a boolean (true or false)
List                       // Property is one of several choices presented in a combo box
And possibly others. Any thoughts?
Hi Andrew,

All those on your list are good ideas, the readonly and invisible are particularly interesting to me.

I will have a think on this and if I come up with any questions or further ideas will post back.

Thanks,

Andrew.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”