Description Usage Arguments Details Author(s)
These utilities provide simple wrappers for various built-in modal dialogs in Qt. Modal dialogs are used for one-time user input, such as getting a file name or choosing an item from a menu.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | qfile.choose(caption = "", dir = "", filter = "",
allow.new = FALSE, parent = NULL)
qdir.choose(caption = "", dir = "", parent = NULL)
qgetColor(parent = NULL, title = "", alpha = 1)
qgetDouble(title = "Choose value",
label = "Enter a numeric value",
value = 0.0,
minValue = -.Machine$double.xmax,
maxValue = .Machine$double.xmax,
decimals = 3L, parent = NULL)
qgetInteger(title = "Choose value", label = "Enter an integer value", value = 0L,
minValue = -.Machine$integer.max,
maxValue = .Machine$integer.max,
step = 1L, parent = NULL)
qgetText(title = "Choose value", label = "Enter a text string",
text = "",
echomode = c("normal", "noecho", "password", "echoonedit"),
parent = NULL)
qgetItem(title = "Choose value", label = "Choose a list item",
items = "",
current = 1L, editable = TRUE,
parent = NULL)
|
caption, title |
Character string giving caption or window title. |
dir |
Character string giving the initial directory. The file
dialog's working directory will be set to |
parent |
An optional QWidget, specifying the parent of the dialog. |
filter |
Character string giving filter for file names. Only
files that match the filter are shown. Multiple filters are
separated with |
allow.new |
Logical flag, specifying whether a non-existent file may be selected. |
alpha |
An alpha-transparency factor (between 0 and 1) to be applied to the selected color. |
label |
Character string giving a label for the selection. |
value, text |
Initial value. |
minValue |
Minimum value allowed. |
maxValue |
Maximum value allowed. |
decimals |
The maximum number of decimals allowed. |
step |
The increment for |
echomode |
Specifies how the user input should be displayed. Partial matching is allowed. |
items |
Character vector giving list of items to choose from. |
current |
The initial choice selected. |
editable |
Logical flag, specifying whether the list of items are immutable, or whether a new name may be specified. |
qfile.choose
can be used to select a file name. It is a
wrapper around either Qt$QFileDialog$getOpenFileName
(if only
an existing file's name may be selected) or
Qt$QFileDialog$getSaveFileName
. The function returns a
character string giving the absolute path of the selected file, or
NULL
if the dialog is canceled.
qdir.choose
is a similar wrapper for
Qt$QFileDialog$getExistingDirectory
that can be used to select
a directory name.
qgetColor
can be used to select a color. It is a wrapper for
Qt$QColorDialog$getColor
. The function returns a character
string giving the color in "#RRGGBBAA"
hexadecimal format, or
NA
if the dialog is canceled.
qgetInteger
, qgetDouble
, and qgetText
can me used
to obtain a double, integer, or character string respectively.
qgetItem
can be used to select an item from a list. They are
wrappers for the corresponding static functions of
Qt$QInputDialog
. The return value on cancellation is the
initial value for qgetInteger
and qgetDouble
,
NULL
for qgetText
, and the initially selected element
for qgetItem
(which may be NULL
is current
is out
of range).
Deepayan Sarkar
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.