コード例 #1
0
HeaderView::HeaderView(QWidget *parent) : QWidget(parent)
{
	ui = new Ui::HeaderView;
	ui->setupUi(this);
	
	connect(ui->nameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleFieldChanged()));
	connect(ui->preStateLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleFieldChanged()));
	connect(ui->playStateLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleFieldChanged()));
	connect(ui->postStateLineEdit, SIGNAL(textChanged(QString)), this, SLOT(handleFieldChanged()));
	
	connect(ui->enablePIDCheckbox, SIGNAL(toggled(bool)), this, SLOT(handleFieldChanged()));
	
	this->enableEdit(false);
}
コード例 #2
0
ConfigureNumberWidget::ConfigureNumberWidget(bool enableLabel, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ConfigureNumberWidget)
{
    ui->setupUi(this);

    ui->minSpin->setMinimum(INT_MIN);
    ui->minSpin->setMaximum(INT_MAX);
    ui->minSpin->setValue(1);

    ui->maxSpin->setMinimum(INT_MIN);
    ui->maxSpin->setMaximum(INT_MAX);
    ui->maxSpin->setValue(10);

    if (!enableLabel) {
        ui->useLabel->hide();
        ui->labelEdit->hide();
    }

    connect(ui->minSpin, SIGNAL(valueChanged(int)), SLOT(handleFieldChanged()));
    connect(ui->maxSpin, SIGNAL(valueChanged(int)), SLOT(handleFieldChanged()));
    connect(ui->useLabel, SIGNAL(toggled(bool)), SLOT(handleFieldChanged()));
    connect(ui->labelEdit, SIGNAL(textChanged(QString)), SLOT(handleFieldChanged()));
}