41 Q_UNREACHABLE_RETURN(
nullptr);
178 QInputDialog::InputDialogOptions
opts;
203 label =
new QLabel(QInputDialog::tr(
"Enter a value:"),
q);
204#ifndef QT_NO_SHORTCUT
291 q,
SIGNAL(intValueChanged(
int)));
302 q,
SIGNAL(doubleValueChanged(
double)));
524 d->ensureIntSpinBox();
528 d->ensureDoubleSpinBox();
533 d->chooseRightTextInputWidget();
544 if (
d->inputWidget) {
545 if (
d->inputWidget ==
d->intSpinBox) {
547 }
else if (
d->inputWidget ==
d->doubleSpinBox) {
568 d->label->setText(
text);
576 return d->label->text();
605 if (!(
d->opts &
option) != !on)
618 return (
d->opts &
option) != 0;
634 InputDialogOptions changed = (
options ^
d->opts);
644 d->chooseRightTextInputWidget();
646 d->chooseRightTextInputWidget();
670 if (
d->inputWidget ==
d->lineEdit) {
671 d->lineEdit->setText(
text);
672 }
else if (
d->inputWidget ==
d->plainTextEdit) {
673 d->plainTextEdit->setPlainText(
text);
674 }
else if (
d->inputWidget ==
d->comboBox) {
675 d->setComboBoxText(
text);
677 d->setListViewText(
text);
701 d->lineEdit->setEchoMode(
mode);
708 return d->lineEdit->echoMode();
725 d->comboBox->setEditable(editable);
727 d->chooseRightTextInputWidget();
734 return d->comboBox->isEditable();
754 d->comboBox->clear();
755 d->comboBox->addItems(
items);
759 d->chooseRightTextInputWidget();
767 const int count =
d->comboBox->count();
770 result.append(
d->comboBox->itemText(
i));
787 d->intSpinBox->setValue(
value);
794 return d->intSpinBox->value();
811 d->ensureIntSpinBox();
812 d->intSpinBox->setMinimum(min);
819 return d->intSpinBox->minimum();
836 d->ensureIntSpinBox();
837 d->intSpinBox->setMaximum(max);
844 return d->intSpinBox->maximum();
858 d->ensureIntSpinBox();
859 d->intSpinBox->setRange(min, max);
873 d->ensureIntSpinBox();
874 d->intSpinBox->setSingleStep(step);
881 return d->intSpinBox->singleStep();
899 d->doubleSpinBox->setValue(
value);
905 if (
d->doubleSpinBox) {
906 return d->doubleSpinBox->value();
923 d->ensureDoubleSpinBox();
924 d->doubleSpinBox->setMinimum(min);
930 if (
d->doubleSpinBox) {
931 return d->doubleSpinBox->minimum();
948 d->ensureDoubleSpinBox();
949 d->doubleSpinBox->setMaximum(max);
955 if (
d->doubleSpinBox) {
956 return d->doubleSpinBox->maximum();
970 d->ensureDoubleSpinBox();
971 d->doubleSpinBox->setRange(min, max);
986 d->ensureDoubleSpinBox();
987 d->doubleSpinBox->setDecimals(decimals);
993 if (
d->doubleSpinBox) {
994 return d->doubleSpinBox->decimals();
1061 d->receiverToDisconnectOnClose = receiver;
1062 d->memberToDisconnectOnClose = member;
1094 d->inputWidget->setFocus();
1095 if (
d->inputWidget ==
d->lineEdit) {
1096 d->lineEdit->selectAll();
1097 }
else if (
d->inputWidget ==
d->plainTextEdit) {
1098 d->plainTextEdit->selectAll();
1099 }
else if (
d->inputWidget ==
d->intSpinBox) {
1100 d->intSpinBox->selectAll();
1101 }
else if (
d->inputWidget ==
d->doubleSpinBox) {
1102 d->doubleSpinBox->selectAll();
1133 if (
d->receiverToDisconnectOnClose) {
1135 d->receiverToDisconnectOnClose,
d->memberToDisconnectOnClose);
1136 d->receiverToDisconnectOnClose =
nullptr;
1138 d->memberToDisconnectOnClose.clear();
1169 Qt::WindowFlags
flags, Qt::InputMethodHints inputMethodHints)
1182 return dialog->textValue();
1217 Qt::InputMethodHints inputMethodHints)
1230 return dialog->textValue();
1264 int min,
int max,
int step,
bool *
ok, Qt::WindowFlags
flags)
1269 dialog->setIntRange(min, max);
1271 dialog->setIntStep(step);
1277 return dialog->intValue();
1311 double value,
double min,
double max,
int decimals,
bool *
ok,
1312 Qt::WindowFlags
flags,
double step)
1317 dialog->setDoubleDecimals(decimals);
1318 dialog->setDoubleRange(min, max);
1320 dialog->setDoubleStep(step);
1326 return dialog->doubleValue();
1363 Qt::WindowFlags
flags, Qt::InputMethodHints inputMethodHints)
1372 dialog->setComboBoxEditable(editable);
1379 return dialog->textValue();
1397 d->ensureDoubleSpinBox();
1398 d->doubleSpinBox->setSingleStep(step);
1404 if (
d->doubleSpinBox)
1405 return d->doubleSpinBox->singleStep();
1475#include "qinputdialog.moc"
1476#include "moc_qinputdialog.cpp"
virtual Q_INVOKABLE QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
virtual Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index.
void setEditTriggers(EditTriggers triggers)
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
\reimp
QItemSelectionModel * selectionModel() const
Returns the current selection model.
void setSelectionMode(QAbstractItemView::SelectionMode mode)
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
void editingFinished()
This signal is emitted editing is finished.
QLineEdit * lineEdit() const
This function returns a pointer to the line edit of the spin box.
bool hasAcceptableInput() const
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
void insertWidget(int index, QWidget *widget, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Inserts widget at position index, with stretch factor stretch and alignment alignment.
The QComboBox widget is a combined button and popup list.
QString itemText(int index) const
Returns the text for the given index in the combobox.
int count
the number of items in the combobox
QString currentText
the current text
void setEditText(const QString &text)
Sets the text in the combobox's text edit.
QAbstractItemModel * model() const
Returns the model used by the combobox.
int findText(const QString &text, Qt::MatchFlags flags=static_cast< Qt::MatchFlags >(Qt::MatchExactly|Qt::MatchCaseSensitive)) const
Returns the index of the item containing the given text; otherwise returns -1.
void setCurrentIndex(int index)
The QDialog class is the base class of dialog windows.
QSize sizeHint() const override
\reimp
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
QSize minimumSizeHint() const override
\reimp
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
virtual void done(int)
Closes the dialog and sets its result code to r.
The QDoubleSpinBox class provides a spin box widget that takes doubles.
void setLabelText(DialogLabel label, const QString &text)
Sets the text shown in the filedialog in the specified label.
void setOptions(Options options)
Q_INVOKABLE QModelIndexList selectedRows(int column=0) const
virtual void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
The QKeyEvent class describes a key event.
The QLabel widget provides a text or image display.
void removeWidget(QWidget *w)
Removes the widget widget from the layout.
void setSizeConstraint(SizeConstraint)
The QLineEdit widget is a one-line text editor.
void setText(const QString &)
EchoMode
This enum type describes how a line edit should display its contents.
The QListView class provides a list or icon view onto a model.
T value(qsizetype i) const
constexpr int row() const noexcept
Returns the row this model index refers to.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
The QPlainTextEdit class provides a widget that is used to edit and display plain text.
void setLineWrapMode(LineWrapMode mode)
void setPlainText(const QString &text)
Changes the text of the text edit to the string text.
QString toPlainText() const
Returns the text of the text edit as plain text.
Exception-safe wrapper around QObject::blockSignals().
The QSpinBox class provides a spin box widget.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QVBoxLayout class lines up widgets vertically.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
object setProperty("down", true)
void textChanged(const QString &newText)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * label
[43]
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]
QFileDialog dialog(this)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent