title: Qt How to check state checkbox in QtableWidget
body: <p>Recently I found the way that checkbox places in the middle of QtableWidget item.
  However, I do not know how to check state whether or not button is clicked.
  Could you tell me how to check button state?</p>
  
  <p>here is what Ive found code:</p>
  
  <pre><code>QWidget *pWidget = new QWidget();
  QCheckBox *pCheckBox = new QCheckBox();
  QHBoxLayout *pLayout = new QHBoxLayout(pWidget);
  pCheckBox-&gt;setCheckState(Qt::Checked);
  pLayout-&gt;addWidget(pCheckBox);
  pLayout-&gt;setAlignment(Qt::AlignCenter);
  pLayout-&gt;setContentsMargins(0,0,0,0);
  pWidget-&gt;setLayout(pLayout);
  ui-&gt;tableWidget2-&gt;setCellWidget(2,2, pWidget);
  </code></pre>