int MainWindow::captura()
{
archivo_foto
= QFileDialog::getOpenFileName(this,tr
("Abrir Archivo"),tr
("/home/Imágenes"),tr
("Imagenes(*.png *.xpm *.jpg"));
ui->label_foto->setPixmap(archivo_foto);
return 0;
}
int MainWindow::captura()
{
QString archivo_foto;
archivo_foto = QFileDialog::getOpenFileName(this,tr("Abrir Archivo"),tr("/home/Imágenes"),tr("Imagenes(*.png *.xpm *.jpg"));
ui->label_foto->setPixmap(archivo_foto);
return 0;
}
To copy to clipboard, switch view to plain text mode
query.exec("INSERT INTO `ismed`.`empleados` (`id` ,`foto`,`nombre` ,`apellidop` ,`apellidom` ,`puesto` ,`direccion` ,`fecha_ingreso` ,`salario` ,`depto` ,`activo`)VALUES (NULL ,"+ ui->label_foto->pixmap() +",'"+ui->lineEdit_2->text()+"', '"+ui->lineEdit_3->text()+"', '"+ui->lineEdit_4->text()+"', '"+ui->lineEdit_5->text()+"', '"+ui->lineEdit_6->text()+"', '"+ui->lineEdit_7->text()+"', '"+ui->lineEdit_8->text()+"', '"+ui->lineEdit_9->text()+"', '"+ui->lineEdit_10->text()+"');");
QSqlQuery query;
query.exec("INSERT INTO `ismed`.`empleados` (`id` ,`foto`,`nombre` ,`apellidop` ,`apellidom` ,`puesto` ,`direccion` ,`fecha_ingreso` ,`salario` ,`depto` ,`activo`)VALUES (NULL ,"+ ui->label_foto->pixmap() +",'"+ui->lineEdit_2->text()+"', '"+ui->lineEdit_3->text()+"', '"+ui->lineEdit_4->text()+"', '"+ui->lineEdit_5->text()+"', '"+ui->lineEdit_6->text()+"', '"+ui->lineEdit_7->text()+"', '"+ui->lineEdit_8->text()+"', '"+ui->lineEdit_9->text()+"', '"+ui->lineEdit_10->text()+"');");
To copy to clipboard, switch view to plain text mode
Bookmarks