#include <QtGui>
int main(int argc, char *argv[])
{
qt->verticalHeader()->setVisible(false);
qt->setRowCount(75);
qt->setColumnCount(2);
qt->setSortingEnabled(false);
/*qt->setSortingEnabled(true);
qt->sortItems(0, Qt::AscendingOrder);*/
qt->setHorizontalHeaderItem(0, __colItem);
for(int i = 0; i < 75; i++){
qt->setItem(i, 0, ax[i]);
}
qt->sortItems(0, Qt::AscendingOrder);
qt->setSortingEnabled(true);
qt->show();
return app.exec();
}
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTableWidget* qt = new QTableWidget;
qt->verticalHeader()->setVisible(false);
qt->setRowCount(75);
qt->setColumnCount(2);
qt->setSortingEnabled(false);
/*qt->setSortingEnabled(true);
qt->sortItems(0, Qt::AscendingOrder);*/
QTableWidgetItem *__colItem = new QTableWidgetItem();
__colItem->setText(QApplication::translate("t", "test", 0, QApplication::UnicodeUTF8));
qt->setHorizontalHeaderItem(0, __colItem);
QTableWidgetItem* ax[75];
for(int i = 0; i < 75; i++){
ax[i] = new QTableWidgetItem(QString("Ebeeef%1").arg(i));
qt->setItem(i, 0, ax[i]);
qt->setCellWidget(ax[i]->row(), 0, new QPushButton(QString("Ebeeef%1").arg(i)));
}
qt->sortItems(0, Qt::AscendingOrder);
qt->setSortingEnabled(true);
qt->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks