コード例 #1
0
void EdgeMenuDialogBase::PickPreviousSibling()
{
    bool continueSearch = true;
    BrowserNode * previousNode = 0;
    BrowserNode * originalNode = GetCurrentNode();
    int originalDepth = originalNode->depth();
    BrowserNode * currentNode = originalNode;

    while (continueSearch)
    {
        QLOG_INFO() << "CurrentNode is: " << currentNode->get_name();
        previousNode = dynamic_cast<BrowserNode *>(currentNode->itemBelow());

        QLOG_INFO() << "Nodename is: " << previousNode->get_name() << " " << previousNode->depth();
        if (!previousNode)
            break;

        QLOG_INFO() << "Previous Node is: "<< previousNode->get_name();
        int previousDepth = previousNode->depth();
        bool sameType = originalNode->get_stype() == previousNode->get_stype();
        QLOG_INFO() << "PREVIOUS: " << "Origin level : " << originalDepth;
        QLOG_INFO() << "PREVIOUS: " << "Current level : " << previousDepth;
        bool sameLevel = originalDepth == previousDepth;

        if (sameLevel && sameType)
            continueSearch = false;

        currentNode = previousNode;
    }
    if (previousNode == 0)
        return;

    SaveData();
    FillGuiElements(previousNode);
}
コード例 #2
0
void EdgeMenuDialogBase::PickNextSibling()
{
    bool continueSearch = true;
    BrowserNode * nextNode = 0;
    BrowserNode * originalNode = GetCurrentNode();
    BrowserNode * currentNode = originalNode;

    while (continueSearch)
    {

        nextNode = dynamic_cast<BrowserNode *>(currentNode->itemAbove());
        QLOG_INFO() << "CurrentNode is: "<< currentNode->get_name();
        if (!nextNode)
            break;

        QLOG_INFO() << "NEXT: " << nextNode->get_name() << " " << nextNode->depth();


        QLOG_INFO() << "NextNode is: "<< nextNode->get_name();
        bool sameLevel = originalNode->depth() == nextNode->depth();
        bool sameType = originalNode->get_stype() == nextNode->get_stype();

        QLOG_INFO() << originalNode->get_stype();
        QLOG_INFO() << nextNode->get_stype();
        //        QLOG_INFO() << "NEXT: " << "Origin level : " << originalNode->depth();
        //        QLOG_INFO() << "NEXT: " << "Current level : " << nextNode->depth();
        if (sameLevel && sameType)
            continueSearch = false;

        currentNode = nextNode;
    }

    if (nextNode == 0)
        return;

    SaveData();
    FillGuiElements(nextNode);
}