本文整理汇总了C++中QCPGraph::setScatterSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QCPGraph::setScatterSize方法的具体用法?C++ QCPGraph::setScatterSize怎么用?C++ QCPGraph::setScatterSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCPGraph
的用法示例。
在下文中一共展示了QCPGraph::setScatterSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onPacketParsed
void MainWindow::onPacketParsed(Packet packet)
{
_packetsReceivedCount++;
if(!packet.isCrcValid())
{
_crcErrorCount++;
}
QString sourceId = ByteArrayUtils::toString(packet.sourceId()).replace(" 0x", "").replace("0x", "");
if(!_rssValues.contains(sourceId))
{
_rssValues.insert(sourceId, QVector<double>());
_timestampValues.insert(sourceId, QVector<double>());
QCPGraph* deviceGraph = ui->plotWidget->addGraph();
deviceGraph->setScatterStyle(QCP::ssDisc);
deviceGraph->setScatterSize(5);
deviceGraph->setName(sourceId);
ensureDistinctColors();
}
_rssValues[sourceId].append(packet.rss());
_timestampValues[sourceId].append(packet.timestamp().toTime_t());
updatePlot();
updateStatus();
}
示例2: updatePlot
//.........这里部分代码省略.........
case(FIELD4):
field = Global::getInstance()->getExtraField(3);
ui->customPlot->yAxis->setLabel(field.axisLabel);
break;
default:
assert(false);
break;
}
//
bool buildGlobalPlot = (selectionGraph->isEmpty());
set<Group> groups;
map<Group,vector<SelectionGraphNode*> > mapGroupToNodes;
map<Group,vector<SelectionGraphEdge*> > mapGroupToEdges;
set<Group>::iterator groupIterator;
selectionGraph->groupNodesAndEdgeByColor(groups,mapGroupToNodes,mapGroupToEdges);
map<Group,QCPGraph*> mapGroupGraph;
//
set<Group> notEmptyGroups;
map<Group,vector<SelectionGraphNode*> > tempMapGroupToNodes;
if(buildGlobalPlot){
QPen pen;
QCPGraph* graph = ui->customPlot->addGraph();
QColor color(0,0,0);
mapGroupGraph[Group(color)] = graph;
color.setAlphaF(0.05);
pen.setColor(color);
graph->setPen(pen);
graph->setLineStyle(QCPGraph::lsNone);
graph->setScatterStyle(QCP::ssDisc);
graph->setScatterSize(10);
}
else{
//
for(groupIterator = groups.begin() ; groupIterator != groups.end() ; ++groupIterator){
vector<SelectionGraphNode*> &groupNodes = mapGroupToNodes[*groupIterator];
vector<SelectionGraphNode*> validGroupNodes;
int numGroupNodes = groupNodes.size();
for(int i = 0 ; i < numGroupNodes ; ++i){
SelectionGraphNode* node = groupNodes.at(i);
if(node->inDegree() + node->outDegree() == 0)
validGroupNodes.push_back(node);
}
vector<SelectionGraphEdge*> &groupEdges = mapGroupToEdges[*groupIterator];
if(groupEdges.size() + validGroupNodes.size() > 0){
notEmptyGroups.insert(*groupIterator);
tempMapGroupToNodes[*groupIterator] = validGroupNodes;
}
}
groups.clear();
groups = notEmptyGroups;
mapGroupToNodes.clear();
mapGroupToNodes = tempMapGroupToNodes;
//
for(groupIterator = groups.begin() ; groupIterator != groups.end() ; ++groupIterator){
QPen pen;
QCPGraph* graph = ui->customPlot->addGraph();
graph->setLineStyle(QCPGraph::lsNone);
graph->setScatterStyle(QCP::ssDisc);