Skip to content

Commit

Permalink
radio group
Browse files Browse the repository at this point in the history
  • Loading branch information
ac001 committed Oct 5, 2010
1 parent 2a392a9 commit a2e3ba6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions sqlitebrowser/sqlitebrowser/editfieldform.cpp
Expand Up @@ -87,3 +87,8 @@ void editFieldForm::getCustomType()
enableSave();
}
}


void editFieldForm::on_radio_button_clicked(QAbstractButton *button){
qDebug("YES");
}
16 changes: 10 additions & 6 deletions sqlitebrowser/sqlitebrowser/editfieldform.h
Expand Up @@ -85,9 +85,9 @@ class Ui_editFieldForm
//**** Field Types Radios
QVBoxLayout *radioLayout = new QVBoxLayout();
mainVBoxLayout->addLayout(radioLayout);
radioLayout->setContentsMargins(20, 0 ,0 ,0);
radioLayout->setContentsMargins(20, 10 ,10 ,0);

groupRadioTypes = new QButtonGroup(editFieldForm);
groupRadioTypes = new QButtonGroup();


QRadioButton *radioTEXT = new QRadioButton();
Expand All @@ -103,22 +103,22 @@ class Ui_editFieldForm
QRadioButton *radioBLOB = new QRadioButton();
radioBLOB->setText(QApplication::translate("addFieldForm", "BLOB", 0, QApplication::UnicodeUTF8));
radioLayout->addWidget(radioBLOB);
groupRadioTypes->addButton(radioBLOB);
//groupRadioTypes->addButton(radioBLOB);

QRadioButton *radioINTPRIMARY = new QRadioButton();
radioINTPRIMARY->setText(QApplication::translate("addFieldForm", "INTEGER PRIMARY KEY", 0, QApplication::UnicodeUTF8));
radioLayout->addWidget(radioINTPRIMARY);
groupRadioTypes->addButton(radioINTPRIMARY);
//groupRadioTypes->addButton(radioINTPRIMARY);

QRadioButton *radioCustom = new QRadioButton();
radioCustom->setText(QApplication::translate("addFieldForm", "Custom", 0, QApplication::UnicodeUTF8));
radioLayout->addWidget(radioCustom);
groupRadioTypes->addButton(radioCustom);
//groupRadioTypes->addButton(radioCustom);

QLineEdit *txtCustomType = new QLineEdit();
radioLayout->addWidget(txtCustomType);
txtCustomType->setDisabled(true);

gridLayout = new QGridLayout();
mainVBoxLayout->addLayout(gridLayout );

Expand Down Expand Up @@ -201,6 +201,8 @@ class Ui_editFieldForm
QObject::connect(nameLineEdit, SIGNAL(textChanged(QString)), editFieldForm, SLOT(enableSave()));
QObject::connect(typeButton, SIGNAL(clicked()), editFieldForm, SLOT(getCustomType()));

QObject::connect(groupRadioTypes, SIGNAL(buttonClicked(QAbstractButton*)), editFieldForm, SLOT(on_radio_button_clicked(QAbstractButton*)));

QMetaObject::connectSlotsByName(editFieldForm);
} // setupUi

Expand Down Expand Up @@ -253,6 +255,8 @@ public slots:
virtual void enableSave();
virtual void getCustomType();

virtual void on_radio_button_clicked(QAbstractButton*);

protected slots:
virtual void languageChange();

Expand Down

0 comments on commit a2e3ba6

Please sign in to comment.