Compare commits
No commits in common. "ba6faaaf7e4a8d3bbc0b6d159d671c553cc2f4d0" and "385f2840479e2dfe908041fefbac18e994a2b469" have entirely different histories.
ba6faaaf7e
...
385f284047
12
auth.cpp
12
auth.cpp
|
|
@ -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
2
auth.h
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue