Esempio n. 1
0
void DoubleValueEditor::mouseMoveEvent(QMouseEvent* e)
{
	if (e->buttons() & Qt::LeftButton)
	{
		double dy = e->y() - last_pos.y();
		double step = default_step = singleStep();
		last_pos = e->posF();
		last_press = 0;

		if (e->modifiers() & Qt::ShiftModifier)
			setSingleStep(step /= 10.0);
		else if (e->modifiers() & Qt::ControlModifier)
			setSingleStep(step *= 10.0);

		if (dy < 0)
		{
			stepUp();
			emit valueUpdated();
		}
		else if (dy > 0)
		{
			stepDown();
			emit valueUpdated();
		}

		if (step != default_step)
			setSingleStep(default_step);
	}
}
void ValueTab::keyTypeLoaded(Response type)
{    
    if (isOperationsAborted())
        return destroy();

    QString t = type.getValue().toString();
    ui->keyTypeLabelValue->setText(
        ui->keyTypeLabelValue->text()  + t.toUpper()
        );

    keyModel = QSharedPointer<KeyModel>(key->getKeyModel(t));

    if (keyModel.isNull()) {
        emit error("Can not load key value. Key was removed or redis-server went away.");        
        return;
    }

    connect(keyModel.data(), SIGNAL(valueLoaded()), this, SLOT(valueLoaded()));
    connect(keyModel.data(), SIGNAL(keyRenameError(const QString&)), this, SIGNAL(error(const QString&)));
    connect(keyModel.data(), SIGNAL(keyRenamed()), this, SLOT(keyRenamed()));
    connect(keyModel.data(), SIGNAL(keyDeleteError(const QString&)), this, SIGNAL(error(const QString&)));
    connect(keyModel.data(), SIGNAL(keyDeleted()), this, SLOT(keyDeleted()));
    connect(keyModel.data(), SIGNAL(valueUpdateError(const QString&)), this, SIGNAL(error(const QString&)));
    connect(keyModel.data(), SIGNAL(valueUpdated()), this, SLOT(valueUpdated()));
    connect(keyModel.data(), SIGNAL(ttlLoaded(Response)), this, SLOT(ttlLoaded(Response)));

    operationInProgress = true;
    keyModel->loadValue();
    keyModel->loadTTL();
}
Esempio n. 3
0
ColorSettingsWidget::ColorSettingsWidget(GenomeVector* g, QWidget* parent)
    : QWidget(parent), genome(g)
{
    setupUi(this);

    m_colorSelector->setGenomeVector(genome);

    m_colorLineEdit->setWheelEventUpdate(true);
    m_colorLineEdit->restoreSettings();
    connect(m_colorLineEdit, SIGNAL(valueUpdated()), this, SLOT(colorChangedAction()));
    connect(m_colorLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));

    m_speedLineEdit->setWheelEventUpdate(true);
    m_speedLineEdit->restoreSettings();
    connect(m_speedLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction()));
    connect(m_speedLineEdit, SIGNAL(valueUpdated()), m_colorSelector, SLOT(repaintLabel()));
    connect(m_speedLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));

    m_opacityLineEdit->setWheelEventUpdate(true);
    m_opacityLineEdit->restoreSettings();
    connect(m_opacityLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction()));

    connect(m_backgroundLabel, SIGNAL(colorSelected(QColor)), this, SLOT(changeBackground(QColor)));
    connect(m_backgroundLabel, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));
    connect(m_colorSelector, SIGNAL(colorSelected(double)), this, SLOT(colorSelectedAction(double)));
    connect(m_colorSelector, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal()));
}
Esempio n. 4
0
// _____________________________________________________________________
void CRaspiGPIO::setPinModeOutput(unsigned int gpio_num, unsigned int init_state)
{
    pinMode(gpio_num, OUTPUT);
    digitalWrite(gpio_num, init_state);

    QString txt = "O";
    QString tooltip = "Digital Output";
    QLabel *lbl = m_ihm.findChild<QLabel*>(PREFIX_MODE_GPIO + QString::number(gpio_num));
    if (lbl) {
        lbl->setText(txt);
        lbl->setToolTip(tooltip);
        lbl->setEnabled(true);
    }
    QLabel *lbl_name = m_ihm.findChild<QLabel*>(PREFIX_GPIO_NAME + QString::number(gpio_num));
    if (lbl_name) {
        lbl_name->setEnabled(true);
    }

    QCheckBox *checkbox = m_ihm.findChild<QCheckBox*>(PREFIX_CHECKBOX_WRITE + QString::number(gpio_num));
    if (checkbox) {
        checkbox->setEnabled(true);
    }
    m_raspi_pins_config[gpio_num] = tRaspiPinConfig { OUTPUT, PUD_OFF, init_state};

    // Crée la data dans le data manager et l'associe à une callback pour déclencher l'écriture sur le port sur changement de valeur de la data
    QString dataname = PREFIX_RASPI_OUT_DATANAME + QString::number(gpio_num);
    m_application->m_data_center->write(dataname, init_state);
    CData *data = m_application->m_data_center->getData(dataname);
    if (data) {
        connect (data, SIGNAL(valueUpdated(QVariant)), this, SLOT(onDataChangeWrite(QVariant)));
    }
}
Esempio n. 5
0
SheepLoopWidget::SheepLoopWidget(GenomeVector* gv, QWidget* parent) :
	QWidget(parent), QosmicWidget(this, objectName()), genomes(gv), running(false)
{
	setupUi(this);

	connect(m_runToolButton, SIGNAL(clicked()), this, SLOT(runSheepButtonAction()));
	connect(m_saveToolButton, SIGNAL(clicked()), this, SIGNAL(saveSheepLoop()));
	connect(m_beginBox, SIGNAL(currentIndexChanged(int)), this, SLOT(beginBoxIndexChanged(int)));
	connect(m_endBox, SIGNAL(currentIndexChanged(int)), this, SLOT(endBoxIndexChanged(int)));
	connect(m_temporalSamplesEditor, SIGNAL(valueUpdated()), this, SLOT(temporalSamplesUpdated()));
	connect(m_animateButton, SIGNAL(clicked(bool)), this, SLOT(xformAnimateButtonClicked(bool)));

	QStandardItemModel* model = new QStandardItemModel(0, 4);
	m_motionElementsView->setModel(model);
	m_motionElementsView->setItemDelegate(new MotionViewItemDelegate(m_motionElementsView));

	m_beginBox->setModel(gv);
	m_endBox->setModel(gv);
	m_genomeIdxBox->setModel(gv);

	qobject_cast<QListView*>(m_beginBox->view())->setSpacing(2);
	qobject_cast<QListView*>(m_endBox->view())->setSpacing(2);
	qobject_cast<QListView*>(m_genomeIdxBox->view())->setSpacing(2);

	connect(m_addToolButton, SIGNAL(clicked()), this, SLOT(addNewMotionElement()));
	connect(m_delToolButton, SIGNAL(clicked()), this, SLOT(delCurrentMotionElement()));
	connect(m_xformIdxBox, SIGNAL(currentIndexChanged(int)), this, SLOT(xformIdxBoxIndexChanged(int)));
	connect(m_genomeIdxBox, SIGNAL(currentIndexChanged(int)), this, SLOT(genomeSelectedSlot(int)));
	connect(m_animateModeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(modeBoxIndexChanged(int)));
	connect(m_temporalFilterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(temporalFilterTypeIndexChanged(int)));
	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabWidgetIndexChanged(int)));
	connect(model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(motionItemChanged(QStandardItem*)));
}
Esempio n. 6
0
void IntValueEditor::wheelEvent(QWheelEvent* e)
{
	if (!QSpinBox::isActiveWindow())
		QSpinBox::activateWindow();
	QSpinBox::setFocus(Qt::MouseFocusReason);

	int step = default_step = singleStep();
	if (e->modifiers() & Qt::ShiftModifier)
	{
		if (step >= 10.0)
			setSingleStep(step = (int)(step / 10.0));
	}
	else if (e->modifiers() & Qt::ControlModifier)
		setSingleStep(step = step * 10);

	if (e->delta() > 0)
		stepUp();
	else
		stepDown();

	if (step != default_step)
		setSingleStep(default_step);

	if (wheelEventSignal && WheelValueEditor::WHEEL_EVENTS_ENABLED)
		emit valueUpdated();
}
Esempio n. 7
0
MotionViewDoubleItemEditor::MotionViewDoubleItemEditor(const MotionViewItemDelegate* d, QWidget* p)
: DoubleValueEditor(p), m_delegate(d)
{
	setDecimals(3);
	setMinimum(0.001);
	setSingleStep(0.1);
	connect(this, SIGNAL(valueUpdated()), this, SLOT(spinnerValueChanged()));
}
void ListKeyModel::loadedUpdateStatus(Response result)
{
    if (result.isErrorMessage()) 
    {
        emit valueUpdateError(result.getValue().toString());
    }
    else 
    {
        emit valueUpdated();    
    }
}
Esempio n. 9
0
void IntegerNode::valueChanged( int pValue )
{
	if( pValue == mValue->variant().toInt() )
	{
		return;
	}

	mValue->setVariant( pValue );

	pinUpdated( mPinValue );

	emit valueUpdated( pValue );
}
Esempio n. 10
0
AdjustSceneWidget::AdjustSceneWidget(FigureEditor* e, QWidget* parent)
	: QDialog(parent), editor(e)
{
	setupUi(this);

	m_gridCheckBox->setChecked(editor->gridVisible());
	m_guideCheckBox->setChecked(editor->guideVisible());
	m_guideColorButton->setEnabled(editor->guideVisible());
	m_previewCheckBox->setChecked(editor->previewVisible());
	m_previewFrame->setEnabled(editor->previewVisible());
	m_previewDensityEditor->updateValue(editor->previewDensity());
	m_previewDepthEditor->updateValue(editor->previewDepth());

	connect(m_previewDensityEditor, SIGNAL(valueUpdated()), this, SLOT(previewUpdatedAction()));
	connect(m_previewDepthEditor, SIGNAL(valueUpdated()), this, SLOT(previewUpdatedAction()));
	connect(m_previewCheckBox, SIGNAL(toggled(bool)), this, SLOT(togglePreviewAction(bool)));
	connect(m_gridCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleGridAction(bool)));
	connect(m_gridColorButton, SIGNAL(pressed()), this, SLOT(gridColorSelectAction()));
	connect(m_guideCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleGuideAction(bool)));
	connect(m_guideColorButton, SIGNAL(pressed()), this, SLOT(guideColorSelectAction()));
	connect(m_bgColorButton, SIGNAL(pressed()), this, SLOT(bgColorSelectAction()));
}
Esempio n. 11
0
MotionViewIntItemEditor::MotionViewIntItemEditor(const MotionViewItemDelegate* d, QWidget* p)
: IntValueEditor(p), m_delegate(d)
{
	setMinimum(1);
	connect(this, SIGNAL(valueUpdated()), this, SLOT(spinnerValueChanged()));
}