Skip to content

Commit

Permalink
docs: Documented FileEdit.isDirectory / filter and fix @link tags (#3777
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dogboydog committed Jul 6, 2023
1 parent 336569e commit cb4c33c
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions docs/scripting-doc/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3140,7 +3140,7 @@ declare class WangSet extends TiledObject {
*
* @since 1.10.2
*/
public effectiveTypeForColor(int color) : typeof WangSet.Edge | typeof WangSet.Corner | typeof WangSet.Mixed
public effectiveTypeForColor(color : number) : typeof WangSet.Edge | typeof WangSet.Corner | typeof WangSet.Mixed
}

/**
Expand Down Expand Up @@ -4362,16 +4362,30 @@ declare class ColorButton extends Qt.QWidget {
* and displays the path in the dialog.
*/
declare class FileEdit extends Qt.QWidget {

/**
* The {@link Qt.Qurl} of the currently selected file.
* The {@link Qt.QUrl} of the currently selected file.
*/
fileUrl: Qt.QUrl;

/**
* Signal emitted when the selected fileUrl changes
* Signal emitted when the selected fileUrl changes.
*/
fileUrlChanged: Signal<Qt.QUrl>;
/**
* If `true`, the user will be prompted for a directory rather than a file. Defaults to `false`.
*/
isDirectory: boolean;

/**
* When specified, only files that match the filter are shown.
* The filter is given in a format like `"Images (*.png *.xpm *.jpg)"`.
*
* If you want multiple filters, separate them with ';;', for example:
* ```
* "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)"
* ```
*/
filter: string;
}
/**
* A widget that displays an {@link Image} on your dialog.
Expand Down Expand Up @@ -4486,25 +4500,27 @@ declare class Dialog extends Qt.QWidget {
/**
* Adds an image widget that can display an image in a dialog.
*/
addImage(labelText: string, image: Image): ImageWidget;
addImage(labelText: string, image: Image): ImageWidget;

/**
* Add a {@link Qt.QSlider} widget to the dialog to allow a user to
* type a numerical value or use up and down controls on the widget to manipulate the value.
* This can be used to enter integer or decimal values.
*/
addNumberInput(labelText?: string): Qt.QDoubleSpinBox;

/**
* Add a {@link Qt.QSlider} widget to the dialog to allow a user to
* slide a handle within a number range. This can only be used to enter integer-type values.
*/
addSlider(labelText?: string): Qt.QSlider;
/**
* Add a {@link Qt.QCheckBox} widget to the dialog to allow a user to
* toggle a boolean value.
* @param labelText The text of the label to display inside the checkbox widget
* @param defaultValue true to have the checkbox checked by default, false to have the checkbox start unchecked.
*/

/**
* Add a {@link Qt.QCheckBox} widget to the dialog to allow a user to
* toggle a boolean value.
* @param labelText The text of the label to display inside the checkbox widget
* @param defaultValue true to have the checkbox checked by default, false to have the checkbox start unchecked.
*/
addCheckBox(labelText: string, defaultValue: boolean): Qt.QCheckBox;

/**
Expand All @@ -4513,6 +4529,7 @@ declare class Dialog extends Qt.QWidget {
* @param labelText
*/
addButton(labelText: string): Qt.QPushButton;

/**
* Add a {@link Qt.QLineEdit} widget to the dialog to allow the user
* to enter a single line of text
Expand Down Expand Up @@ -4544,10 +4561,12 @@ declare class Dialog extends Qt.QWidget {
*/
addColorButton(labelText?: string): ColorButton;

/* Widget with a button which opens a file picker dialog
* and displays the path in the dialog.
*/
/**
* Add a {@link FileEdit} widget with a button which opens a file picker
* dialog and displays the path in the dialog.
*/
addFilePicker(labelText?: string): FileEdit;

/**
* Erase all of the widgets that you have added to the dialog.
* Call this if you want to re-draw your dialog with a new configuration of widgets.
Expand Down Expand Up @@ -4588,20 +4607,20 @@ declare class Dialog extends Qt.QWidget {
done(resultCode: typeof Dialog.Rejected | typeof Dialog.Accepted): void;

/**
* Called when the dialog is closed via {@link accept()} or the {@link done()}
* Called when the dialog is closed via {@link accept} or the {@link done}
* method is called with {@link Dialog.Accepted} as its argument.
*/
accepted: Signal<void>;

/**
* Called when the dialog is closed via the X button, {@link reject()}, or the
* {@link done()} method is called with {@link Dialog.Rejected} as its
* Called when the dialog is closed via the X button, {@link reject}, or the
* {@link done} method is called with {@link Dialog.Rejected} as its
* argument.
*/
rejected: Signal<void>;

/**
* Called when the dialog is closed or the {@link done()} method is called.
* Called when the dialog is closed or the {@link done} method is called.
* The number value it provides is either {@link Dialog.Accepted} or
* {@link Dialog.Rejected}.
*/
Expand Down

0 comments on commit cb4c33c

Please sign in to comment.