PDA

View Full Version : Access to QDateEdit value and QCombobox



rahma_sassi
23rd December 2016, 12:29
Hello
I work on an application with qt creator and oracle
I want to add a patient in my database oracle
The patient must fill the window and then when he presses the button it must be added
The problem I do not know how to access the variable birthdate of type QDateEdite and Blood group QCombobox and sex of type radioBotton to add them in my oracle table
12255
Let's know that I usually use this code to add
exemple : add doctor
bool doctor::ajouter()
{
QSqlQuery query;
QString str= "insert into doctor values('"+specialite+"','"+nom+"','"+prenom+"','"+pseudo+"','"+mdp+"',"+ QString::number(id)+")";
qDebug()<<str;

if(query.exec(str))
{
//QMessageBox::information(this,tr("ajouter"),tr("ajouter"));
return true;
}
else
{
//QMessageBox::information(this,tr("error::"),query.lastError().text());
return false ;
}

anda_skoa
23rd December 2016, 12:56
QDateEdit::date(), QComboBox::currentText() or QComboBox::currentIndex(), QRadioButton::isChecked().

Cheers,
_