11#include "private/qobject_p.h"
12#include "private/qabstractitemmodel_p.h"
13#include <QtCore/qpointer.h>
65 w->installEventFilter(newDelegate);
119 if (
m.widget.isNull())
122 if (!
m.currentIndex.isValid())
127 if (
m.property.isEmpty())
137 if (
m.widget.isNull())
141 if (
m.property.isEmpty())
156 return idx.
row() >= topLeft.
row() && idx.
row() <= bottomRight.
row()
161 const QModelIndex &bottomRight,
const QList<int> &)
198 w->focusPreviousChild();
318 d->disconnectModel();
319 d->disconnectDelegate();
335 d->disconnectModel();
342 d->modelConnections = {
383 d->disconnectDelegate();
385 d->delegate = delegate;
388 d->delegateConnections = {
396 d->flipEventFilters(oldDelegate, delegate);
479 d->widgetMap.push_back({
widget, section,
d->indexAt(section), propertyName});
492 int idx =
d->findWidget(
widget);
496 d->widgetMap.erase(
d->widgetMap.begin() + idx);
510 int idx =
d->findWidget(
widget);
514 return d->widgetMap[idx].section;
529 int idx =
d->findWidget(
widget);
532 const auto &
m =
d->widgetMap[idx];
533 if (
m.property.isEmpty())
534 return m.widget->metaObject()->userProperty().name();
549 for (
auto &e :
d->widgetMap) {
550 if (e.section == section)
588 for (
auto &e :
d->widgetMap) {
593 return d->model->submit();
672 if (index < 0 || index >=
d->itemCount())
675 ?
d->model->index(
index, 0,
d->rootIndex)
676 :
d->model->index(0,
index,
d->rootIndex);
685 return d->currentIdx();
712 ||
index.model() !=
d->model
713 ||
index.parent() !=
d->rootIndex)
728 decltype(
d->widgetMap)
copy;
729 d->widgetMap.swap(
copy);
732 it->widget->removeEventFilter(
d->delegate);
784 return d->orientation;
807 return d->submitPolicy;
812#include "moc_qdatawidgetmapper.cpp"
The QAbstractItemDelegate class is used to display and edit data items from a model.
void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint=NoHint)
This signal is emitted when the user has finished editing an item using the specified editor.
void commitData(QWidget *editor)
This signal must be emitted when the editor widget has completed editing the data,...
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
Sets the contents of the given editor to the data for the item at the given index.
EndEditHint
This enum describes the different hints that the delegate can give to the model and view components t...
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Sets the data for the item at the given index in the model to the contents of the given editor.
static QAbstractItemModel * staticEmptyModel()
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
This signal is emitted whenever the data in an existing item changes.
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
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.
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
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.
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr int column() const noexcept
Returns the column this model index refers to.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void removeEventFilter(QObject *obj)
Removes an event filter object obj from this object.
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
int column() const
Returns the column this persistent model index refers to.
int row() const
Returns the row this persistent model index refers to.
The QStyledItemDelegate class provides display and editing facilities for data items from a model.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
DBusConnection * connection
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLfloat GLfloat GLfloat w
[0]
GLint GLint GLint GLint GLsizei GLsizei GLsizei GLboolean commit
GLdouble GLdouble GLdouble GLdouble q
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
QSqlQueryModel * model
[16]