示例#1
0
/**
 * Zamyka wszystkie wykresy.
 */
void ChartsWidget::closeAllCharts()
{
    QList<QWidget*> tabs = ui->tabCharts->findChildren<QWidget*>();
    foreach(QWidget* tab, tabs)
    {
        closeChart(ui->tabCharts->indexOf(tab));
    }
示例#2
0
/**
 * Przechwytuje zdarzenie naciśnięcia klawisza.
 *
 * Reaguje na kombinację Ctrl+W - zamyka bieżącą kartę.
 *
 * @param event obiekt informacji o zdarzeniu
 */
void ChartsWidget::keyPressEvent(QKeyEvent* event)
{
    if (event->modifiers() & Qt::ControlModifier)
    {
        switch (event->key())
        {
        case Qt::Key_W:
            closeChart(ui->tabCharts->currentIndex());
            return;
        }
    }

    QWidget::keyPressEvent(event);
}
示例#3
0
bool CBFGOracle::accepts(vector<string> w, const vector<PLCRule> PL, const vector<PCRule> P){
	unsigned int n = w.size();
	vector<vector<context>>** chart = new vector<vector<context>>*[n + 1];	// Chart is dynamically allocated 2D array
	for (unsigned int i = 0; i <= n; ++i)
		chart[i] = new vector<vector<context>>[n + 1];

	// printChart(chart, n);
	initializeChart(w, PL, chart);
	// printChart(chart, n);
	closeChart(P, chart, n);
	// printChart(chart, n);

	// Is the top left cell the start symbol?
	context c;
	bool success = search(chart[0][n], c) ? true : false;

	for (unsigned int i = 0; i <= n; ++i)	// Delete the dynamically allocated array from memory
		delete[] chart[i];
	delete[] chart;

	return success;
}