Exemplo n.º 1
0
QString CMDLineRegistryUtils::getCmdlineUgenePath() {
    QString executableDir = AppContext::getWorkingDirectoryPath();
    QStringList candidates(generateCandidates(executableDir));
    foreach(const QString & candidate, candidates) {
        if (QFile::exists(candidate)) {
            return candidate;
        }
    }
    return "";
}
Exemplo n.º 2
0
bool existHelper(vector<vector<bool>> &visited,vector<vector<char>> &board,
                 string word,int index,int r,int c){
    if (index == word.size()) return true;
    vector<pair<int, int>> candis = generateCandidates(visited, board, word, index, r, c);
    for (pair<int, int> cand : candis) {
        int tmp_r = cand.first;
        int tmp_c = cand.second;
        visited[tmp_r][tmp_c] = true;
        if (existHelper(visited, board, word, index+1, tmp_r, tmp_c)) return true;
        visited[tmp_r][tmp_c] = false;
    }
    return false;
}
    estimatedTimeLabel = new QLabel;
    estimatedTimeLabel->setStyleSheet("QLabel { color : red; }");

    connect(modeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    connect(maxInvoledSingularitiesSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    connect(maxDepthSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setEstimatedTimeLabel(int)));
    setEstimatedTimeLabel();

    searchButton = new QPushButton(tr("Search"));
    connect(searchButton, SIGNAL(clicked()), this, SLOT(startSearch()));

    stopButton = new QPushButton(tr("Stop"));
    connect(stopButton, SIGNAL(clicked()), this, SLOT(stopSearching()));

    generateCandidatesButton = new QPushButton(tr("Generate pseudo-anosov candidates"));
    connect(generateCandidatesButton, SIGNAL(clicked()), this, SLOT(generateCandidates()));

    QHBoxLayout* lineLayout = new QHBoxLayout;
    lineLayout->addWidget(modeLabel);
    lineLayout->addWidget(modeComboBox);
    lineLayout->addWidget(maxInvoledSingularitiesLabel);
    lineLayout->addWidget(maxInvoledSingularitiesSpinBox);
    lineLayout->addWidget(maxDepthLabel);
    lineLayout->addWidget(maxDepthSpinBox);
    lineLayout->addStretch(1);


    QHBoxLayout* lineLayout2 = new QHBoxLayout;
    lineLayout2->addStretch(1);
    lineLayout2->addWidget(estimatedTimeLabel);
    lineLayout2->addWidget(searchButton);