Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qcombobox_p.h>
Definition at line 312 of file qcombobox_p.h.
QComboBoxPrivate::QComboBoxPrivate | ( | ) |
Definition at line 59 of file qcombobox.cpp.
QComboBoxPrivate::~QComboBoxPrivate | ( | ) |
Definition at line 69 of file qcombobox.cpp.
References disconnectModel().
void QComboBoxPrivate::adjustComboBoxSize | ( | ) |
Definition at line 401 of file qcombobox.cpp.
References QComboBoxPrivateContainer::adjustSizeTimer, container, QBasicTimer::start(), and viewContainer().
Referenced by dataChanged(), modelChanged(), rowsInserted(), and rowsRemoved().
void QComboBoxPrivate::complete | ( | ) |
int QComboBoxPrivate::computeWidthHint | ( | ) | const |
Definition at line 323 of file qcombobox.cpp.
References QStyle::CT_ComboBox, fontMetrics, QFontMetrics::horizontalAdvance(), i, opt, qMax(), and QSize::width().
void QComboBoxPrivate::connectModel | ( | ) |
Definition at line 2077 of file qcombobox.cpp.
References QObjectPrivate::connect(), dataChanged(), QAbstractItemModel::dataChanged(), QObject::destroyed(), model, QAbstractItemModel::modelAboutToBeReset(), modelConnections, modelDestroyed(), modelReset(), QAbstractItemModel::modelReset(), QAbstractItemModel::rowsAboutToBeInserted(), QAbstractItemModel::rowsAboutToBeRemoved(), QAbstractItemModel::rowsInserted(), rowsInserted(), QAbstractItemModel::rowsRemoved(), rowsRemoved(), and updateIndexBeforeChange().
Referenced by viewContainer().
bool QComboBoxPrivate::contains | ( | const QString & | text, |
int | role ) |
void QComboBoxPrivate::dataChanged | ( | const QModelIndex & | topLeft, |
const QModelIndex & | bottomRight ) |
Definition at line 1088 of file qcombobox.cpp.
References adjustComboBoxSize(), QComboBox::AdjustToContents, currentIndex, inserting, lineEdit, QModelIndex::parent(), root, QPersistentModelIndex::row(), QModelIndex::row(), QLineEdit::setText(), sizeAdjustPolicy, sizeHint, text, updateCurrentText(), and updateLineEditGeometry().
Referenced by connectModel().
void QComboBoxPrivate::disconnectModel | ( | ) |
Definition at line 2102 of file qcombobox.cpp.
References connection, QObject::disconnect(), and modelConnections.
Referenced by ~QComboBoxPrivate(), and viewContainer().
void QComboBoxPrivate::doHidePopup | ( | ) |
Definition at line 2912 of file qcombobox.cpp.
References container, QWidget::hide(), QWidget::isVisible(), and resetButton().
void QComboBoxPrivate::editingFinished | ( | ) |
Definition at line 1293 of file qcombobox.cpp.
References currentIndex, emitActivated(), QCompleterPrivate::get(), itemText(), lineEdit, matchFlags(), and QLineEdit::text.
Referenced by QComboBox::setLineEdit().
void QComboBoxPrivate::emitActivated | ( | const QModelIndex & | index | ) |
Definition at line 1401 of file qcombobox.cpp.
References emit, itemText(), and text.
Referenced by editingFinished(), itemSelected(), keyboardSearchString(), and returnPressed().
void QComboBoxPrivate::emitCurrentIndexChanged | ( | const QModelIndex & | index | ) |
Definition at line 1421 of file qcombobox.cpp.
References emit, itemText(), lineEdit, text, and updateCurrentText().
Referenced by rowsInserted(), rowsRemoved(), and setCurrentIndex().
void QComboBoxPrivate::emitHighlighted | ( | const QModelIndex & | index | ) |
Definition at line 1411 of file qcombobox.cpp.
References emit, itemText(), and text.
Referenced by QComboBox::setModel(), and viewContainer().
void QComboBoxPrivate::init | ( | ) |
Definition at line 1034 of file qcombobox.cpp.
References QSizePolicy::ComboBox, QSizePolicy::Fixed, QSizePolicy::Preferred, QStyle::SE_ComboBoxLayoutItem, QWidgetPrivate::setLayoutItemMargins(), Qt::TabFocus, Qt::WA_InputMethodEnabled, and Qt::WheelFocus.
QIcon QComboBoxPrivate::itemIcon | ( | const QModelIndex & | index | ) | const |
Definition at line 1772 of file qcombobox.cpp.
References QAbstractItemModel::data(), decoration, Qt::DecorationRole, model, and QVariant::userType().
int QComboBoxPrivate::itemRole | ( | ) | const |
Definition at line 1440 of file qcombobox.cpp.
References Qt::DisplayRole, and Qt::EditRole.
Referenced by itemText().
void QComboBoxPrivate::itemSelected | ( | const QModelIndex & | item | ) |
Definition at line 1389 of file qcombobox.cpp.
References currentIndex, emitActivated(), item, lineEdit, QPersistentModelIndex::row(), QLineEdit::selectAll(), setCurrentIndex(), and QLineEdit::setText().
Referenced by viewContainer().
QString QComboBoxPrivate::itemText | ( | const QModelIndex & | index | ) | const |
Definition at line 1435 of file qcombobox.cpp.
References QAbstractItemModel::data(), itemRole(), and model.
Referenced by editingFinished(), emitActivated(), emitCurrentIndexChanged(), emitHighlighted(), and setCurrentIndex().
Definition at line 3429 of file qcombobox.cpp.
References currentIndex, emitActivated(), QComboBoxPrivateContainer::itemView(), setCurrentIndex(), text, view, and viewContainer().
Qt::MatchFlags QComboBoxPrivate::matchFlags | ( | ) | const |
Definition at line 1281 of file qcombobox.cpp.
References Qt::CaseSensitive, lineEdit, Qt::MatchCaseSensitive, and Qt::MatchFixedString.
Referenced by editingFinished(), and returnPressed().
void QComboBoxPrivate::modelChanged | ( | ) |
Definition at line 3442 of file qcombobox.cpp.
References adjustComboBoxSize(), QComboBox::AdjustToContents, sizeAdjustPolicy, and sizeHint.
Referenced by modelReset().
void QComboBoxPrivate::modelDestroyed | ( | ) |
Definition at line 259 of file qcombobox.cpp.
References model, and QAbstractItemModelPrivate::staticEmptyModel().
Referenced by connectModel().
void QComboBoxPrivate::modelReset | ( | ) |
Definition at line 247 of file qcombobox.cpp.
References lineEdit, modelChanged(), QLineEdit::setText(), trySetValidIndex(), and updateLineEditGeometry().
Referenced by connectModel().
QStyle::SubControl QComboBoxPrivate::newHoverControl | ( | const QPoint & | pos | ) |
Definition at line 306 of file qcombobox.cpp.
References QStyle::CC_ComboBox, hoverControl, hoverRect, opt, pos, QStyle::SC_All, and QStyle::SC_None.
Referenced by updateHoverControl().
Definition at line 283 of file qcombobox.cpp.
References QWidgetPrivate::availableScreenGeometry(), QWidgetPrivate::screenGeometry(), and QStylePrivate::useFullScreenForPopup().
Definition at line 347 of file qcombobox.cpp.
References QComboBox::AdjustToContents, QComboBox::AdjustToContentsOnFirstShow, QComboBox::AdjustToMinimumContentsLengthWithIcon, QStyle::CT_ComboBox, QFontMetricsF::height(), QSize::height(), i, iconSize, QString::isEmpty(), QSize::isValid(), minimumContentsLength, opt, placeholderText, qCeil(), qMax(), QSize::rwidth(), QSize::setHeight(), QSize::setWidth(), sizeAdjustPolicy, sizeHint, and QSize::width().
void QComboBoxPrivate::resetButton | ( | ) |
Definition at line 1083 of file qcombobox.cpp.
References QStyle::State_None, and updateArrow().
Referenced by doHidePopup(), and viewContainer().
void QComboBoxPrivate::returnPressed | ( | ) |
Definition at line 1325 of file qcombobox.cpp.
References currentIndex, QLineEdit::deselect(), duplicatesEnabled, emitActivated(), QLineEdit::end(), i, QComboBox::InsertAfterCurrent, QComboBox::InsertAlphabetically, QComboBox::InsertAtBottom, QComboBox::InsertAtCurrent, QComboBox::InsertAtTop, QComboBox::InsertBeforeCurrent, insertPolicy, QString::isEmpty(), QPersistentModelIndex::isValid(), lineEdit, matchFlags(), QComboBox::NoInsert, text, QLineEdit::text, this, and QString::toLower().
Referenced by QComboBox::setLineEdit().
void QComboBoxPrivate::rowsInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Definition at line 1116 of file qcombobox.cpp.
References adjustComboBoxSize(), QComboBox::AdjustToContents, container, currentIndex, emitCurrentIndexChanged(), indexBeforeChange, inserting, QString::isEmpty(), QPersistentModelIndex::isValid(), QComboBoxPrivateContainer::itemView(), QObjectData::parent, placeholderText, root, QPersistentModelIndex::row(), sizeAdjustPolicy, and sizeHint.
Referenced by connectModel().
void QComboBoxPrivate::rowsRemoved | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Definition at line 1155 of file qcombobox.cpp.
References adjustComboBoxSize(), QComboBox::AdjustToContents, currentIndex, emitCurrentIndexChanged(), indexBeforeChange, QPersistentModelIndex::isValid(), lineEdit, model, QObjectData::parent, qMax(), qMin(), root, QPersistentModelIndex::row(), QAbstractItemModel::rowCount(), setCurrentIndex(), QLineEdit::setText(), sizeAdjustPolicy, sizeHint, and updateLineEditGeometry().
Referenced by connectModel().
void QComboBoxPrivate::setCurrentIndex | ( | const QModelIndex & | index | ) |
Definition at line 2168 of file qcombobox.cpp.
References QItemSelectionModel::ClearAndSelect, currentIndex, emitCurrentIndexChanged(), indexBeforeChange, itemText(), lineEdit, model, modelColumn, QItemSelectionModel::Rows, QAbstractItemView::SelectRows, QLineEdit::setText(), QModelIndex::sibling(), QLineEdit::text, and updateLineEditGeometry().
Referenced by itemSelected(), keyboardSearchString(), QComboBox::keyPressEvent(), rowsRemoved(), QComboBox::setModelColumn(), and trySetValidIndex().
void QComboBoxPrivate::showPopupFromMouseEvent | ( | QMouseEvent * | e | ) |
Definition at line 3157 of file qcombobox.cpp.
References QComboBoxPrivateContainer::blockMouseReleaseTimer, QSinglePointEvent::button(), QStyle::CC_ComboBox, container, QApplication::doubleClickInterval, QLineEdit::event(), QEvent::ignore(), QComboBoxPrivateContainer::initialClickPosition, isVisible(), Qt::LeftButton, lineEdit, QEvent::MouseButtonRelease, opt, QSinglePointEvent::position(), QStyle::SC_ComboBoxArrow, QStyle::SC_ComboBoxEditField, QStyle::SC_None, QTimer::start(), QStyle::State_Sunken, QPointF::toPoint(), QEvent::type(), updateArrow(), and viewContainer().
void QComboBoxPrivate::trySetValidIndex | ( | ) |
Definition at line 264 of file qcombobox.cpp.
References QModelIndex::flags(), QAbstractItemModel::index(), Qt::ItemIsEnabled, model, modelColumn, pos, root, and setCurrentIndex().
Referenced by modelReset().
void QComboBoxPrivate::updateArrow | ( | QStyle::StateFlag | state | ) |
Definition at line 236 of file qcombobox.cpp.
References arrowState, opt, and state.
Referenced by resetButton(), and showPopupFromMouseEvent().
Definition at line 2920 of file qcombobox.cpp.
References currentText, emit, and text.
Referenced by dataChanged(), and emitCurrentIndexChanged().
update the default delegate depending on the style's SH_ComboBox_Popup hint, we use a different default delegate.
but we do not change the delegate is the combobox use a custom delegate, unless force is set to true.
Definition at line 1758 of file qcombobox.cpp.
References opt, and QStyle::SH_ComboBox_Popup.
Referenced by viewContainer().
void QComboBoxPrivate::updateFocusPolicy | ( | ) |
Definition at line 1212 of file qcombobox.cpp.
References Qt::TabFocus, and Qt::WheelFocus.
bool QComboBoxPrivate::updateHoverControl | ( | const QPoint & | pos | ) |
Definition at line 291 of file qcombobox.cpp.
References hoverControl, hoverRect, newHoverControl(), pos, and Qt::WA_Hover.
void QComboBoxPrivate::updateIndexBeforeChange | ( | ) |
Definition at line 1150 of file qcombobox.cpp.
References currentIndex, indexBeforeChange, and QPersistentModelIndex::row().
Referenced by connectModel().
void QComboBoxPrivate::updateLayoutDirection | ( | ) |
Definition at line 406 of file qcombobox.cpp.
References container, dir, lineEdit, opt, QWidget::setLayoutDirection(), and QStyle::SH_ComboBox_LayoutDirection.
Referenced by viewContainer().
void QComboBoxPrivate::updateLineEditGeometry | ( | ) |
Definition at line 1262 of file qcombobox.cpp.
References QStyle::alignedRect(), Qt::AlignRight, QStyle::CC_ComboBox, lineEdit, opt, QStyle::SC_ComboBoxEditField, and QWidget::setGeometry().
Referenced by dataChanged(), modelReset(), rowsRemoved(), and setCurrentIndex().
|
inline |
Definition at line 332 of file qcombobox_p.h.
Referenced by QComboBox::setLineEdit().
void QComboBoxPrivate::updateViewContainerPaletteAndOpacity | ( | ) |
Definition at line 1189 of file qcombobox.cpp.
References container, QWidget::ensurePolished(), lineEdit, menu, opt, QWidget::palette, QWidget::setPalette(), QWidget::setWindowOpacity(), QStyle::SH_ComboBox_Popup, and QWidget::windowOpacity.
Referenced by viewContainer().
QComboBoxPrivateContainer * QComboBoxPrivate::viewContainer | ( | ) |
Definition at line 1058 of file qcombobox.cpp.
References QObjectPrivate::connect(), connectModel(), container, QItemSelectionModel::currentChanged(), disconnectModel(), Qt::ElideMiddle, emitHighlighted(), QComboBoxPrivateContainer::itemSelected(), itemSelected(), QComboBoxPrivateContainer::itemView(), model, QComboBoxPrivateContainer::resetButton(), resetButton(), QAbstractItemView::selectionModel(), QAbstractItemView::setModel(), QAbstractItemView::setTextElideMode(), updateDelegate(), updateLayoutDirection(), and updateViewContainerPaletteAndOpacity().
Referenced by adjustComboBoxSize(), keyboardSearchString(), and showPopupFromMouseEvent().
QStyle::StateFlag QComboBoxPrivate::arrowState = QStyle::State_None |
Definition at line 397 of file qcombobox_p.h.
Referenced by updateArrow().
QPointer<QComboBoxPrivateContainer> QComboBoxPrivate::container |
Definition at line 383 of file qcombobox_p.h.
Referenced by adjustComboBoxSize(), doHidePopup(), rowsInserted(), showPopupFromMouseEvent(), updateLayoutDirection(), updateViewContainerPaletteAndOpacity(), and viewContainer().
QPersistentModelIndex QComboBoxPrivate::currentIndex |
Definition at line 387 of file qcombobox_p.h.
Referenced by dataChanged(), editingFinished(), itemSelected(), keyboardSearchString(), QComboBox::keyPressEvent(), returnPressed(), rowsInserted(), rowsRemoved(), setCurrentIndex(), QComboBox::setModelColumn(), and updateIndexBeforeChange().
QString QComboBoxPrivate::currentText |
Definition at line 390 of file qcombobox_p.h.
Referenced by updateCurrentText().
bool QComboBoxPrivate::duplicatesEnabled |
Definition at line 406 of file qcombobox_p.h.
Referenced by returnPressed().
bool QComboBoxPrivate::frame |
Definition at line 407 of file qcombobox_p.h.
bool QComboBoxPrivate::hidingPopup |
Definition at line 409 of file qcombobox_p.h.
QStyle::SubControl QComboBoxPrivate::hoverControl = QStyle::SC_None |
Definition at line 398 of file qcombobox_p.h.
Referenced by newHoverControl(), and updateHoverControl().
QRect QComboBoxPrivate::hoverRect |
Definition at line 391 of file qcombobox_p.h.
Referenced by newHoverControl(), and updateHoverControl().
QSize QComboBoxPrivate::iconSize |
Definition at line 392 of file qcombobox_p.h.
Referenced by recomputeSizeHint().
int QComboBoxPrivate::indexBeforeChange = -1 |
Definition at line 400 of file qcombobox_p.h.
Referenced by rowsInserted(), rowsRemoved(), setCurrentIndex(), and updateIndexBeforeChange().
bool QComboBoxPrivate::inserting |
Definition at line 408 of file qcombobox_p.h.
Referenced by dataChanged(), and rowsInserted().
QComboBox::InsertPolicy QComboBoxPrivate::insertPolicy = QComboBox::InsertAtBottom |
Definition at line 395 of file qcombobox_p.h.
Referenced by returnPressed().
Definition at line 382 of file qcombobox_p.h.
Referenced by dataChanged(), editingFinished(), emitCurrentIndexChanged(), itemSelected(), matchFlags(), modelReset(), returnPressed(), rowsRemoved(), setCurrentIndex(), showPopupFromMouseEvent(), updateLayoutDirection(), updateLineEditGeometry(), and updateViewContainerPaletteAndOpacity().
int QComboBoxPrivate::maxCount = (std::numeric_limits<int>::max)() |
Definition at line 402 of file qcombobox_p.h.
int QComboBoxPrivate::maxVisibleItems = 10 |
Definition at line 401 of file qcombobox_p.h.
int QComboBoxPrivate::minimumContentsLength = 0 |
Definition at line 399 of file qcombobox_p.h.
Referenced by recomputeSizeHint().
|
mutable |
Definition at line 393 of file qcombobox_p.h.
QAbstractItemModel* QComboBoxPrivate::model = nullptr |
Definition at line 381 of file qcombobox_p.h.
Referenced by connectModel(), itemIcon(), itemText(), modelDestroyed(), rowsRemoved(), setCurrentIndex(), trySetValidIndex(), and viewContainer().
int QComboBoxPrivate::modelColumn = 0 |
Definition at line 403 of file qcombobox_p.h.
Referenced by setCurrentIndex(), and trySetValidIndex().
std::array<QMetaObject::Connection, 8> QComboBoxPrivate::modelConnections |
Definition at line 380 of file qcombobox_p.h.
Referenced by connectModel(), and disconnectModel().
int QComboBoxPrivate::placeholderIndex = -1 |
Definition at line 404 of file qcombobox_p.h.
QString QComboBoxPrivate::placeholderText |
Definition at line 389 of file qcombobox_p.h.
Referenced by recomputeSizeHint(), and rowsInserted().
QPersistentModelIndex QComboBoxPrivate::root |
Definition at line 388 of file qcombobox_p.h.
Referenced by dataChanged(), rowsInserted(), rowsRemoved(), and trySetValidIndex().
bool QComboBoxPrivate::shownOnce |
Definition at line 405 of file qcombobox_p.h.
QComboBox::SizeAdjustPolicy QComboBoxPrivate::sizeAdjustPolicy = QComboBox::AdjustToContentsOnFirstShow |
Definition at line 396 of file qcombobox_p.h.
Referenced by dataChanged(), modelChanged(), recomputeSizeHint(), rowsInserted(), and rowsRemoved().
|
mutable |
Definition at line 394 of file qcombobox_p.h.
Referenced by dataChanged(), modelChanged(), recomputeSizeHint(), rowsInserted(), and rowsRemoved().