18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include "QtWidgets/qcombobox.h"
21#include "QtWidgets/qabstractslider.h"
22#include "QtWidgets/qapplication.h"
23#include "QtWidgets/qstyleditemdelegate.h"
24#include "QtGui/qstandarditemmodel.h"
25#include "QtWidgets/qlineedit.h"
26#include "QtWidgets/qlistview.h"
27#include "QtGui/qpainter.h"
28#include "QtWidgets/qstyle.h"
29#include "QtWidgets/qstyleoption.h"
30#include "QtCore/qpair.h"
31#include "QtCore/qtimer.h"
32#include "private/qwidget_p.h"
33#include "QtCore/qpointer.h"
34#if QT_CONFIG(completer)
35#include "QtWidgets/qcompleter.h"
37#include "QtGui/qevent.h"
38#include "QtCore/qdebug.h"
55 setScreen(cmb->screen());
68 option->showDecorationSelected =
true;
134 emit doScroll(sliderAction);
136 emit doScroll(sliderAction);
137 emit doScroll(sliderAction);
148 const int mouseX =
e->position().toPoint().x();
149 const int mouseY =
e->position().toPoint().y();
150 const bool horizontallyInside =
pos().
x() < mouseX && mouseX <
rect().
right() + 1;
154 fast = horizontallyInside && verticallyOutside;
190 int topMargin()
const;
192 void updateTopBottomMargin();
193 void updateStyleSettings();
200 void scrollItemView(
int action);
201 void hideScrollers();
202 void updateScrollers();
203 void viewDestroyed();
227 bool maybeIgnoreMouseButtonRelease =
false;
243 const QStyleOptionViewItem &
option,
252 return mCombo->style()->sizeFromContents(
286 const QStyleOptionViewItem &
option,
304 return QSize(pm, pm);
320 void updateLineEditGeometry();
321 Qt::MatchFlags matchFlags()
const;
322 void _q_editingFinished();
323 void _q_returnPressed();
330 void _q_modelDestroyed();
331 void _q_modelReset();
332#if QT_CONFIG(completer)
335 void _q_resetButton();
337 void _q_updateIndexBeforeChange();
341 bool updateHoverControl(
const QPoint &
pos);
342 void trySetValidIndex();
343 QRect popupGeometry(
const QPoint &globalPos)
const;
345 int computeWidthHint()
const;
347 void adjustComboBoxSize();
350 int itemRole()
const;
351 void updateLayoutDirection();
353 void updateDelegate(
bool force =
false);
356 void updateViewContainerPaletteAndOpacity();
357 void updateFocusPolicy();
363 void cleanupNativePopup();
364 bool showNativePopup();
369 void operator()(
void)
372 cb->d_func()->emitActivated(
cb->d_func()->currentIndex);
395 int minimumContentsLength = 0;
396 int indexBeforeChange = -1;
397 int maxVisibleItems = 10;
400 int placeholderIndex = -1;
The QAbstractItemDelegate class is used to display and edit data items from a model.
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
The QAbstractItemView class provides the basic functionality for item view classes.
SliderAction
\value SliderNoAction \value SliderSingleStepAdd \value SliderSingleStepSub \value SliderPageStepAdd ...
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
static bool isSeparator(const QModelIndex &index)
QComboBoxDelegate(QObject *parent, QComboBox *cmb)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
static void setSeparator(QAbstractItemModel *model, const QModelIndex &index)
void resizeEvent(QResizeEvent *event) override
QComboBoxListView(QComboBox *cmb=nullptr)
void initViewItemOption(QStyleOptionViewItem *option) const override
void paintEvent(QPaintEvent *e) override
QPoint initialClickPosition
QBasicTimer adjustSizeTimer
void itemSelected(const QModelIndex &)
QTimer blockMouseReleaseTimer
QPersistentModelIndex currentIndex
QPersistentModelIndex root
bool contains(const QString &text, int role)
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
The QFrame class is the base class of widgets that can have a frame.
void paintEvent(QPaintEvent *) override
\reimp
void changeEvent(QEvent *) override
\reimp
void setFlags(GraphicsItemFlags flags)
Sets the item flags to flags.
GraphicsItemFlags flags() const
Returns this item's flags.
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 QLineEdit widget is a one-line text editor.
The QListView class provides a list or icon view onto a model.
void resizeEvent(QResizeEvent *e) override
\reimp
void initViewItemOption(QStyleOptionViewItem *option) const override
\reimp
QSize contentsSize() const
void resizeContents(int width, int height)
void paintEvent(QPaintEvent *e) override
\reimp
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
The QPaintEvent class contains event parameters for paint events.
The QPainter class performs low-level painting on widgets and other paint devices.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
const QBrush & window() const
Returns the window (general background) brush of the current color group.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
The QStandardItemModel class provides a generic model for storing custom data.
The QStandardItem class provides an item for use with the QStandardItemModel class.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\variable QStyleOptionToolButton::features
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
StateFlag
This enum describes flags that are used when drawing primitive elements.
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
@ PE_IndicatorToolBarSeparator
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
SubControl
This enum describes the available sub controls.
The QStyledItemDelegate class provides display and editing facilities for data items from a model.
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the size needed by the delegate to display the item specified by index, taking into account t...
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the delegate using the given painter and style option for the item specified by index.
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
int timerId() const
Returns the ID of the timer if the timer is running; otherwise returns -1.
void stop()
Stops the timer.
int width
the width of the window's geometry
Combined button and popup list for selecting options.
@ AccessibleDescriptionRole
static bool isSeparator(char c)
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble top
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define Q_AUTOTEST_EXPORT
#define QT_REQUIRE_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QSqlQueryModel * model
[16]
view viewport() -> scroll(dx, dy, deviceRect)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent