Hello,
@kwisp Thanks, this was fast.
@wysota
I changed the 'findfiles' example from the distribution (examples/dialogs/findfiles) to enable sorting (you know: click on the header of a column and the table gets sorted on the content of this particular column).
In the original version file sizes showed up as expected.
In the modified version most (almost all) files have no size any more and the one(s) that do have a size appear to have a wrong value.
The change I made was adding one line into the creation code for the table (see below).
void Window::createFilesTable()
{
labels << tr("File Name") << tr("Size");
filesTable->setHorizontalHeaderLabels(labels);
filesTable
->horizontalHeader
()->setResizeMode
(0,
QHeaderView::Stretch);
filesTable->verticalHeader()->hide();
filesTable->setShowGrid(false);
// This line added
filesTable->setSortingEnabled(true);
connect(filesTable, SIGNAL(cellActivated(int, int)),
this, SLOT(openFileOfItem(int, int)));
}
void Window::createFilesTable()
{
filesTable = new QTableWidget(0, 2);
filesTable->setSelectionBehavior(QAbstractItemView::SelectRows);
QStringList labels;
labels << tr("File Name") << tr("Size");
filesTable->setHorizontalHeaderLabels(labels);
filesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
filesTable->verticalHeader()->hide();
filesTable->setShowGrid(false);
// This line added
filesTable->setSortingEnabled(true);
connect(filesTable, SIGNAL(cellActivated(int, int)),
this, SLOT(openFileOfItem(int, int)));
}
To copy to clipboard, switch view to plain text mode
This is on Windows XP using the stand-alone Qt Creator 1.2.1 (based on Qt 4.5.2).
I'll go and report it.
Best regards
Helmut Giese
Bookmarks