44 #ifndef QT_NO_DATAWIDGETMAPPER 50 #include "private/qobject_p.h" 51 #include "private/qabstractitemmodel_p.h" 95 for (
int i = 0; i <
widgetMap.count(); ++i) {
135 for (
int i = 0; i <
widgetMap.count(); ++i) {
174 for (
int i = 0; i <
widgetMap.count(); ++i)
181 return idx.
row() >= topLeft.
row() && idx.
row() <= bottomRight.
row()
190 for (
int i = 0; i <
widgetMap.count(); ++i) {
219 static_cast<QFocusHelper *
>(w)->focusNextPrevChild(next);
374 if (
d->model == model)
381 SLOT(_q_modelDestroyed()));
430 d->delegate = delegate;
438 d->flipEventFilters(oldDelegate, delegate);
537 int idx =
d->findWidget(widget);
541 d->widgetMap.removeAt(idx);
555 int idx =
d->findWidget(widget);
559 return d->widgetMap.at(idx).section;
577 int idx =
d->findWidget(widget);
597 for (
int i = 0; i <
d->widgetMap.count(); ++i) {
598 if (
d->widgetMap.at(i).section == section)
599 return d->widgetMap.at(i).widget;
636 for (
int i = 0; i <
d->widgetMap.count(); ++i) {
642 return d->model->submit();
724 if (index < 0 || index >=
d->itemCount())
727 ?
d->model->index(index, 0,
d->rootIndex)
728 :
d->model->index(0, index,
d->rootIndex);
737 return d->currentIdx();
762 || index.
model() !=
d->model
763 || index.
parent() !=
d->rootIndex)
778 while (!
d->widgetMap.isEmpty()) {
779 QWidget *w =
d->widgetMap.takeLast().widget;
826 if (
d->orientation == orientation)
836 return d->orientation;
852 if (policy ==
d->submitPolicy)
856 d->submitPolicy = policy;
862 return d->submitPolicy;
867 #include "moc_qdatawidgetmapper.cpp" 869 #endif // QT_NO_DATAWIDGETMAPPER
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
The QAbstractItemDelegate class is used to display and edit data items from a model.
int row() const
Returns the row this persistent model index refers to.
static QAbstractItemModel * staticEmptyModel()
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
int column() const
Returns the column this persistent model index refers to.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
The QByteArray class provides an array of bytes.
void removeEventFilter(QObject *)
Removes an event filter object obj from this object.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
The QObject class is the base class of all Qt objects.
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 void focusNextPrevChild(QWidget *w, bool next)
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
virtual 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...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
int row() const
Returns the row this model index refers to.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool focusNextPrevChild(bool next)
Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget, or false if it can't.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QAbstractItemModel class provides the abstract interface for item model classes.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
#define Q_DECLARE_PUBLIC(Class)
The QPersistentModelIndex class is used to locate data in a data model.
The QItemDelegate class provides display and editing facilities for data items from a model...
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
The QModelIndex class is used to locate data in a data model.
EndEditHint
This enum describes the different hints that the delegate can give to the model and view components t...
QVariant property(const char *name) const
Returns the value of the object's name property.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
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.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
bool isValid() const
Returns true if this persistent model index is valid; otherwise returns false.