@@ -1115,7 +1115,80 @@ var fileName = script.getSaveFileName("Please select HTML file to save", "output
1115
1115
1116
1116
### 예제
1117
1117
``` js
1118
- // you have to define your registered variables so you can access them later
1118
+ // 나중에 액세스하려면 등록된 변수를 정의해야 합니다
1119
+ property string myString;
1120
+ property string myStringSecret;
1121
+ property bool myBoolean;
1122
+ property string myText;
1123
+ property int myInt;
1124
+ property string myFile;
1125
+ property string myDirectory;
1126
+ property string mySelection;
1127
+
1128
+ // register your settings variables so the user can set them in the script settings
1129
+ //
1130
+ // unfortunately there is no QVariantHash in Qt, we only can use
1131
+ // QVariantMap (that has no arbitrary ordering) or QVariantList (which at
1132
+ // least can be ordered arbitrarily)
1133
+ property variant settingsVariables: [
1134
+ {
1135
+ " identifier" : " myString" ,
1136
+ " name" : " I am a line edit" ,
1137
+ " description" : " Please enter a valid string:" ,
1138
+ " type" : " string" ,
1139
+ " default" : " My default value" ,
1140
+ },
1141
+ {
1142
+ " identifier" : " myStringSecret" ,
1143
+ " name" : " I am a password field" ,
1144
+ " description" : " Please enter a valid string:" ,
1145
+ " type" : " string-secret" ,
1146
+ },
1147
+ {
1148
+ " identifier" : " myBoolean" ,
1149
+ " name" : " I am a checkbox" ,
1150
+ " description" : " Some description" ,
1151
+ " text" : " Check this checkbox" ,
1152
+ " type" : " boolean" ,
1153
+ " default" : true ,
1154
+ },
1155
+ {
1156
+ " identifier" : " myText" ,
1157
+ " name" : " I am textbox" ,
1158
+ " description" : " Please enter your text:" ,
1159
+ " type" : " text" ,
1160
+ " default" : " This can be a really long text\n with multiple lines." ,
1161
+ },
1162
+ {
1163
+ " identifier" : " myInt" ,
1164
+ " name" : " I am a number selector" ,
1165
+ " description" : " Please enter a number:" ,
1166
+ " type" : " integer" ,
1167
+ " default" : 42 ,
1168
+ },
1169
+ {
1170
+ " identifier" : " myFile" ,
1171
+ " name" : " I am a file selector" ,
1172
+ " description" : " Please select the file:" ,
1173
+ " type" : " file" ,
1174
+ " default" : " pandoc" ,
1175
+ },
1176
+ {
1177
+ " identifier" : " myDirectory" ,
1178
+ " name" : " I am a directory selector" ,
1179
+ " description" : " Please select the directory:" ,
1180
+ " type" : " directory" ,
1181
+ " default" : " /home" ,
1182
+ },
1183
+ {
1184
+ " identifier" : " mySelection" ,
1185
+ " name" : " I am an item selector" ,
1186
+ " description" : " Please select an item:" ,
1187
+ " type" : " selection" ,
1188
+ " default" : " option2" ,
1189
+ " items" : {" option1" : " Text for option 1" , " option2" : " Text for option 2" , " option3" : " Text for option 3" },
1190
+ }
1191
+ ];
1119
1192
property string myString;
1120
1193
property string myStringSecret;
1121
1194
property bool myBoolean;
0 commit comments