示例#1
0
int netanim::AnimatorScene::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsScene::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: applyPacketFilterSlot(); break;
        case 1: applyNodePosFilterSlot(); break;
        case 2: packetFilterProtocolSelectAllSlot(); break;
        case 3: packetFilterProtocolDeSelectAllSlot(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
void
NodePositionStatisticsDialog::doShow()
{

    m_vLayout = new QVBoxLayout;
    m_formLayout = new QFormLayout;
    m_applyButton = new QPushButton("Apply");

    m_nodePosStatsIdComboBox = new QComboBox;
    m_nodePosStatsIdAlt2ComboBox = new QComboBox;
    m_nodePosStatsIdAlt3ComboBox = new QComboBox;
    m_nodePosStatsIdAlt4ComboBox = new QComboBox;
    m_nodePosStatsTrajectoryCheckBox = new QCheckBox;
    m_nodePosStatsProgressLabel = new QLabel;
    m_nodePosStatsProgressBar = new QProgressBar;

    m_vLayout->setSpacing(5);
    QLabel * entryCountLabel = new QLabel(QString::number(NodeMobilityMgr::getInstance()->getEntryCount()));
    m_formLayout->addRow("Entry count", entryCountLabel);

    QStringList nodeList;
    QStringList nodeListAlt;
    nodeList << "All";
    nodeListAlt << "None";
    for(uint32_t i = 0; i < AnimatorScene::getInstance()->getNodeCount(); ++i)
    {
        nodeList << QString::number(i);
        nodeListAlt << QString::number(i);
    }
    m_nodePosStatsIdComboBox->clear();
    m_nodePosStatsIdAlt2ComboBox->clear();
    m_nodePosStatsIdAlt3ComboBox->clear();
    m_nodePosStatsIdAlt4ComboBox->clear();

    m_nodePosStatsIdComboBox->addItems(nodeList);
    m_nodePosStatsIdAlt2ComboBox->addItems(nodeListAlt);
    m_nodePosStatsIdAlt3ComboBox->addItems(nodeListAlt);
    m_nodePosStatsIdAlt4ComboBox->addItems(nodeListAlt);


    m_applyButton->setToolTip("Apply filter");
    m_applyButton->adjustSize();
    //applyButton.setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    connect(m_applyButton, SIGNAL(clicked()), this, SLOT(applyNodePosFilterSlot()));

    m_nodePosStatsProgressLabel->setText("Parsing progress:");
    m_nodePosStatsProgressBar->setRange(0, entryCountLabel->text().toUInt());
    m_nodePosStatsProgressBar->setVisible(false);
    m_nodePosStatsProgressLabel->setVisible(false);


    m_nodePosStatsTable = new QTableWidget;
    m_nodePosStatsTable->setVisible(false);

    m_formLayout->setSpacing(5);
    m_formLayout->addRow("Node Id", m_nodePosStatsIdComboBox);
    m_formLayout->addRow("Add Node Id", m_nodePosStatsIdAlt2ComboBox);
    m_formLayout->addRow("Add Node Id", m_nodePosStatsIdAlt3ComboBox);
    m_formLayout->addRow("Add Node Id", m_nodePosStatsIdAlt4ComboBox);
    m_formLayout->setFormAlignment(Qt::AlignLeft);
    m_formLayout->setLabelAlignment(Qt::AlignLeft);

    m_formLayout->addWidget(m_applyButton);
    m_formLayout->addRow("Show Trajectory", m_nodePosStatsTrajectoryCheckBox);
    m_formLayout->addWidget(m_nodePosStatsProgressLabel);
    m_formLayout->addWidget(m_nodePosStatsProgressBar);

    m_vLayout->addLayout(m_formLayout);
    m_vLayout->addWidget(m_nodePosStatsTable);
    setLayout(m_vLayout);
    setMinimumWidth(m_applyButton->sizeHint().width() * 2);
    setVisible(true);
    setMinimumWidth(NODE_POS_STATS_DLG_WIDTH_MIN);
}