Hello,
I got solved it. Signal selectionChanged is only fired after moving with the cursor keys to the table cell and pressing enter. But I don't want to have to press enter.
The solution was derive my own TableView class from QTableView
class GenericTableView : public QTableView
{
Q_OBJECT
public:
GenericTableView(QObject* parent = NULL);
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
signals:
void currentChangedSignal(QModelIndex, QModelIndex);
};
and overwrite currentchanged and sending a self defined signal where I react on
void GenericTableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
{
emit currentChangedSignal(current, previous);
}
Next problem was to use this derived class in the Qt From Designer. To solve it first you have to insert a normal QTableView and then do a right click on it and click "promote to" here you can specify that the element refers to yout own (in my case GenericTableView) TableView. And last but not least do another right right click and select "Change signals/slots" here you can add your self defined signal (in my case currentChangedSignal).
Now you can connect the signal with a slot on the common way by right cklick and select "Goto slot". Thats it.
Thanks everbody for your support.