7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qwidget.h>
9#include <QtWidgets/qabstractitemdelegate.h>
10#include <QtCore/qabstractitemmodel.h>
11#include <QtCore/qvariant.h>
12#include <QtGui/qvalidator.h>
27 Q_PROPERTY(
bool editable READ isEditable WRITE setEditable)
29 Q_PROPERTY(
QString currentText READ currentText WRITE setCurrentText NOTIFY currentTextChanged
31 Q_PROPERTY(
int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
33 Q_PROPERTY(
int maxVisibleItems READ maxVisibleItems WRITE setMaxVisibleItems)
37 Q_PROPERTY(
int minimumContentsLength READ minimumContentsLength WRITE setMinimumContentsLength)
40 Q_PROPERTY(
bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled)
42 Q_PROPERTY(
int modelColumn READ modelColumn WRITE setModelColumn)
48 int maxVisibleItems()
const;
49 void setMaxVisibleItems(
int maxItems);
52 void setMaxCount(
int max);
55 bool duplicatesEnabled()
const;
56 void setDuplicatesEnabled(
bool enable);
59 bool hasFrame()
const;
78 InsertPolicy insertPolicy()
const;
79 void setInsertPolicy(InsertPolicy
policy);
84 AdjustToMinimumContentsLengthWithIcon
88 SizeAdjustPolicy sizeAdjustPolicy()
const;
89 void setSizeAdjustPolicy(SizeAdjustPolicy
policy);
90 int minimumContentsLength()
const;
95 void setPlaceholderText(
const QString &placeholderText);
96 QString placeholderText()
const;
98 bool isEditable()
const;
99 void setEditable(
bool editable);
102#ifndef QT_NO_VALIDATOR
107#if QT_CONFIG(completer)
121 int modelColumn()
const;
122 void setModelColumn(
int visibleColumn);
124 int currentIndex()
const;
136 { insertItems(
count(), texts); }
142 void insertSeparator(
int index);
144 void removeItem(
int index);
156 virtual void showPopup();
157 virtual void hidePopup();
165 void clearEditText();
167 void setCurrentIndex(
int index);
191#if QT_CONFIG(wheelevent)
192 void wheelEvent(QWheelEvent *
e)
override;
194#ifndef QT_NO_CONTEXTMENU
219#if QT_CONFIG(completer)
The QAbstractItemDelegate class is used to display and edit data items from a model.
The QAbstractItemView class provides the basic functionality for item view classes.
The QComboBox widget is a combined button and popup list.
InsertPolicy
This enum specifies what the QComboBox should do when a new string is entered by the user.
SizeAdjustPolicy
This enum specifies how the size hint of the QComboBox should adjust when new content is added or con...
@ AdjustToContentsOnFirstShow
void insertItem(int index, const QString &text, const QVariant &userData=QVariant())
Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.
void activated(int index)
This signal is sent when the user chooses an item in the combobox.
int count
the number of items in the combobox
void editTextChanged(const QString &)
This signal is emitted when the text in the combobox's line edit widget is changed.
void currentTextChanged(const QString &)
void addItem(const QString &text, const QVariant &userData=QVariant())
Adds an item to the combobox with the given text, and containing the specified userData (stored in th...
void currentIndexChanged(int index)
void textActivated(const QString &)
void addItems(const QStringList &texts)
Adds each of the strings in the given texts to the combobox.
void textHighlighted(const QString &)
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 highlighted(int index)
This signal is sent when an item in the combobox popup list is highlighted by the user.
The QCompleter class provides completions based on an item model.
The QFocusEvent class contains event parameters for widget focus events.
The QHideEvent class provides an event which is sent after a widget is hidden.
The QIcon class provides scalable icons in different modes and states.
The QKeyEvent class describes a key event.
The QLineEdit widget is a one-line text editor.
The QPaintEvent class contains event parameters for paint events.
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\variable QStyleOptionToolButton::features
The QValidator class provides validation of input text.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QT_REQUIRE_CONFIG(feature)
view setModel(model)
[17] //! [18]
QSqlQueryModel * model
[16]
QList< QChar > characters
lineEdit setCompleter(completer)
QCompleter * completer
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent