I have a QTableView that I need to get the selectionChanged event from. I can't seem to get the connect working. I have:
MyWidget.h
...
protected slots:
 void slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected);
private:
 QTableView table;
...
MyWidget.cpp
...
 connect(
  tab开发者_如何转开发le->selectionModel(),
  SIGNAL(selectionChanged(const QItemSelection & selected, const QItemSelection & deselected)),
  this,
  SLOT(slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected))
 );
...
At runtime, I get "No such Signal" errors.
You need to remove the variable names from the SIGNAL and SLOT macros:
 connect(
  table->selectionModel(),
  SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
  SLOT(slotLoadTransaction(const QItemSelection &, const QItemSelection &))
 );
Connect is essentially looking at the function signature and the variable names confuse it.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论