title: How to get current row of QTableWidget if I clicked on its child?
body: <p>I have created a <code>QTableWidget</code> in which I've used <code>setCellWidget(QWidget*)</code>. I've set <code>QLineEdit</code> in the cell widget. I've also created a delete button and clicking that button sends a signal to the function <code>deleteRow</code>. I've also used a function <code>currentRow()</code> to get the current row, but it returns <code>-1</code> because of the <code>QLineEdit</code>. The code snippet is below.</p>
  
  <pre><code>void createTable() {
      m_table = new QTableWidget(QDialog); //member variable
      for (int i = 0; i &lt; 3; i++)
      {
          QLineEdit *lineEdit = new QLineEdit(m_table);
          m_table-&gt;setCellWidget(i, 0, lineEdit);
      }
      QPushButton *deleteBut = new QPushButton(QDiaolg);
      connect(deleteBut, SIGNAL(clicked()), QDialog, SLOT(editRow()));
  }
  
  editRow() {
      int row = m_table-&gt;currentRow(); // This gives -1
      m_table-&gt;remove(row);
  }
  </code></pre>
  
  <p>In above scenario I click in the <code>QLineEdit</code> and then click on the button delete. Please help me out with a solution.</p>