Cannot connect (null)::selectionChanged to QTableView

前端 未结 1 927
小蘑菇
小蘑菇 2021-01-18 07:10

I have the following promoted QTableView:

class QRightClickableTableView : public QTableView {
  Q_OBJECT
public:
  explicit QRightClickableTableView(QWidget         


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-18 07:52

    The signal slot connection has failed since table->selectionModel() has returned null.

    If you set the model for your table before making signal slot connection, table->selectionModel() will return a valid model, making the signal slot connection successful.

    0 讨论(0)
提交回复
热议问题