Compare commits

..

No commits in common. "ba6faaaf7e4a8d3bbc0b6d159d671c553cc2f4d0" and "385f2840479e2dfe908041fefbac18e994a2b469" have entirely different histories.

3 changed files with 1 additions and 17 deletions

View File

@ -33,16 +33,4 @@ auth::auth (QWidget *parent)
void void
auth::onAuth () auth::onAuth ()
{ {
QSqlDatabase *db = new QSqlDatabase(QSqlDatabase::addDatabase("QPSQL"));
db->setHostName(_addressEdit->text());
db->setPort(_portEdit->text().toInt());
db->setDatabaseName("cards");
db->setUserName(_nicknameEdit->text());
db->setPassword(_passwordEdit->text());
bool ok = db->open();
if (ok) {
emit dbOpenned(db);
}
close();
} }

2
auth.h
View File

@ -4,7 +4,6 @@
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QPushButton> #include <QPushButton>
#include <QSqlDatabase>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
@ -29,7 +28,6 @@ private:
public slots: public slots:
void onAuth (); void onAuth ();
signals: signals:
void dbOpenned(QSqlDatabase *);
}; };
#endif // AUTH_H #endif // AUTH_H

View File

@ -8,8 +8,6 @@ main (int argc, char *argv[])
{ {
QApplication app (argc, argv); QApplication app (argc, argv);
auth a; auth a;
Widget w;
QObject::connect(&a, &auth::dbOpenned, &w, &Widget::init);
a.show (); a.show ();
return app.exec (); return app.exec ();
} }