пока не работает проблема с линковкой класса логин

This commit is contained in:
Dober 2017-12-18 00:42:52 +03:00
parent c38f00cd5a
commit 9032d59e79
6 changed files with 130 additions and 5 deletions

View File

@ -26,11 +26,13 @@ DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += main.cpp\
boss.cpp \
pcore.cpp \
conmenu.cpp
conmenu.cpp \
login.cpp
HEADERS += boss.h \
pcore.h \
conmenu.h
conmenu.h \
login.h
DISTFILES += \
README.md

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.2.0, 2017-12-17T19:49:45. -->
<!-- Written by QtCreator 4.2.0, 2017-12-18T00:42:22. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -54,7 +54,9 @@
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangStaticAnalyzer.SuppressedDiagnostics"/>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
@ -62,7 +64,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.1 MSVC2015_64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.1 MSVC2015_64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.win64_msvc2015_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">

View File

@ -1,4 +1,5 @@
#include "conmenu.h"
#include "login.h"
#include <QDebug>
#include <QtGui>
#include <QBoxLayout>
@ -21,6 +22,9 @@ conmenu::conmenu()
core->addPass(tr("domain"),tr("lUserName"),tr("infa(url, path, other desc)"),tr("pass(2r3tgwe454hb3f4)"));//временая костыля
//инициализация класса входа и отображения окна
logcore = new login();
//login.createLogIn();
logcore->createLogIn();
boss->addLayout(cont);
boss->addStretch();

View File

@ -7,6 +7,7 @@
class QBoxLayout;
class QHBoxLayout;
class login;
class conmenu : public QDialog
{
@ -15,6 +16,8 @@ class conmenu : public QDialog
public:
conmenu();
~conmenu();
private:
login *logcore;
protected:
PCore *core;
QHBoxLayout *cont;

94
login.cpp Normal file
View File

@ -0,0 +1,94 @@
#include "login.h"
#include <QDebug>
#include <QBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
login::login()
{
}
login::~login()
{
}
void login::createLogIn()
{
lform = new QWidget(this);
lform->setMinimumHeight(470);
QHBoxLayout *bb = new QHBoxLayout(lform);
bb->setMargin(0);
bb->addStretch();//left padding
QWidget *form = new QWidget(lform);
QVBoxLayout *linesl = new QVBoxLayout(form);
linesl->setMargin(0);
linesl->addStretch();//upper padding
QLabel *llogin = new QLabel("Username:", form);//login
linesl->addWidget(llogin);
QLineEdit *elogin = new QLineEdit(form);
linesl->addWidget(elogin);
QLabel *lpas = new QLabel("Password:", form);
linesl->addWidget(lpas);
QLineEdit *epas = new QLineEdit(form);
epas->setEchoMode(QLineEdit::Password);
linesl->addWidget(epas);
linesl->addSpacing(20);
QHBoxLayout *fcontr = new QHBoxLayout(form);
fcontr->addStretch();
QVBoxLayout *lr = new QVBoxLayout(form);
QPushButton *blogin = new QPushButton("LogIn", form);
blogin->setCursor(Qt::PointingHandCursor);
blogin->setStyleSheet("QPushButton{"
"border: 1px solid #000; height: 30px; width: 70px;"
"}"
"QPushButton:hover{"
"border: 1px solid #0000aa;"
"}");
connect(blogin, SIGNAL(clicked(bool)), this, SLOT(slogin()));
lr->addWidget(blogin);
QPushButton *lreg = new QPushButton("New account", form);
lreg->setCursor(Qt::PointingHandCursor);
lreg->setStyleSheet("QPushButton{"
"text-decoration: underline;"
"border: none;"
"}"
"QPushButton:hover{"
"color: #0000aa;"
"}");
connect(lreg, SIGNAL(clicked(bool)), this, SLOT(newacc()));
lr->addWidget(lreg);
fcontr->addLayout(lr);
fcontr->addStretch();
linesl->addLayout(fcontr);
linesl->addStretch();//bottom padding
form->setLayout(linesl);
bb->addWidget(form);
bb->addStretch();//right padding
lform->setLayout(bb);
cont->addWidget(lform);
}
void login::slogin()
{
qDebug()<<"login";
}
void login::newacc()
{
qDebug()<<"registration";
}

20
login.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef LOGIN_H
#define LOGIN_H
#include "conmenu.h"
class login : public conmenu
{
public:
login();
~login();
void createLogIn();
private:
QWidget *lform;
private slots:
void slogin();
void newacc();
};
#endif // LOGIN_H