Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.1
-
None
Description
The signal currentCellChanged/itemSelectionChanged aren't trigger in same order by mouse click and key stroke.
Test code.
#include <QVBoxLayout>
#include <QMainWindow>
#include <QItemDelegate>
#include <QObject>
#include <QEvent>
#include <QWidget>
#include <QKeyEvent>
#include <QMetaObject>
#include <QStyleOptionViewItem>
#include <QModelIndex>
#include <QAbstractItemDelegate>
#include <QMap>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QApplication>
#include <QMessageBox>
static int ROWS = 10;
static int COLS = 2;
class Table : public QTableWidget
{
Q_OBJECT
public:
Table(QWidget *parent = 0)
: QTableWidget(ROWS, COLS, parent)
{
for (int i=0; i<rowCount(); ++i) {
for (int j=0; j<columnCount(); ++j)
}
connect(this, SIGNAL(currentCellChanged(int, int, int, int)),
this, SLOT(on_currentCellChanged(int, int, int, int)));
connect(this, SIGNAL(itemSelectionChanged()),
this, SLOT(on_itemSelectionChanged()));
}
public slots:
void on_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn)
void on_itemSelectionChanged()
{ QMessageBox::information(this, "Test", "itemSelectionChanged"); }};
#include "main.moc"
int main(int argc, char **argv)
{
QApplication a(argc, argv);
Table w;
w.show();
return a.exec();
}