Skip to content
Snippets Groups Projects
Commit cbee2297 authored by Daniel Molkentin's avatar Daniel Molkentin
Browse files

docs: Compile Fixes, Fixups in addressbook example

Reviewed-By: TrustMe
parent 9a089680
No related branches found
No related tags found
No related merge requests found
#include <QFileDialog>
#include "addressbook.h" #include "addressbook.h"
#include "ui_addressbook.h" #include "ui_addressbook.h"
...@@ -31,6 +33,12 @@ AddressBook::AddressBook(QWidget *parent) ...@@ -31,6 +33,12 @@ AddressBook::AddressBook(QWidget *parent)
SLOT(removeContact())); SLOT(removeContact()));
connect(ui->findButton, SIGNAL(clicked()), this, connect(ui->findButton, SIGNAL(clicked()), this,
SLOT(findContact())); SLOT(findContact()));
//! [connectSlots]
connect(ui->loadButton, SIGNAL(clicked()), this,
SLOT(loadFromFile()));
connect(ui->saveButton, SIGNAL(clicked()), this,
SLOT(saveToFile()));
//! [connectSlots]
setWindowTitle(tr("Simple Address Book")); setWindowTitle(tr("Simple Address Book"));
} }
...@@ -292,7 +300,7 @@ void AddressBook::loadFromFile() ...@@ -292,7 +300,7 @@ void AddressBook::loadFromFile()
//! [loadFromFile part3] //! [loadFromFile part3]
if (contacts.isEmpty()) { if (contacts.isEmpty()) {
QMessagebox::information(this, tr("No contacts in file"), QMessageBox::information(this, tr("No contacts in file"),
tr("The file you are attempting to open contains no contacts.")); tr("The file you are attempting to open contains no contacts."));
} else { } else {
QMap<QString, QString>::iterator i = contacts.begin(); QMap<QString, QString>::iterator i = contacts.begin();
......
#include <QFileDialog>
#include <QTextStream>
#include "addressbook.h" #include "addressbook.h"
#include "ui_addressbook.h" #include "ui_addressbook.h"
...@@ -348,5 +351,5 @@ void AddressBook::exportAsVCard() ...@@ -348,5 +351,5 @@ void AddressBook::exportAsVCard()
out << "END;VCARD" << "\n"; out << "END;VCARD" << "\n";
QMessageBox::information(this, tr("Export Successful"), QMessageBox::information(this, tr("Export Successful"),
tr("\%1\" has been exported as a vCard.").arg(name)); tr("\"%1\" has been exported as a vCard.").arg(name));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment