examples/sql/masterdetail/mainwindow.cpp
changeset 37 758a864f9613
parent 30 5dc02b23752f
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   187         QString title = idIndex.sibling(idIndex.row(), 1).data().toString();
   187         QString title = idIndex.sibling(idIndex.row(), 1).data().toString();
   188         QString artist = idIndex.sibling(idIndex.row(), 2).data().toString();
   188         QString artist = idIndex.sibling(idIndex.row(), 2).data().toString();
   189 
   189 
   190         QMessageBox::StandardButton button;
   190         QMessageBox::StandardButton button;
   191         button = QMessageBox::question(this, tr("Delete Album"),
   191         button = QMessageBox::question(this, tr("Delete Album"),
   192                                        QString(tr("Are you sure you want to " \
   192                                        tr("Are you sure you want to "
   193                                                   "delete '%1' by '%2'?"))
   193                                           "delete '%1' by '%2'?")
   194                                               .arg(title).arg(artist),
   194                                        .arg(title, artist),
   195                                        QMessageBox::Yes | QMessageBox::No);
   195                                        QMessageBox::Yes | QMessageBox::No);
   196 
   196 
   197         if (button == QMessageBox::Yes) {
   197         if (button == QMessageBox::Yes) {
   198             removeAlbumFromFile(id);
   198             removeAlbumFromFile(id);
   199             removeAlbumFromDatabase(idIndex);
   199             removeAlbumFromDatabase(idIndex);