you can use rowCount () and columnCount(); two for and add the item to a list.
int iColumns = my_table.columnCount();
int iRows = my_table.rowCount();
QList<QWidgetItem*> myList;
for(int i = 0; i < iRows; ++i)
{
for(int j = 0; j < iColumn; ++j)
{
myList.append(pWigdet);
pWidget = 0;
}
}
int iColumns = my_table.columnCount();
int iRows = my_table.rowCount();
QList<QWidgetItem*> myList;
for(int i = 0; i < iRows; ++i)
{
for(int j = 0; j < iColumn; ++j)
{
QTableWidgetItem* pWidget = my_table->item(i, j);
myList.append(pWigdet);
pWidget = 0;
}
}
To copy to clipboard, switch view to plain text mode
I don't really understand what "const QMimeData * data" is about and why i can't just get a full QList as easily as the selectedItems() method does.
Well, you can call "items" without attributes.
QList<QTableWidgetItem *> allCells = myTable->items( );
QList<QTableWidgetItem *> allCells = myTable->items( );
To copy to clipboard, switch view to plain text mode
QT Assistant says "If the object was not created by a QTreeWidget in the same process, the list is empty.", maybe that's why the function is not working in your code. Anyway, the first solution should work.
Bookmarks