本文整理汇总了C++中QTableWidgetItem::tableWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QTableWidgetItem::tableWidget方法的具体用法?C++ QTableWidgetItem::tableWidget怎么用?C++ QTableWidgetItem::tableWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTableWidgetItem
的用法示例。
在下文中一共展示了QTableWidgetItem::tableWidget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventCallback
static void eventCallback(struct event_handler_args args)
{
CHNODE *pNode = (CHNODE *)ca_puser(args.chid);
AttachChannelAccess *pacacc = (AttachChannelAccess *)pNode->acacc;
pNode->dbfType = ca_field_type(pNode->ch_id);
QString pvname = ca_name(args.chid);
QString strvalue;
unsigned int chindex = pNode->chindex;
//qDebug("Event Callback...:PVName(%s)", pvname.toStdString().c_str());
if( args.status != ECA_NORMAL )
{
printChidInfo(args.chid,"eventCallback");
}
else
{
QString objName = pNode->objname;
if(objName.contains("CATableList", Qt::CaseInsensitive) == true)
{
struct dbr_time_string *pdata = (struct dbr_time_string*)args.dbr;
QTableWidgetItem *pItem = pNode->pItem;
strvalue = QString(pdata->value);
pItem->setText(strvalue);
CATableList *pTable = (CATableList*)pItem->tableWidget();
pItem->setStatusTip(QString("PVname : ").append(pvname).append(QString(", Value: ")).append(strvalue));
pTable->TableUpdate();
return;
};
//++leesi
switch(pNode->dbrequest)
{
//case DBR_GR_CHAR:
case DBR_TIME_STRING:
{
struct dbr_time_string *pdata = (struct dbr_time_string*)args.dbr;
strvalue = QString(pdata->value);
pacacc->UpdateObj(pNode->objname, strvalue, pdata->severity);
}
break;
case DBR_GR_DOUBLE:
default:
{
struct dbr_gr_double* pdata = (struct dbr_gr_double*)args.dbr;
if(objName.contains("CAPopUp", Qt::CaseInsensitive) == true)
qDebug("PVName: %s, Value:%f", pvname.toStdString().c_str(), pdata->value);
#if 0
//for test,,,
static int count = 0;
qDebug("CAMon Value:%f, count(%d)",pdata->value, count++);
#endif
pacacc->UpdateObj(pNode->objname, pdata->value, pdata->severity, pdata->precision);
}
break;
};
};
};
示例2: songChanged
void MPConfig::songChanged(int flags)
{
// Is it simply a midi controller value adjustment? Forget it.
if (flags == SC_MIDI_CONTROLLER)
return;
// Get currently selected index...
int no = -1;
QTableWidgetItem* sitem = mdevView->currentItem();
if (sitem)
{
QString id = sitem->tableWidget()->item(sitem->row(), DEVCOL_NO)->text();
no = atoi(id.toLatin1().constData()) - 1;
if (no < 0 || no >= kMaxMidiPorts)
no = -1;
}
sitem = 0;
for (int i = kMaxMidiPorts - 1; i >= 0; --i)
{
mdevView->blockSignals(true); // otherwise itemChanged() is triggered and bad things happen.
MidiPort* port = &midiPorts[i];
MidiDevice* dev = port->device();
QString s;
s.setNum(i + 1);
QTableWidgetItem* itemno = mdevView->item(i, DEVCOL_NO);
QTableWidgetItem* itemstate = mdevView->item(i, DEVCOL_STATE);
itemstate->setText(port->state());
QTableWidgetItem* iteminstr = mdevView->item(i, DEVCOL_INSTR);
QString instrumentName = port->instrument() ? port->instrument()->iname() : tr("<unknown>");
iteminstr->setText(instrumentName);
iteminstr->setToolTip(instrumentName);
QTableWidgetItem* itemname = mdevView->item(i, DEVCOL_NAME);
QTableWidgetItem* itemgui = mdevView->item(i, DEVCOL_GUI);
QTableWidgetItem* itemfb = mdevView->item(i, DEVCOL_CACHE_NRPN);
QTableWidgetItem* itemrec = mdevView->item(i, DEVCOL_REC);
QTableWidgetItem* itemplay = mdevView->item(i, DEVCOL_PLAY);
QTableWidgetItem* itemout = mdevView->item(i, DEVCOL_OUTROUTES);
QTableWidgetItem* itemin = mdevView->item(i, DEVCOL_INROUTES);
QTableWidgetItem* itemdefin = mdevView->item(i, DEVCOL_DEF_IN_CHANS);
itemdefin->setText(bitmap2String(port->defaultInChannels()));
QTableWidgetItem* itemdefout = mdevView->item(i, DEVCOL_DEF_OUT_CHANS);
itemdefout->setText(bitmap2String(port->defaultOutChannels()));
mdevView->blockSignals(false);
if (dev)
{
itemname->setText(dev->name());
itemname->setToolTip(dev->name());
// Is it a Jack midi device? Allow renaming.
//if(dynamic_cast<MidiJackDevice*>(dev))
if (dev->deviceType() == MidiDevice::JACK_MIDI)
itemname->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
if (dev->rwFlags() & 0x2)
{
itemrec->setIcon(dev->openFlags() & 2 ? QIcon(*dotIcon) : QIcon(*dothIcon));
}
else
{
itemrec->setIcon(QIcon(QPixmap()));
}
if (dev->rwFlags() & 0x1)
{
itemplay->setIcon(dev->openFlags() & 1 ? QIcon(*dotIcon) : QIcon(*dothIcon));
}
else
itemplay->setIcon(QIcon(QPixmap()));
itemfb->setIcon(dev->cacheNRPN() ? QIcon(*dotIcon) : QIcon(*dothIcon));
}
else
{
itemname->setText(tr("<none>"));
itemname->setToolTip("");
itemgui->setIcon(QIcon(*dothIcon));
itemrec->setIcon(QIcon(QPixmap()));
itemplay->setIcon(QIcon(QPixmap()));
itemfb->setIcon(QIcon(QPixmap()));
}
// falkTX, we don't want this in the connections manager
//if (port->hasGui())
//{
// itemgui->setIcon(port->guiVisible() ? QIcon(*dotIcon) : QIcon(*dothIcon));
//}
//else
//{
itemgui->setIcon(QIcon(QPixmap()));
//}
iteminstr->setIcon(QIcon(*buttondownIcon));
itemname->setIcon(QIcon(*buttondownIcon));
//if(dev && dynamic_cast<MidiJackDevice*>(dev))
if (dev && dev->deviceType() == MidiDevice::JACK_MIDI)
{
//item->setPixmap(DEVCOL_ROUTES, *buttondownIcon);
//item->setText(DEVCOL_ROUTES, tr("routes"));
//.........这里部分代码省略.........
示例3: tableWidget
int TableWidgetItem::tableWidget( lua_State * L )// const * QTableWidget
{
QTableWidgetItem* lhs = ValueInstaller2<QTableWidgetItem>::check( L, 1 );
ObjectPeer::pushPeer( L, lhs->tableWidget(), true );
return 1;
}