// Сигналы для обновления панели инструментов при изменении в selectionModel() connect(recordview->selectionModel(), SIGNAL(currentChanged (const QModelIndex&, const QModelIndex&)), this, SLOT(tools_update(void))); connect(recordview->selectionModel(), SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)), this, SLOT(tools_update(void))); // Сигналы для обновления панели инструментов connect(recordview, SIGNAL(activated(const QModelIndex &)), this, SLOT(tools_update(void))); connect(recordview, SIGNAL(clicked(const QModelIndex &)), this, SLOT(tools_update(void))); connect(recordview, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(tools_update(void))); connect(recordview, SIGNAL(entered(const QModelIndex &)), this, SLOT(tools_update(void))); connect(recordview, SIGNAL(pressed(const QModelIndex &)), this, SLOT(tools_update(void)));
class MyWindow ...{ QBasicTimer updateTimer_;};void MyWindow::tools_update(){ if ( !updateTimer_.isActive() ) updateTimer_.start( 0, this );}void MyWindow::timerEvent( QTimerEvent * e ){ if ( e->timerId() == updateTimer_.timerId() ) { updateTimer_.stop(); // real update goes here return; }}