title: QTableWidget Checkbox get state and location
body: <p>How to get state of all checkbox and get row and column of checked?
  Onclick PushButton function.</p>
  
  <pre><code>    QTableWidget *t = ui-&gt;tableWidget;
      t-&gt;setRowCount(2);
      t-&gt;setColumnCount(2);
  
      QStringList tableHeader;
      tableHeader&lt;&lt;"item01"&lt;&lt;"item02";
      t-&gt;setHorizontalHeaderLabels(tableHeader);
  
      for (int i = 0; i &lt; t-&gt;rowCount(); i++) {
          for (int j = 0; j &lt; t-&gt;columnCount(); j++) {
              QWidget *pWidget = new QWidget();
              QHBoxLayout *pLayout = new QHBoxLayout(pWidget);
              QCheckBox *pCheckBox = new QCheckBox();
              pLayout-&gt;setAlignment(Qt::AlignCenter);
              pLayout-&gt;setContentsMargins(0,0,0,0);
              pLayout-&gt;addWidget(pCheckBox);
              pWidget-&gt;setLayout(pLayout);
              t-&gt;setCellWidget(i, j, pWidget);
          }
      }
  </code></pre>
  
  <p>And when I clicked the button, I need get all selected elements with rows, columns of each. </p>
  
  <pre><code>void Widget::on_pushButton_clicked()
  {
  
      // Code here    
  
      // For example: Selected ["item01", 2]
  }
  </code></pre>