42 #ifndef QTABLEWIDGET_H 43 #define QTABLEWIDGET_H 45 #include <QtGui/qtableview.h> 46 #include <QtCore/qvariant.h> 47 #include <QtCore/qvector.h> 56 #ifndef QT_NO_TABLEWIDGET 66 inline int topRow()
const {
return top; }
70 inline int rowCount()
const {
return bottom - top + 1; }
98 inline int row()
const;
99 inline int column()
const;
101 inline void setSelected(
bool select);
102 inline bool isSelected()
const;
104 inline Qt::ItemFlags
flags()
const {
return itemFlags; }
105 void setFlags(Qt::ItemFlags
flags);
109 inline void setText(
const QString &text);
113 inline void setIcon(
const QIcon &icon);
117 inline void setStatusTip(
const QString &statusTip);
119 #ifndef QT_NO_TOOLTIP 122 inline void setToolTip(
const QString &toolTip);
125 #ifndef QT_NO_WHATSTHIS 128 inline void setWhatsThis(
const QString &whatsThis);
133 inline void setFont(
const QFont &font);
175 #ifndef QT_NO_DATASTREAM 181 inline int type()
const {
return rtti; }
200 #ifndef QT_NO_TOOLTIP 205 #ifndef QT_NO_WHATSTHIS 213 #ifndef QT_NO_DATASTREAM 252 void setVerticalHeaderLabels(
const QStringList &labels);
253 void setHorizontalHeaderLabels(
const QStringList &labels);
255 int currentRow()
const;
256 int currentColumn()
const;
259 void setCurrentItem(
QTableWidgetItem *item, QItemSelectionModel::SelectionFlags command);
260 void setCurrentCell(
int row,
int column);
261 void setCurrentCell(
int row,
int column, QItemSelectionModel::SelectionFlags command);
271 QWidget *cellWidget(
int row,
int column)
const;
273 inline void removeCellWidget(
int row,
int column);
283 int visualRow(
int logicalRow)
const;
284 int visualColumn(
int logicalColumn)
const;
312 void itemSelectionChanged();
314 void cellPressed(
int row,
int column);
315 void cellClicked(
int row,
int column);
316 void cellDoubleClicked(
int row,
int column);
318 void cellActivated(
int row,
int column);
319 void cellEntered(
int row,
int column);
320 void cellChanged(
int row,
int column);
322 void currentCellChanged(
int currentRow,
int currentColumn,
int previousRow,
int previousColumn);
354 { setCellWidget(arow, acolumn, 0); }
357 {
return itemAt(
QPoint(ax, ay)); }
360 {
return (view ? view->row(
this) : -1); }
363 {
return (view ? view->column(
this) : -1); }
366 {
if (view) view->setItemSelected(
this, aselect); }
369 {
return (view ? view->isItemSelected(
this) :
false); }
371 #endif // QT_NO_TABLEWIDGET 377 #endif // QTABLEWIDGET_H The QVariant class acts like a union for the most common Qt data types.
The QColor class provides colors based on RGB, HSV or CMYK values.
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void openPersistentEditor(const QModelIndex &index)
Opens a persistent editor on the item at the given index.
bool removeRow(int row, const QModelIndex &parent=QModelIndex())
Removes the given row from the child items of the parent specified.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
void setItemPrototype(const QTableWidgetItem *item)
void setModel(QAbstractItemModel *model)
Reimplemented Function
const QTableWidgetItem * itemPrototype() const
static void clear(QVariant::Private *d)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Reimplemented Function
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
The QString class provides a Unicode character string.
void setItem(int row, int column, QTableWidgetItem *item)
QTableWidgetItem * takeVerticalHeaderItem(int section)
bool operator<(int priority, const QPair< QRunnable *, int > &p)
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void dropEvent(QDropEvent *event)
This function is called with the given event when a drop event occurs over the widget.
QTableWidgetItem * item(int row, int column) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool insertRow(int row, const QModelIndex &parent=QModelIndex())
Inserts a single row before the given row in the child items of the parent specified.
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
The QStringList class provides a list of strings.
static const char * data(const QByteArray &arr)
Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
The QMimeData class provides a container for data that records information about its MIME type...
The QTableView class provides a default model/view implementation of a table view.
QTableWidgetItem * verticalHeaderItem(int section)
The QAbstractItemModel class provides the abstract interface for item model classes.
bool removeColumn(int column, const QModelIndex &parent=QModelIndex())
Removes the given column from the child items of the parent specified.
void setColumnCount(int columns)
The QBrush class defines the fill pattern of shapes drawn by QPainter.
bool insertColumn(int column, const QModelIndex &parent=QModelIndex())
Inserts a single column before the given column in the child items of the parent specified.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
The QFont class specifies a font used for drawing text.
void setRowCount(int rows)
QObject * parent() const
Returns a pointer to the parent object.
The QPoint class defines a point in the plane using integer precision.
void setHorizontalHeaderItem(int section, QTableWidgetItem *item)
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns for the children of the given parent.
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
QTableWidgetItem * horizontalHeaderItem(int section)
T qvariant_cast(const QVariant &)
QTableWidgetItem * takeHorizontalHeaderItem(int section)
void setSortingEnabled(bool enable)
If enabled true enables sorting for the table and immediately trigger a call to sortByColumn() with t...
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under the given parent.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
QStringList mimeTypes() const
Returns a list of MIME types that can be used to describe a list of model indexes.
The QDataStream class provides serialization of binary data to a QIODevice.
void closePersistentEditor(const QModelIndex &index)
Closes the persistent editor for the item at the given index.
bool event(QEvent *event)
Reimplemented Function
The QEvent class is the base class of all event classes.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
bool isSortingEnabled() const
QTableWidgetItem * takeItem(int row, int column)
The QList class is a template class that provides lists.
void setVerticalHeaderItem(int section, QTableWidgetItem *item)
void itemChanged(QTableWidgetItem *item)
The QIcon class provides scalable icons in different modes and states.