CTableWidget
::CTableWidget(QWidget *parent,
int nRows,
int nCols
) :{
this->setRowCount(nRows);
this->setColumnCount(nCols);
connect(this, SIGNAL(cellActivated(int,int)), this, SLOT(getRowCol(int,int)));
qDebug("Inside Constructor");
}
void CTableWidget::getRowCol(int rowID, int columnID) // This is a slot
{
qDebug("Inside getRowCol() slot"); // This debug msg isn't getting printed
QString objName
= this
->objectName
();
emit sigObjRowCol(objName, rowID, columnID);
}
CTableWidget::CTableWidget(QWidget *parent, int nRows, int nCols) :
QTableWidget(parent)
{
this->setRowCount(nRows);
this->setColumnCount(nCols);
connect(this, SIGNAL(cellActivated(int,int)), this, SLOT(getRowCol(int,int)));
qDebug("Inside Constructor");
}
void CTableWidget::getRowCol(int rowID, int columnID) // This is a slot
{
qDebug("Inside getRowCol() slot"); // This debug msg isn't getting printed
QString objName = this->objectName();
emit sigObjRowCol(objName, rowID, columnID);
}
To copy to clipboard, switch view to plain text mode
To find out which QTableWidget is clicked, I'm assigning a object name & using string compare.
vulnReports = new CTableWidget(0, 20, 3);
vulnReports->setObjectName("vulnReports");
complReports = new CTableWidget(0, 20, 3);
complReports->setObjectName("complReports");
patchReports = new CTableWidget(0, 10, 3);
patchReports->setObjectName("patchReports");
connect(vulnReports,
SIGNAL(sigObjRowCol
(QString,
int,
int)),
this,
SLOT(remediateIndiv
(QString,
int,
int)));
connect(complReports,
SIGNAL(sigObjRowCol
(QString,
int,
int)),
this,
SLOT(remediateIndiv
(QString,
int,
int)));
connect(patchReports,
SIGNAL(sigObjRowCol
(QString,
int,
int)),
this,
SLOT(remediateIndiv
(QString,
int,
int)));
vulnReports = new CTableWidget(0, 20, 3);
vulnReports->setObjectName("vulnReports");
complReports = new CTableWidget(0, 20, 3);
complReports->setObjectName("complReports");
patchReports = new CTableWidget(0, 10, 3);
patchReports->setObjectName("patchReports");
connect(vulnReports, SIGNAL(sigObjRowCol(QString,int,int)), this, SLOT(remediateIndiv(QString,int,int)));
connect(complReports, SIGNAL(sigObjRowCol(QString,int,int)), this, SLOT(remediateIndiv(QString,int,int)));
connect(patchReports, SIGNAL(sigObjRowCol(QString,int,int)), this, SLOT(remediateIndiv(QString,int,int)));
To copy to clipboard, switch view to plain text mode
Am I missing something ?
Bookmarks