4
0
mirror of https://github.com/QuasarApp/QMLLoginView.git synced 2025-05-09 07:59:46 +00:00

Compare commits

...

82 Commits
1.0 ... main

Author SHA1 Message Date
0b7ded4df1 update cmake 2021-06-01 20:22:41 +03:00
Oleg-designer
45d76e789f
Merge pull request from QuasarApp/task_23
Add languages and translations
2021-05-29 13:32:34 +03:00
acc385d2a8 ref Add languages zh de fr es pl and translations 2021-05-29 12:08:49 +03:00
d999706ca9 set new defaul value for the single column property 2021-05-15 19:23:26 +03:00
028aabc2d3 added singleColimn property for dialog 2021-05-15 19:22:21 +03:00
73ca7f0575 restore point size 2021-05-15 18:38:59 +03:00
c27181745f fix Metrix class 2021-05-15 17:22:06 +03:00
97b3cc41f4 fix height 2021-05-12 11:00:11 +03:00
ec0d9a9904 fix qml path 2021-05-07 22:35:48 +03:00
Oleg-designer
055445ac2b
Merge pull request from QuasarApp/task_21
Uk translation fix
2021-05-06 11:42:21 +03:00
32b2c94fad ref uk translation fix 2021-05-06 11:28:52 +03:00
Oleg-designer
abe0f7b109
Merge pull request from QuasarApp/task_18
Add translations
2021-05-05 17:33:59 +03:00
d7e974ac05
Merge pull request from QuasarApp/tr
added translations
2021-05-05 17:31:31 +03:00
2639d7047c ref add translations 2021-05-05 17:28:55 +03:00
76206fcc78
Update README.md 2021-05-05 17:26:08 +03:00
d2ab2cadf1
Update README.md 2021-05-05 17:25:37 +03:00
b8f8533299
Update LoginView/README.md 2021-05-05 17:23:57 +03:00
c94a2a6f87 added readme 2021-05-05 17:22:23 +03:00
dd2df72542 added translations 2021-05-05 16:03:47 +03:00
7fe512a956 fix view 2021-05-05 13:04:01 +03:00
5fbdba9809 fix layout 2021-05-05 13:03:27 +03:00
5d5ee2c0be update cmake 2021-04-27 12:28:07 +03:00
9dbd6d3c20 update cmake 2021-04-27 11:17:57 +03:00
92df551d6d update cmake 2021-04-27 00:20:51 +03:00
3922d2a719 update cmake 2021-04-26 23:50:24 +03:00
8e487c3185
Merge pull request from QuasarApp/android_cmake
Android cmake
2021-04-26 17:58:45 +03:00
53675cea55 update cmake 2021-04-25 19:35:28 +03:00
3891e09dcf update cmake 2021-04-22 17:21:08 +03:00
2d960bc8d7 update cmake 2021-04-21 19:38:06 +03:00
4a5ddcc5df update cmake 2021-04-21 19:22:13 +03:00
cb531b1515 update cmake 2021-04-21 18:56:25 +03:00
375ff0a831 Merge branch 'main' of github.com:QuasarApp/QMLLoginView into main 2021-04-21 18:29:38 +03:00
7f0ab573ee update cmake 2021-04-21 18:29:27 +03:00
9781352129
Merge pull request from QuasarApp/updateCmake
update cmeke
2021-04-20 18:24:36 +03:00
5bf60d6e24
Update README.md 2021-04-20 18:20:23 +03:00
0361f5af90 update cmeke 2021-04-20 18:10:17 +03:00
1facc66231 update cmake 2021-04-19 19:37:38 +03:00
b0bcedff67 update cmake 2021-04-19 17:52:01 +03:00
0c656ffd95 update cmake 2021-04-19 16:55:42 +03:00
Oleg-designer
5b60b04806
Merge pull request from QuasarApp/task_14
doxtygen settings change
2021-04-18 17:19:57 +03:00
b1fb5e968b ref doxtygen settings change 2021-04-17 15:56:34 +03:00
Oleg-designer
96a57dcd4c
Merge pull request from QuasarApp/task_8
Documentation correction
2021-04-16 17:18:10 +03:00
e36b7daa80 ref header correction 2021-04-16 17:00:22 +03:00
6b07c5b5d5
Merge pull request from QuasarApp/simpleFixes
simple fixex
2021-04-16 16:44:20 +03:00
8f98ddec2e simple fixex 2021-04-16 16:40:24 +03:00
ec3b79f2f8 fix docs 2021-04-16 16:07:24 +03:00
dad94bc0d3
Merge pull request from QuasarApp/task_9
Fix build
2021-04-16 16:02:38 +03:00
c460318dac ref fix qmake builds 2021-04-16 15:55:23 +03:00
d790a8fd18 added docs target 2021-04-16 15:53:45 +03:00
04683b4e0e ref "added support for all default targets" 2021-04-16 15:50:50 +03:00
70caf44b5a
Merge pull request from QuasarApp/HanoiTowerChanges
HanoiTowers patch
2021-03-22 12:01:38 +03:00
c63cefdd29 fix defines 2021-03-22 11:59:12 +03:00
46ce247ec1
Merge pull request from QuasarApp/task_4
Banner changed from png to jpeg
2021-02-19 13:34:44 +03:00
de73dc31bf ref banner swith from png to jpeg 2021-02-19 13:28:17 +03:00
590f73aa1a
Merge pull request from QuasarApp/task_2
Add new logo banner and icon
2021-02-18 13:16:52 +03:00
b61055a5e7 ref fix read me 2021-02-18 13:14:19 +03:00
688e3aec80 ref fix readme 2021-02-18 13:03:56 +03:00
d2a502fc78 ref fix readmi banner 2021-02-18 12:59:58 +03:00
98b62f49d9 ref fix radme 2021-02-18 12:54:56 +03:00
3c6156d3e9 reg readmi banner fix 2021-02-18 12:51:30 +03:00
9758ca17cd ref add banner in readme 2021-02-18 12:45:10 +03:00
357f6968b9 ref logo fix 2021-02-18 12:29:51 +03:00
6fcea9fb9f ref change logo and banner 2021-02-18 12:12:00 +03:00
c8a02e66f1 ref icons size fix 2021-02-18 12:02:40 +03:00
c7e1992ed1 ref #task_2 add new logo banner and icon 2021-02-18 11:35:56 +03:00
0ec27ac102 added page selector 2021-02-16 19:14:57 +03:00
883271c38a update copyrigh 2021-01-31 19:56:50 +03:00
491665cd0f fix vixible widgets 2021-01-17 20:32:07 +03:00
3a056d66c5 added new iptions for control the qml view page. 2021-01-17 14:09:26 +03:00
9b4842846a add qt6 sopport 2020-12-27 16:24:55 +03:00
5f1de16eff added Qt6 support 2020-12-27 15:40:03 +03:00
a3c1dce2df fix warnings 2020-11-03 12:18:41 +03:00
36ae53f1be fix nickName 2020-11-01 23:55:44 +03:00
3d36acb3f2 Merge branch 'master' of github.com:QuasarApp/QMLLoginView 2020-05-24 22:49:43 +03:00
42d84d1b02 added support of module 2020-05-24 22:49:26 +03:00
5f5ba40e09
Update README.md 2020-05-24 11:59:34 +03:00
ce8e1688b3 Merge branch 'master' of github.com:QuasarApp/QMLLoginView 2020-05-24 02:23:35 +03:00
d9e132a257 fix global object 2020-05-24 02:22:42 +03:00
38da1906ed
Update README.md 2020-05-23 23:52:29 +03:00
7764d07612
Update README.md 2020-04-29 22:10:29 +03:00
206bf5d13c
Update README.md 2020-04-13 08:19:12 +03:00
8a2775291b
Update README.md 2020-04-13 08:18:21 +03:00
51 changed files with 4732 additions and 277 deletions

3
.gitignore vendored

@ -46,6 +46,9 @@ target_wrapper.*
# QtCreator CMake
CMakeLists.txt.user*
CMakeFiles
*_autogen
cmake_install.cmake
# QtCreator 4.8< compilation database
compile_commands.json

3
.gitmodules vendored Normal file

@ -0,0 +1,3 @@
[submodule "CMake"]
path = CMake
url = https://github.com/QuasarApp/CMake.git

1
CMake Submodule

@ -0,0 +1 @@
Subproject commit cd05493c3a43b04f26c3e3432df4283eb4509d8c

@ -1,32 +0,0 @@
#
# Copyright (C) 2018-2020 QuasarApp.
# Distributed under the MIT software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
if(DEFINED PROJECT_OUT_SUPPORT)
return()
else()
set(PROJECT_OUT_SUPPORT 1)
endif()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(LIB_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE})
message("${} LIB_OUTPUT_DIR = ${LIB_OUTPUT_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}/bin)
message(STATUS "buid type " ${CMAKE_BUILD_TYPE})
message(STATUS "Project " ${PROJECT_NAME})
message(STATUS "c compiler " ${CMAKE_C_COMPILER})
message(STATUS "cxx compiler " ${CMAKE_CXX_COMPILER})
message(STATUS "build shared " ${BUILD_SHARED_LIBS})
message(STATUS "qmake exec " ${QT_QMAKE_EXECUTABLE})

@ -1,14 +1,46 @@
#
# Copyright (C) 2018-2020 QuasarApp.
# Copyright (C) 2018-2021 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
cmake_minimum_required(VERSION 3.5)
project(LoginViewMain)
project(LoginView LANGUAGES CXX)
if(TARGET ${PROJECT_NAME})
message("The ${PROJECT_NAME} arledy included in main Project")
return()
endif()
if (NOT DEFINED LOGINVIEW_EXAMPLES)
set(LOGINVIEW_EXAMPLES ON)
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
set(LOGINVIEW_EXAMPLES OFF)
endif()
endif()
if (ANDROID)
set(LOGINVIEW_EXAMPLES OFF)
endif()
endif()
include(CMake/QuasarApp.cmake)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick Xml REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick Xml REQUIRED)
# Add sub directories
add_subdirectory(LoginView)
add_subdirectory(example)
if (LOGINVIEW_EXAMPLES)
add_subdirectory(example)
endif()
initAll()
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)

@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
@ -7,7 +7,6 @@
cmake_minimum_required(VERSION 3.5)
project(LoginView LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
@ -17,18 +16,27 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DLOGIN_VIEW_LIBRARY)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ProjectOut.cmake)
find_package(Qt5 COMPONENTS Core Quick Xml REQUIRED)
file(GLOB SOURCE_CPP "src/*.cpp" "src/*.qrc")
add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP})
add_library(${PROJECT_NAME} ${SOURCE_CPP})
target_compile_definitions(LoginView
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core Qt5::Quick Qt5::Xml)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Xml)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(QML_IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "Qt Creator extra qml import paths")
set(LANGS ${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/en.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/ru.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/ja.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/tr.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/uk.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/zh.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/de.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/fr.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/es.ts
${CMAKE_CURRENT_SOURCE_DIR}/src/lv_languages/pl.ts)
prepareQM( ${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}")
set(QML_IMPORT_PATH ${QML_IMPORT_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "" FORCE)

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -10,43 +10,48 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls.Universal 2.12
import QtQuick.Window 2.12
Control {
height: 110
height: layout.height + 15
property string title: ""
property string help: ""
property bool lightMode: themeSwitch.lightMode
property string title: ""
property bool withTitle: false
clip: true
Metrix{
id: metrix
}
ColumnLayout {
LVMSwitch {
id: themeSwitch
text: qsTr("Light theme");
Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 30
}
id: layout
Label {
id: title_txt
text: title;
font.pixelSize: 24
wrapMode: Text.WordWrap
Layout.fillWidth: true
font.capitalization: Font.AllUppercase
font.bold: true
Layout.alignment: Qt.AlignLeft
visible: withTitle
}
Label {
id: help_txt
wrapMode: Text.WordWrap
text: help;
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
}
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: 15
anchors.bottomMargin: 30
spacing: 15
}
@ -55,13 +60,15 @@ Control {
color: "#bdb9bb"
anchors.bottom: parent.bottom
anchors.bottomMargin: 15
anchors.left: parent.left
anchors.leftMargin: 15
anchors.leftMargin: 0
anchors.right: parent.right
anchors.rightMargin: 15
anchors.rightMargin: 0
visible: withTitle
anchors.topMargin: 15
}
anchors.bottomMargin: 15
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,94 +1,90 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls.Universal 2.12
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls.Material 2.15
import QtQuick.Controls.Universal 2.15
Page {
height: 500
width: 400
id: root;
header: LVMHeader{
id: header
title: (conntent.isRegisterNewUser)? qsTr("Sign Up"): qsTr("Login In")
help: (conntent.isRegisterNewUser)? qsTr('please fill this form to create an account'):
qsTr('please fill this form to login in your account')
withTitle: privateRoot.withTitle
title: (privateRoot.isRegisterNewUser)? qsTr("Create a new account"): qsTr("LogIn")
help: (privateRoot.isRegisterNewUser)? qsTr('Please fill this form to create an account'):
qsTr('Please fill this form to login in your account')
}
property bool lightMode: header.lightMode
property var lognViewModel: null
property bool registerNewUser: true
property bool singleColumn: privateRoot.widgetsCount <= 1
Material.theme: (lightMode)? Material.Light: Material.Dark
Material.accent: (lightMode)? Material.LightBlue: Material.Orange
Universal.theme: (lightMode)? Material.Light: Material.Dark
Universal.accent: (lightMode)? Material.LightBlue: Material.Orange
signal loginClicked(var isregister);
contentItem:
Item {
id: conntent
property bool isRegisterNewUser: tabBar.currentIndex
property var errors: (lognViewModel)? lognViewModel.validationData : null
function clear() {
countryInput.currentIndex = -1
pass1.text = ""
pass2.text = ""
termOfUse.checked = false
}
Connections {
target: lognViewModel
function clearView () {
clear();
}
}
leftPadding: 0
rightPadding: 0
Flickable {
contentWidth: content.width
contentHeight: content.height
clip: true
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AsNeeded }
GridLayout {
rows: 8
columns: 2
rowSpacing: 15
columnSpacing: 15
id: content
function paswordValidation() {
if (lognViewModel) {
lognViewModel.data.rawPassword = pass1.text;
}
pass1.hasEdited = true
if (!conntent.isRegisterNewUser) {
return;
}
pass2.hasError = false;
pass2.tooltip = "";
if (pass1.text != pass2.text || pass1.length <= 0) {
pass2.hasError = true;
pass2.hasEdited = true;
pass2.tooltip = qsTr("Password must match the 1st field and the password cannot be empty");
}
}
columns: (singleColumn)? 1: Math.floor(root.width / childWidth)
width: root.width
columnSpacing: 15
rowSpacing: 0
property int childWidth: firstNameInput.height * 4
LVMTextInput {
id: firstNameInput
placeholderText: qsTr("First Name")
Layout.columnSpan: (content.width > 350)? 1 : 2;
Layout.fillWidth: true
visible: conntent.isRegisterNewUser
tooltip: (hasError)? qsTr("Empy or incorrect name. Please enter yuor name."): ""
hasError: (conntent.errors && conntent.errors.firstName);
visible: privateRoot.isRegisterNewUser && privateRoot.firstName
tooltip: (hasError)? qsTr("Empy or incorrect name. Please enter your name."): ""
hasError: (privateRoot.errors && privateRoot.errors.firstName);
onTextChanged: {
if (lognViewModel) {
lognViewModel.data.firstName = text;
}
hasEdited = true
}
text: (lognViewModel)? lognViewModel.data.firstName: "";
}
LVMTextInput {
id: lastNameInput
placeholderText: qsTr("Last Name")
Layout.columnSpan: (content.width > 350)? 1 : 2;
Layout.fillWidth: true
visible: conntent.isRegisterNewUser
hasError: (conntent.errors && conntent.errors.lastName);
visible: privateRoot.isRegisterNewUser && privateRoot.lastName
hasError: (privateRoot.errors && privateRoot.errors.lastName);
onTextChanged: {
if (lognViewModel) {
@ -97,27 +93,48 @@ Page {
hasEdited = true
}
text: (lognViewModel)? lognViewModel.data.lastName: "";
}
Item {
// separator
Layout.preferredHeight: 0
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.columnSpan: Math.max(content.columns, 1)
}
LVMComboBox {
id: countryInput
placeholderText: qsTr("Select you country")
Layout.columnSpan: 2
Layout.fillWidth: true
visible: conntent.isRegisterNewUser
visible: privateRoot.isRegisterNewUser && model.length
onCurrentIndexChanged: {
if (lognViewModel) {
lognViewModel.data.country = lognViewModel.countryCodeList[currentIndex];
}
}
}
Item {
// separator
Layout.preferredHeight: 0
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.columnSpan: Math.max(content.columns, 1)
}
LVMTextInput {
id: emailInput
placeholderText: qsTr("EMail")
Layout.columnSpan: 2
Layout.fillWidth: true
hasError: (conntent.errors && conntent.errors.email);
tooltip: (hasError)? qsTr("Empy or incorrect email address. Please enter yuor name.") : ""
visible: privateRoot.email
hasError: (privateRoot.errors && privateRoot.errors.email);
tooltip: (hasError)? qsTr("Empty or incorrect email address. Please enter your name.") : ""
onTextChanged: {
if (lognViewModel) {
lognViewModel.data.email = text;
@ -125,75 +142,68 @@ Page {
hasEdited = true
}
text: (lognViewModel)?lognViewModel.data.email: "";
}
LVMTextInput {
id: nicknameInput
placeholderText: qsTr("Nickname")
Layout.fillWidth: true
visible: privateRoot.nickName
hasError: (privateRoot.errors && privateRoot.errors.nickname);
tooltip: (hasError)? qsTr("Empty or incorrect Nickname. Please enter your name.") : ""
onTextChanged: {
if (lognViewModel) {
lognViewModel.data.nickname = text;
}
hasEdited = true
}
text: (lognViewModel)? lognViewModel.data.nickname: "";
}
Item {
// separator
Layout.preferredHeight: 0
Layout.fillWidth: true
Layout.columnSpan: Math.max(content.columns, 1)
}
LVMTextInput {
id: pass1
placeholderText: qsTr("Pasword")
Layout.columnSpan: (conntent.isRegisterNewUser)? ((content.width > 350)? 1 : 2): 2;
placeholderText: qsTr("password")
Layout.fillWidth: true
hasError: (conntent.errors && conntent.errors.rawPassword);
hasError: (privateRoot.errors && privateRoot.errors.rawPassword);
tooltip: (hasError)? lognViewModel.passwordError : ""
onTextChanged: {
content.paswordValidation()
privateRoot.paswordValidation()
}
visible: privateRoot.password
echoMode: TextInput.Password
}
LVMTextInput {
id: pass2
placeholderText: qsTr("Confirm pasword")
Layout.columnSpan: (content.width > 350)? 1 : 2;
placeholderText: qsTr("Confirm password")
Layout.fillWidth: true
visible: conntent.isRegisterNewUser
visible: privateRoot.isRegisterNewUser && privateRoot.password
onTextChanged: {
content.paswordValidation()
privateRoot.paswordValidation()
}
echoMode: TextInput.Password
}
LVMCheckBox {
id: termOfUse
text: qsTr("I accept the Terms of use")
Layout.columnSpan: (content.width > 350)? 1 : 2;
Layout.fillWidth: true
visible:conntent.isRegisterNewUser
}
LVMButton {
text: qsTr("Show terms of use")
visible: conntent.isRegisterNewUser
onClicked: {
if (lognViewModel) {
lognViewModel.showTermOfUseRequest();
}
}
}
LVMButton {
text: (conntent.isRegisterNewUser)? qsTr("Sign Up") : qsTr("Login In")
visible: true
enabled: (conntent.errors && conntent.errors.noError) &&
((conntent.isRegisterNewUser)? !pass2.hasError && termOfUse.checked: true)
onClicked: {
if (lognViewModel) {
if (conntent.isRegisterNewUser) {
lognViewModel.registerRequest();
} else {
lognViewModel.loginRequest();
}
}
}
}
LVMButton {
text: qsTr("Forgot password")
visible: !conntent.isRegisterNewUser
enabled: !(conntent.errors && conntent.errors.email)
visible: !privateRoot.isRegisterNewUser
enabled: !(privateRoot.errors && privateRoot.errors.email)
onClicked: {
if (lognViewModel) {
@ -201,25 +211,161 @@ Page {
}
}
}
anchors.bottomMargin: 40
anchors.leftMargin: 20
anchors.rightMargin: 20
anchors.fill: parent
Item {
// separator
Layout.preferredHeight: 0
Layout.fillWidth: true
Layout.columnSpan: Math.max(content.columns, 1)
}
LVMCheckBox {
id: termOfUse
text: qsTr("I accept the Terms of use")
Layout.fillWidth: true
visible:privateRoot.isRegisterNewUser && privateRoot.termOfuse
}
LVMButton {
text: qsTr("Show terms of use")
visible: privateRoot.isRegisterNewUser && privateRoot.termOfuse
onClicked: {
if (lognViewModel) {
lognViewModel.showTermOfUseRequest();
}
}
}
Item {
// separator
Layout.preferredHeight: 0
Layout.fillWidth: true
Layout.fillHeight: true
Layout.columnSpan: Math.max(content.columns, 1)
}
}
anchors.fill: parent
}
footer: TabBar {
id: tabBar
width: parent.width
currentIndex: registerNewUser
TabButton {
text: qsTr("Login In")
}
TabButton {
text: qsTr("Sign Up")
footer: ColumnLayout {
LVMButton {
text: privateRoot.acceptButtonText.length?
privateRoot.acceptButtonText:
(privateRoot.isRegisterNewUser)?
qsTr("SignUp"):
qsTr("LogIn")
visible: true
enabled: privateRoot.enableAccept(privateRoot.errors, privateRoot.isRegisterNewUser,
privateRoot.password, pass2.hasError, termOfUse.checked,
privateRoot.termOfuse)
onClicked: {
if (lognViewModel) {
if (privateRoot.isRegisterNewUser) {
lognViewModel.registerRequest();
} else {
lognViewModel.loginRequest();
}
}
loginClicked(privateRoot.isRegisterNewUser);
}
}
TabBar {
id: tabBar
visible: privateRoot.loginPage && privateRoot.registerPage
Layout.fillWidth: true
currentIndex: privateRoot.pageToIndex(privateRoot.currentPage)
TabButton {
text: qsTr("Login In")
}
TabButton {
text: qsTr("Sign Up")
}
onCurrentIndexChanged: {
if (lognViewModel) {
if (currentIndex)
lognViewModel.setCurrentPage(ViewComponents.sigupPage)
else
lognViewModel.setCurrentPage(ViewComponents.loginPage)
}
}
}
}
Item {
id: privateRoot;
// Private propertyes
property bool isRegisterNewUser: pageSelector(tabBar.currentIndex, registerPage, loginPage)
property var errors: (lognViewModel)? lognViewModel.validationData : null
property bool withTitle: (lognViewModel)? lognViewModel.fTitle: false
property bool lastName: (lognViewModel)? lognViewModel.fLastName: false
property bool firstName: (lognViewModel)? lognViewModel.fFirstName: false
property bool nickName: (lognViewModel)? lognViewModel.fNickname: false
property bool email: (lognViewModel)? lognViewModel.fEMail: false
property bool password: (lognViewModel)? lognViewModel.fPassword: false
property bool loginPage: (lognViewModel)? lognViewModel.fLogin: false
property bool registerPage: (lognViewModel)? lognViewModel.fRegister: false
property bool termOfuse: (lognViewModel)? lognViewModel.fTermOfUse: false
property int currentPage: (lognViewModel)? lognViewModel.currentPage: 0
property string acceptButtonText: (lognViewModel)? lognViewModel.acceptButtonText: false
property int widgetsCount: lastName + firstName + nickName + email + password + withTitle
function pageSelector(toolBarIndex, registerPage, loginPage) {
if (registerPage && loginPage)
return toolBarIndex;
return registerPage;
}
function pageToIndex(currentPage) {
return currentPage === ViewComponents.sigupPage
}
function paswordValidation() {
if (lognViewModel) {
lognViewModel.data.rawPassword = pass1.text;
}
pass1.hasEdited = true
if (!privateRoot.isRegisterNewUser) {
return;
}
pass2.hasError = false;
pass2.tooltip = "";
if (pass1.text != pass2.text || pass1.length <= 0) {
pass2.hasError = true;
pass2.hasEdited = true;
pass2.tooltip = qsTr("Password must match the 1st field and the password cannot be empty");
}
}
function enableAccept(errors, isRegisterNewUser, fShowPassword,
passHasError, termOfUse, fShowTermOfUse) {
if (!(errors && errors.noError)) {
return false;
}
if (isRegisterNewUser && fShowPassword) {
return !passHasError && (termOfUse || !fShowTermOfUse)
}
return true;
}
}
}

@ -0,0 +1,37 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls.Universal 2.12
import QtQuick.Window 2.12
Popup {
id: root
property var lognViewModel: null
property real point: metrix.pt
property bool singleColumn: false
width: Math.max(5 * point, parent.width * 0.5)
height: Math.max(4 * point, parent.height * 0.5)
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
Metrix {
id: metrix
}
contentItem: LoginView {
id: source
lognViewModel: root.lognViewModel
singleColumn: root.singleColumn
onLoginClicked: {
root.close();
}
}
onClosed: {
source.clear();
}
}

@ -0,0 +1,40 @@
/*
* Copyright (C) 2021-2021 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Controls 2.15
Item {
readonly property int pointCount: 100;
readonly property real mm: Screen.pixelDensity
readonly property real sm: 10 * mm
readonly property real dsm: Math.sqrt(Math.pow(Screen.desktopAvailableWidth, 2) + Math.pow(Screen.desktopAvailableHeight, 2)) / sm
readonly property real pt: getfactor(dsm) * sm
readonly property real controlPtMaterial: Material.buttonHeight
readonly property real gamePt: (width < height) ? width / pointCount : height / pointCount;
readonly property real fontPoints: textMetrics.averageCharacterWidth;
function getfactor(dsm) {
if ( dsm < 70) {
return 1
} else if (dsm < 140) {
return 2;
} else
return 4;
}
FontMetrics {
id: textMetrics
font.bold: true
font.capitalization: Font.AllUppercase
}
anchors.fill: parent;
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,2 +1,3 @@
module LoginViewModule
LoginView 1.0 LoginView.qml
LoginViewDialog 1.0 LoginViewDialog.qml

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -41,7 +41,7 @@ bool CountrysParser::parseXMLSource(const QString &xmlFile, QHash<int, QString>
break;
}
if (token == QXmlStreamReader::StartElement && xml.name() == "countries") {
if (token == QXmlStreamReader::StartElement && xml.name() == QString("countries")) {
success = parseCountries(xml, result);
break;
}
@ -81,20 +81,20 @@ bool CountrysParser::parseCountry(QXmlStreamReader& xml, QHash<int, QString>& re
int code = 0;
QString name;
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == "country")) {
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == QString("country"))) {
if (!isValidItem(xml)) {
return false;
}
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "code") {
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("code")) {
code = getCode(xml);
if (code < 0) {
qDebug() << "error parse, code of country is invalid: line "
<< xml.lineNumber();
return false;
}
} else if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "name") {
} else if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("name")) {
name = getName(xml);
if (name.isEmpty()) {
qDebug() << "error parse, name of country is empty: line "
@ -113,13 +113,13 @@ bool CountrysParser::parseCountries(QXmlStreamReader &xml, QHash<int, QString>&
if (xml.tokenType() != QXmlStreamReader::StartElement)
return false;
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == "countries")) {
while (!(xml.readNext() == QXmlStreamReader::EndElement && xml.name() == QString("countries"))) {
if (!isValidItem(xml)) {
return false;
}
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == "country" && !parseCountry(xml, result)) {
if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == QString("country") && !parseCountry(xml, result)) {
return false;
}
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.

@ -1,12 +1,12 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef NOTIFYSERVICE_GLOBAL_H
#define NOTIFYSERVICE_GLOBAL_H
#ifndef LOGINVIEW_GLOBAL_H
#define LOGINVIEW_GLOBAL_H
#include <QtCore/qglobal.h>
@ -17,4 +17,4 @@
#endif
#endif // NOTIFYSERVICE_GLOBAL_H
#endif // LOGINVIEW_GLOBAL_H

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE" sourcelanguage="en">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Ein neues Konto erstellen</translation>
</message>
<message>
<source>LogIn</source>
<translation>Anmeldung</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Bitte füllen Sie dieses Formular aus, um ein Konto zu erstellen</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Bitte füllen Sie dieses Formular aus, um sich in Ihrem Konto anzumelden</translation>
</message>
<message>
<source>First Name</source>
<translation>Vorname</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Leerer oder falscher Name. Bitte geben Sie Ihren Namen ein.</translation>
</message>
<message>
<source>Last Name</source>
<translation>Nachname</translation>
</message>
<message>
<source>Select you country</source>
<translation>Wählen Sie Ihr Land aus</translation>
</message>
<message>
<source>EMail</source>
<translation>Email</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Leere oder falsche E-Mail-Adresse. Bitte geben Sie Ihren Namen ein.</translation>
</message>
<message>
<source>Nickname</source>
<translation>Spitzname</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Leerer oder falscher Spitzname. Bitte geben Sie Ihren Namen ein.</translation>
</message>
<message>
<source>password</source>
<translation>Passwort</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Kennwort bestätigen</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Passwort vergessen</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Ich akzeptiere die Nutzungsbedingungen</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Nutzungsbedingungen anzeigen</translation>
</message>
<message>
<source>SignUp</source>
<translation>Anmeldung</translation>
</message>
<message>
<source>Login In</source>
<translation>Einloggen in</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Anmeldung</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Das Passwort muss mit dem 1. Feld übereinstimmen und das Passwort darf nicht leer sein</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>muss länger als 8 Zeichen sein</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>muss Zahlen enthalten</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>muss kleine Zeichen enthalten</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>muss große Zeichen enthalten</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>muss zusätzliche Zeichen enthalten (!@#$%^&amp;*)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Passwortanforderungen:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Create a new account</translation>
</message>
<message>
<source>LogIn</source>
<translation>LogIn</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Please fill this form to create an account</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Please fill this form to login in your account</translation>
</message>
<message>
<source>First Name</source>
<translation>First Name</translation>
</message>
<message>
<source>Last Name</source>
<translation>Last Name</translation>
</message>
<message>
<source>Select you country</source>
<translation>Select you country</translation>
</message>
<message>
<source>EMail</source>
<translation>EMail</translation>
</message>
<message>
<source>Nickname</source>
<translation>Nickname</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Empy or incorrect name. Please enter your name.</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Empty or incorrect email address. Please enter your name.</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Empty or incorrect Nickname. Please enter your name.</translation>
</message>
<message>
<source>password</source>
<translation>password</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Confirm password</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Forgot password</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>I accept the Terms of use</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Show terms of use</translation>
</message>
<message>
<source>SignUp</source>
<translation>SignUp</translation>
</message>
<message>
<source>Login In</source>
<translation>Login In</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Sign Up</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Password must match the 1st field and the password cannot be empty</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>must be longer than 8 characters</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>must contain numbers</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>must contain small chars</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>must contain large chars</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>must contain extra chars (!@#$%^&amp;*)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Password requirements: </translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es" sourcelanguage="en">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Crea una cuenta nueva</translation>
</message>
<message>
<source>LogIn</source>
<translation>Acceso</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Por favor complete este formulario para crear una cuenta</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Complete este formulario para iniciar sesión en su cuenta</translation>
</message>
<message>
<source>First Name</source>
<translation>Primer nombre</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Nombre vacío o incorrecto. Por favor, escriba su nombre.</translation>
</message>
<message>
<source>Last Name</source>
<translation>Apellido</translation>
</message>
<message>
<source>Select you country</source>
<translation>Selecciona tu pais</translation>
</message>
<message>
<source>EMail</source>
<translation>Email</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Dirección de correo electrónico vacía o incorrecta. Por favor, escriba su nombre.</translation>
</message>
<message>
<source>Nickname</source>
<translation>Apodo</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Apodo vacío o incorrecto. Por favor, escriba su nombre.</translation>
</message>
<message>
<source>password</source>
<translation>contraseña</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Confirmar Contraseña</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Se te olvidó tu contraseña</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Acepto los términos de uso</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Mostrar condiciones de uso</translation>
</message>
<message>
<source>SignUp</source>
<translation>Inscribirse</translation>
</message>
<message>
<source>Login In</source>
<translation>Iniciar sesión en</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Inscribirse</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>La contraseña debe coincidir con el primer campo y la contraseña no puede estar vacía</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>debe tener más de 8 caracteres</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>debe contener números</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>debe contener caracteres pequeños</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>debe contener caracteres grandes</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>debe contener caracteres adicionales (! @ # $% ^ &amp; *)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Requisitos de contraseña:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR" sourcelanguage="en">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Créer un nouveau compte</translation>
</message>
<message>
<source>LogIn</source>
<translation>Connexion</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Veuillez remplir ce formulaire pour créer un compte</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Veuillez remplir ce formulaire pour vous connecter à votre compte</translation>
</message>
<message>
<source>First Name</source>
<translation>Prénom</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Nom vide ou incorrect. S&apos;il vous plaît entrez votre nom.</translation>
</message>
<message>
<source>Last Name</source>
<translation>Nom de famille</translation>
</message>
<message>
<source>Select you country</source>
<translation>Sélectionnez votre pays</translation>
</message>
<message>
<source>EMail</source>
<translation>E-mail</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Adresse e-mail vide ou incorrecte. S&apos;il vous plaît entrez votre nom.</translation>
</message>
<message>
<source>Nickname</source>
<translation>Surnom</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Pseudo vide ou incorrect. S&apos;il vous plaît entrez votre nom.</translation>
</message>
<message>
<source>password</source>
<translation>le mot de passe</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Confirmez le mot de passe</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Mot de passe oublié</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>J&apos;accepte les conditions d&apos;utilisation</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Afficher les conditions d&apos;utilisation</translation>
</message>
<message>
<source>SignUp</source>
<translation>S&apos;inscrire</translation>
</message>
<message>
<source>Login In</source>
<translation>Se connecter</translation>
</message>
<message>
<source>Sign Up</source>
<translation>S&apos;inscrire</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Le mot de passe doit correspondre au 1er champ et le mot de passe ne peut pas être vide</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>doit comporter plus de 8 caractères</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>doit contenir des chiffres</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>doit contenir de petits caractères</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>doit contenir de gros caractères</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>doit contenir des caractères supplémentaires (!@#$%^&amp;*)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Exigences de mot de passe&#xa0;:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation></translation>
</message>
<message>
<source>LogIn</source>
<translation></translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation></translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation></translation>
</message>
<message>
<source>First Name</source>
<translation></translation>
</message>
<message>
<source>Last Name</source>
<translation></translation>
</message>
<message>
<source>Select you country</source>
<translation></translation>
</message>
<message>
<source>EMail</source>
<translation>Eメール</translation>
</message>
<message>
<source>Nickname</source>
<translation></translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>password</source>
<translation></translation>
</message>
<message>
<source>Confirm password</source>
<translation></translation>
</message>
<message>
<source>Forgot password</source>
<translation></translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation></translation>
</message>
<message>
<source>Show terms of use</source>
<translation></translation>
</message>
<message>
<source>SignUp</source>
<translation></translation>
</message>
<message>
<source>Login In</source>
<translation></translation>
</message>
<message>
<source>Sign Up</source>
<translation></translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation></translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>8</translation>
</message>
<message>
<source>must contain numbers</source>
<translation></translation>
</message>
<message>
<source>must contain small chars</source>
<translation></translation>
</message>
<message>
<source>must contain large chars</source>
<translation></translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>@$^*</translation>
</message>
<message>
<source>Password requirements: </source>
<translation></translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl_PL" sourcelanguage="en">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Stwórz nowe konto</translation>
</message>
<message>
<source>LogIn</source>
<translation>Zaloguj sie</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Wypełnij ten formularz, aby utworzyć konto</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Wypełnij ten formularz, aby zalogować się na swoje konto</translation>
</message>
<message>
<source>First Name</source>
<translation>Imię</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Pusta lub nieprawidłowa nazwa. Proszę wpisać swoje imię.</translation>
</message>
<message>
<source>Last Name</source>
<translation>Nazwisko</translation>
</message>
<message>
<source>Select you country</source>
<translation>Wybierz swój kraj</translation>
</message>
<message>
<source>EMail</source>
<translation>E-mail</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Pusty lub nieprawidłowy adres e-mail. Proszę wpisać swoje imię.</translation>
</message>
<message>
<source>Nickname</source>
<translation>Przezwisko</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Pusty lub nieprawidłowy pseudonim. Proszę wpisać swoje imię.</translation>
</message>
<message>
<source>password</source>
<translation>hasło</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Potwierdź hasło</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Zapomniałeś hasła</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Akceptuję warunki użytkowania</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Pokaż warunki użytkowania</translation>
</message>
<message>
<source>SignUp</source>
<translation>Zapisz się</translation>
</message>
<message>
<source>Login In</source>
<translation>Zaloguj się</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Zapisz się</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Hasło musi pasować do pierwszego pola i hasło nie może być puste</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>musi być dłuższy niż 8 znaków</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>musi zawierać liczby</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>musi zawierać małe znaki</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>musi zawierać duże znaki</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>musi zawierać dodatkowe znaki (!@#$%^&amp;*)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Wymagania dotyczące hasła:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Создать новый аккаунт</translation>
</message>
<message>
<source>LogIn</source>
<translation>Логин</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Пожалуйста, заполните эту форму, чтобы создать аккаунт</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Пожалуйста, заполните эту форму, чтобы войти в аккаунт</translation>
</message>
<message>
<source>First Name</source>
<translation>Имя</translation>
</message>
<message>
<source>Last Name</source>
<translation>Фамилия</translation>
</message>
<message>
<source>Select you country</source>
<translation>Выберите вашу страну</translation>
</message>
<message>
<source>EMail</source>
<translation>EMail</translation>
</message>
<message>
<source>Nickname</source>
<translation>Никнейм</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Незаполненная строка или неподходящее имя.</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Незаполненная строка или неверный email.</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Незаполненная строка или некорректный никнейм.</translation>
</message>
<message>
<source>password</source>
<translation>Пароль</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Подтвердить Пароль</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Забыл пароль</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Я принимаю условия использования</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Показать условия использования</translation>
</message>
<message>
<source>SignUp</source>
<translation>Регистрация</translation>
</message>
<message>
<source>Login In</source>
<translation>Войти</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Регистрация</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Пароль должен соответствовать 1-му полю, и не может быть пустым.</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>Должен быть длиннее 8 символов</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>Должен содержать числа</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>Должен содержать строчные буквы</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>Должен содержать заглавные буквы</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>Должен содержать особые символы (! @ # $% ^ &amp; *)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Требования к паролю:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr_TR">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Yeni bir hesap oluştur</translation>
</message>
<message>
<source>LogIn</source>
<translation>Oturum </translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Lütfen bir hesap oluşturmak için bu formu doldurun</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Lütfen hesabınıza giriş yapmak için bu formu doldurun</translation>
</message>
<message>
<source>First Name</source>
<translation>İsim</translation>
</message>
<message>
<source>Last Name</source>
<translation>Soyadı</translation>
</message>
<message>
<source>Select you country</source>
<translation>Ülkenizi seçin</translation>
</message>
<message>
<source>EMail</source>
<translation>EMail</translation>
</message>
<message>
<source>Nickname</source>
<translation>Takma ad</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Boş veya yanlış isim. Lütfen adınızı giriniz.</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>E-posta adresi boş veya yanlış. Lütfen adınızı giriniz.</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Boş veya yanlış Takma ad. Lütfen adınızı giriniz.</translation>
</message>
<message>
<source>password</source>
<translation>Parola</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Şifreyi Onayla</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Parolanızı mı unuttunuz</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Kullanım şartlarını kabul ediyorum</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Kullanım şartlarını göster</translation>
</message>
<message>
<source>SignUp</source>
<translation>Kaydol</translation>
</message>
<message>
<source>Login In</source>
<translation>Giriş yap</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Kaydol</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Parola 1. alanla eşleşmelidir ve parola boş olamaz</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>8 karakterden uzun olmalıdır</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>sayı içermelidir</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>Küçük karakterler içermelidir</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>büyük karakterler içermelidir</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>Ekstra karakterler içermelidir (! @ # $% ^ &amp; *)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Parola gereksinimleri:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="uk_UA">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation>Вимоги до пароля:</translation>
</message>
<message>
<source>LogIn</source>
<translation>Логін</translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation>Заповніть цю форму, щоб створити обліковий запис</translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation>Заповніть цю форму, щоб увійти у свій обліковий запис</translation>
</message>
<message>
<source>First Name</source>
<translation>Ім&apos;я</translation>
</message>
<message>
<source>Last Name</source>
<translation>Прізвище</translation>
</message>
<message>
<source>Select you country</source>
<translation>Виберіть країну</translation>
</message>
<message>
<source>EMail</source>
<translation>EMail</translation>
</message>
<message>
<source>Nickname</source>
<translation>Прізвисько</translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation>Порожня або неправильна назва. Введіть своє ім&apos;я.</translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation>Порожня або неправильна назва. Введіть своє ім&apos;я.</translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation>Порожній або неправильний псевдонім. Введіть своє ім&apos;я.</translation>
</message>
<message>
<source>password</source>
<translation>Пароль</translation>
</message>
<message>
<source>Confirm password</source>
<translation>Підтвердьте пароль</translation>
</message>
<message>
<source>Forgot password</source>
<translation>Забули пароль</translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>Я приймаю умови використання</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>Показати умови використання</translation>
</message>
<message>
<source>SignUp</source>
<translation>Реєстрація</translation>
</message>
<message>
<source>Login In</source>
<translation>Вхід</translation>
</message>
<message>
<source>Sign Up</source>
<translation>Зареєструйтесь</translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation>Пароль повинен відповідати 1-му полю, і пароль не може бути порожнім</translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation>Має містити більше 8 символів</translation>
</message>
<message>
<source>must contain numbers</source>
<translation>Повинні містити цифри</translation>
</message>
<message>
<source>must contain small chars</source>
<translation>Повинен містити невеликі символи</translation>
</message>
<message>
<source>must contain large chars</source>
<translation>Повинен містити великі символи</translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation>Повинен містити додаткові символи (! @ # $% ^ &amp; *)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation>Вимоги до пароля:</translation>
</message>
</context>
</TS>

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN" sourcelanguage="en">
<context>
<name>LoginView</name>
<message>
<source>Create a new account</source>
<translation></translation>
</message>
<message>
<source>LogIn</source>
<translation></translation>
</message>
<message>
<source>Please fill this form to create an account</source>
<translation></translation>
</message>
<message>
<source>Please fill this form to login in your account</source>
<translation></translation>
</message>
<message>
<source>First Name</source>
<translation></translation>
</message>
<message>
<source>Empy or incorrect name. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>Last Name</source>
<translation></translation>
</message>
<message>
<source>Select you country</source>
<translation></translation>
</message>
<message>
<source>EMail</source>
<translation></translation>
</message>
<message>
<source>Empty or incorrect email address. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>Nickname</source>
<translation></translation>
</message>
<message>
<source>Empty or incorrect Nickname. Please enter your name.</source>
<translation> </translation>
</message>
<message>
<source>password</source>
<translation></translation>
</message>
<message>
<source>Confirm password</source>
<translation></translation>
</message>
<message>
<source>Forgot password</source>
<translation></translation>
</message>
<message>
<source>I accept the Terms of use</source>
<translation>使</translation>
</message>
<message>
<source>Show terms of use</source>
<translation>使</translation>
</message>
<message>
<source>SignUp</source>
<translation></translation>
</message>
<message>
<source>Login In</source>
<translation></translation>
</message>
<message>
<source>Sign Up</source>
<translation></translation>
</message>
<message>
<source>Password must match the 1st field and the password cannot be empty</source>
<translation></translation>
</message>
</context>
<context>
<name>LoginView::LVMainModel</name>
<message>
<source>must be longer than 8 characters</source>
<translation> 8 </translation>
</message>
<message>
<source>must contain numbers</source>
<translation></translation>
</message>
<message>
<source>must contain small chars</source>
<translation></translation>
</message>
<message>
<source>must contain large chars</source>
<translation></translation>
</message>
<message>
<source>must contain extra chars (!@#$%^&amp;*)</source>
<translation> (!@#$%^&amp;*)</translation>
</message>
<message>
<source>Password requirements: </source>
<translation></translation>
</message>
</context>
</TS>

@ -9,5 +9,17 @@
<file>LoginViewModule/LVMCheckBox.qml</file>
<file>LoginViewModule/LVMButton.qml</file>
<file>LoginViewModule/ValidatIonIndicator.qml</file>
<file>LoginViewModule/LoginViewDialog.qml</file>
<file>LoginViewModule/Metrix.qml</file>
<file>lv_languages/tr.qm</file>
<file>lv_languages/ru.qm</file>
<file>lv_languages/ja.qm</file>
<file>lv_languages/en.qm</file>
<file>lv_languages/uk.qm</file>
<file>lv_languages/pl.qm</file>
<file>lv_languages/es.qm</file>
<file>lv_languages/fr.qm</file>
<file>lv_languages/de.qm</file>
<file>lv_languages/zh.qm</file>
</qresource>
</RCC>

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -11,6 +11,7 @@
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
#include <QRegularExpression>
namespace LoginView {
@ -30,7 +31,7 @@ LVMainModel::~LVMainModel() {
}
}
bool LVMainModel::setCounrySource(const QString &path) {
bool LVMainModel::setCountriesSource(const QString &path) {
if (!m_countrysParser) {
m_countrysParser = new CountrysParser();
@ -58,6 +59,7 @@ bool LVMainModel::init( QQmlApplicationEngine *engine) {
engine->addImportPath(":/");
root->setContextProperty(m_modelName, this);
root->setContextProperty("ViewComponents", QVariant::fromValue(ViewComponentsQML{}));
qRegisterMetaType<LoginView::UserData>("UserData");
qRegisterMetaType<LoginView::UserViewValidationData>("UserViewValidationData");
@ -93,7 +95,7 @@ void LVMainModel::setCountry(int country) {
emit countryListChanged();
}
void LVMainModel::setData(UserData data) {
void LVMainModel::setData(const UserData& data) {
if (m_data == data)
return;
@ -102,6 +104,14 @@ void LVMainModel::setData(UserData data) {
emit dataChanged(m_data);
}
void LVMainModel::setAcceptButtonText(const QString &acceptButtonText) {
if (m_acceptButtonText == acceptButtonText)
return;
m_acceptButtonText = acceptButtonText;
emit acceptButtonTextChanged(m_acceptButtonText);
}
void LVMainModel::setPasswordError(QString passwordError) {
if (m_passwordError == passwordError)
return;
@ -110,6 +120,79 @@ void LVMainModel::setPasswordError(QString passwordError) {
emit passwordErrorChanged(m_passwordError);
}
ViewComponents LVMainModel::components() const {
return m_components;
}
void LVMainModel::setComponents(const ViewComponents &components) {
if (m_components != components) {
m_components = components;
emit showChanged();
}
}
bool LVMainModel::fTitle() const {
return m_components & ViewComponents::Title;
}
bool LVMainModel::fFirstName() const {
return m_components & ViewComponents::FirstName;
}
bool LVMainModel::fLastName() const {
return m_components & ViewComponents::LastName;
}
bool LVMainModel::fNickname() const {
return m_components & ViewComponents::Nickname;
}
bool LVMainModel::fPassword() const {
return m_components & ViewComponents::Password;
}
bool LVMainModel::fEMail() const {
return m_components & ViewComponents::EMail;
}
bool LVMainModel::fRegister() const {
return m_components & ViewComponents::SigupPage;
}
bool LVMainModel::fTermOfUse() const {
return m_components & ViewComponents::TermOfUse;
}
bool LVMainModel::fLogin() const {
return m_components & ViewComponents::LoginPage;
}
void LVMainModel::clear() {
emit clearView();
setData({});
}
QString LVMainModel::acceptButtonText() const {
return m_acceptButtonText;
}
void LVMainModel::setCurrentPage(int page) {
if (page == m_currentPage) {
return;
}
if (!(page & m_components)) {
return;
}
m_currentPage = static_cast<ViewComponents>(page);
emit currentPageChanged(page);
}
ViewComponents LVMainModel::currentPage() const {
return m_currentPage;
}
void LVMainModel::setValidData(UserViewValidationData validationData) {
if (m_validationData == validationData)
return;
@ -146,36 +229,40 @@ void LVMainModel::checkValid(const UserData& data) {
UserViewValidationData result;
result.setEmail(!data.email().contains(QRegExp("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$")));
result.setCountry(!m_countryList.contains(data.country()));
result.setLastName(false);
result.setFirstName(data.firstName().contains(" ") || data.firstName().isEmpty());
result.setNickname(fNickname() && (data.nickname().contains(" ") || data.nickname().isEmpty()));
result.setEmail(fEMail() && !data.email().contains(QRegularExpression("^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$")));
result.setCountry(m_countryList.size() && !m_countryList.contains(data.country()));
result.setLastName(fLastName() && false);
result.setFirstName(fFirstName() && (data.firstName().contains(" ") || data.firstName().isEmpty()));
bool passwordValidation = true;
if (m_validLvl & PasswordValidationLvl::Size8andMore) {
passwordValidation = passwordValidation &&
data.rawPassword().length() >= 8;
}
if (fPassword()) {
if (m_validLvl & PasswordValidationLvl::Size8andMore) {
passwordValidation = passwordValidation &&
data.rawPassword().length() >= 8;
}
if (m_validLvl & PasswordValidationLvl::NumberChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegExp("[0-9]"));
}
if (m_validLvl & PasswordValidationLvl::NumberChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegularExpression("[0-9]"));
}
if (m_validLvl & PasswordValidationLvl::LitinSmallChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegExp("[a-z]"));
}
if (m_validLvl & PasswordValidationLvl::LitinSmallChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegularExpression("[a-z]"));
}
if (m_validLvl & PasswordValidationLvl::LatinLargeChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegExp("[A-Z]"));
}
if (m_validLvl & PasswordValidationLvl::LatinLargeChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegularExpression("[A-Z]"));
}
if (m_validLvl & PasswordValidationLvl::ExtraChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegularExpression("[!@#$%^&*]"));
}
if (m_validLvl & PasswordValidationLvl::ExtraChars) {
passwordValidation = passwordValidation &&
data.rawPassword().contains(QRegExp("[!@#$%^&*]"));
}
result.setRawPassword(!passwordValidation);

@ -1,15 +1,18 @@
//#
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef LOGINVIEWMODEL_H
#define LOGINVIEWMODEL_H
#include <QHash>
#include <QObject>
#include "viewcomponents.h"
#include "loginview_global.h"
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "userdata.h"
#include "userviewvalidationdata.h"
@ -26,94 +29,315 @@ namespace LoginView {
* by default: Size8andMore | LitinSmallChars | LatinLargeChars
*/
enum PasswordValidationLvl {
/// Skip all validation of password
NoValidation = 0x00,
/// Check size. Size must be large than 8 chars.
Size8andMore = 0x01,
/// Check chars. Password must be contains a numbers.
NumberChars = 0x02,
/// Check chars. Password must be contains small chars.
LitinSmallChars = 0x04,
/// Check chars. Password must be contains large chars.
LatinLargeChars = 0x08,
/// Check chars. Password must be contains extra chars. Example: (%.~*^#).
ExtraChars = 0x10
};
class LOGINVIEW_EXPORT LVMainModel : public QObject
/**
* @brief The LVMainModel class is main model of the qml login view.
*/
class LOGINVIEW_EXPORT LVMainModel: public QObject
{
Q_OBJECT
Q_PROPERTY(QStringList countryList READ countryList NOTIFY countryListChanged)
Q_PROPERTY(QList<int> countryCodeList READ countryCodeList NOTIFY countryCodeListChanged)
Q_PROPERTY(bool fTitle READ fTitle NOTIFY showChanged)
Q_PROPERTY(bool fLastName READ fLastName NOTIFY showChanged)
Q_PROPERTY(bool fFirstName READ fFirstName NOTIFY showChanged)
Q_PROPERTY(bool fNickname READ fNickname NOTIFY showChanged)
Q_PROPERTY(bool fEMail READ fEMail NOTIFY showChanged)
Q_PROPERTY(bool fRegister READ fRegister NOTIFY showChanged)
Q_PROPERTY(bool fLogin READ fLogin NOTIFY showChanged)
Q_PROPERTY(bool fPassword READ fPassword NOTIFY showChanged)
Q_PROPERTY(bool fTermOfUse READ fTermOfUse NOTIFY showChanged)
Q_PROPERTY(int currentPage READ currentPage NOTIFY currentPageChanged)
Q_PROPERTY(int country READ country WRITE setCountry NOTIFY countryChanged)
Q_PROPERTY(UserData data READ data WRITE setData NOTIFY dataChanged)
Q_PROPERTY(UserViewValidationData validationData READ validData WRITE setValidData NOTIFY validDataChanged)
Q_PROPERTY(QString passwordError READ passwordError WRITE setPasswordError NOTIFY passwordErrorChanged)
Q_PROPERTY(QString acceptButtonText READ acceptButtonText WRITE setAcceptButtonText NOTIFY acceptButtonTextChanged)
public:
explicit LVMainModel(const QString modelName,
QObject *parent = nullptr);
~LVMainModel();
/**
* @brief setCounrySource - sets path to xml source file and extract list of countrys
* @param path
* @return true if the function finished successful
* @brief setCountriesSource This method sets path to xml source file and extract list of countrys.
* @param path This is path to xml sources of countries.
* @return True if the function finished successful.
*/
Q_INVOKABLE bool setCounrySource(const QString &path);
Q_INVOKABLE bool setCountriesSource(const QString &path);
/**
* @brief init - prepare all items for use on qml.
* @param engine - current qml engine of application
* @return true if the function finished successful
* @brief init Prepare all items for use on qml.
* @param engine Current qml engine of application.
* @return True if the function finished successful.
*/
bool init(QQmlApplicationEngine *engine);
/**
* @brief country This method return current country id.
* @return Current country id.
*/
int country() const;
/**
* @brief countryList This method retun list of availabel countries.
* @return string list of available countries.
*/
QStringList countryList() const;
/**
* @brief data This method return information of created or logined user.
* @return Return information of created or logined user.
*/
UserData data() const;
/**
* @brief validData This method return structure that display valid data.
* @return Information about last validation.
*/
UserViewValidationData validData() const;
/**
* @brief passwordError This method return text message about last password error.
* For get more information about password errors see the PasswordValidationLvl enum.
* @return Error message.
*/
QString passwordError() const;
/**
* @brief countryCodeList This method return the list of ids of the countries.
* @return Countries ids.
*/
QList<int> countryCodeList() const;
/**
* @brief loginRequest This method invoked when user click the login button.
*/
Q_INVOKABLE void loginRequest();
/**
* @brief rememberPasswordRequest This method invoked when user click the forgetpassword button.
*/
Q_INVOKABLE void rememberPasswordRequest();
/**
* @brief registerRequest This method invoked when user click the signUp button.
*/
Q_INVOKABLE void registerRequest();
/**
* @brief showTermOfUseRequest This method invoked when user click the "show temr of use" button.
*/
Q_INVOKABLE void showTermOfUseRequest();
/**
* @brief components This method return visible comonents of this model.
* @return return information about visible companents of Qml View. for more information see the ViewComponents enum.
*/
ViewComponents components() const;
/**
* @brief setComponents This method sets visibel companents of the qml view.
* @param components This is enum with visible companents. For get more information see Thee ViewComponents enum class.
*/
void setComponents(const ViewComponents &components);
/**
* @brief fTitle This method return Title visible state.
* @return Title visible state.
*/
bool fTitle() const;
/**
* @brief fFirstName This method return first name visible state.
* @return First name visible state.
*/
bool fFirstName() const;
/**
* @brief fLastName This method return last name visible state.
* @return Last name visible state.
*/
bool fLastName() const;
/**
* @brief fNickname This method return nickname visible state.
* @return Nickname visible state.
*/
bool fNickname() const;
/**
* @brief fPassword This method return password visible state.
* @return Password visible state.
*/
bool fPassword() const;
/**
* @brief fEMail This method return email visible state.
* @return Email visible state.
*/
bool fEMail() const;
/**
* @brief fRegister This method return register page visible state.
* @return Register page visible state.
*/
bool fRegister() const;
/**
* @brief fTermOfUse This method return term of use widgets visible state.
* @return Term of use widgets visible state.
*/
bool fTermOfUse() const;
/**
* @brief fLogin This method return login page visible state.
* @return Login page visible state.
*/
bool fLogin() const;
/**
* @brief fSigupDefaultPage return true if the default page is the sigup page.
* @return True if the default page is the sigup page.
*/
bool fSigupDefaultPage() const;
/**
* @brief clear - Clear all data from view.
*/
void clear();
/**
* @brief acceptButtonText This method return alternative text of the accept button.
* @return Alternative text of the accept button.
*/
QString acceptButtonText() const;
/**
* @brief setDefaultPage Sets visible page.
* @param page new default page (RegisterPage or LoginPage).
*/
Q_INVOKABLE void setCurrentPage(int page);
/**
* @brief currentPage Return id of the current page.
* @return Id of the current page.
*/
ViewComponents currentPage() const;
public slots:
/**
* @brief setCountry This slot sets current country. This method work with qml View and invoked when user change own country.
* @param country This is new country id.
*/
void setCountry(int country);
void setData(UserData data);
/**
* @brief setData Sets new data for view on qml page.
* @param data New user data.
*/
void setData(const UserData &data);
/**
* @brief setAcceptButtonText This method sets new test of the accept button. Use this method if you want change test on main button.
* @param acceptButtonText New text of the accept button.
*/
void setAcceptButtonText(const QString& acceptButtonText);
signals:
/**
* @brief countryChanged This signal emited when country on page is will be changed.
* @param country New country id.
*/
void countryChanged(int country);
/**
* @brief countryListChanged This method emited when available country list will be changed.
*/
void countryListChanged();
/**
* @brief countryCodeListChanged This method emited when available country list will be changed.
*/
void countryCodeListChanged();
/**
* @brief sigLoginRequest
* emited when user try login
* @brief sigLoginRequest
* Emited when user try login.
*/
void sigLoginRequest(UserData);
void sigLoginRequest(const UserData&);
/**
* @brief sigRegisterRequest
* emited when user try create new accaunt
* Emited when user try create new account.
*/
void sigRegisterRequest(UserData);
void sigRegisterRequest(const UserData&);
/**
* @brief sigForgotPasswordRequest
* emited when user forgot own password
* Emited when user forgot own password.
*/
void sigForgotPasswordRequest(UserData);
void sigForgotPasswordRequest(const UserData&);
/**
* @brief sigShowTermOfUseRequest
* emited when user click on "Show term of use" button
* Emited when user click on "Show term of use" button.
*/
void sigShowTermOfUseRequest();
/**
* @brief dataChanged Emited when data of qml form will be changed.
* @param data New data of qml form.
*/
void dataChanged(UserData data);
/**
* @brief validDataChanged This method emited when model is finished validation of the accepted user data.
* @param validationData This is validation results.
*/
void validDataChanged(UserViewValidationData validationData);
/**
* @brief passwordErrorChanged This method will be emited when user password have a any error.
* @param passwordError This is new erro message of user password.
*/
void passwordErrorChanged(QString passwordError);
/**
* @brief showChanged This signal emited when rules of shows components will be changed.
*/
void showChanged();
/**
* @brief clearView This signal emited when need to clear a view. for more ifnformation see the clear method.
*/
void clearView();
/**
* @brief acceptButtonTextChanged This signal emited when text of the accept button will be changed.
* @param acceptButtonText Tihs is new test of the accept button.
*/
void acceptButtonTextChanged(QString acceptButtonText);
void currentPageChanged(int currentPage);
private:
void checkValid(const UserData &data);
void setValidData(UserViewValidationData validationData);
@ -128,6 +352,9 @@ private:
UserViewValidationData m_validationData;
QString m_passwordError;
ViewComponents m_components = ViewComponents::All;
ViewComponents m_currentPage = ViewComponents::SigupPage;
QString m_acceptButtonText;
};
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -30,6 +30,10 @@ QString UserData::email() const {
return m_email;
}
QString UserData::nickname() const {
return m_nickname;
}
void UserData::setCountry(int country) {
m_country = country;
}
@ -50,11 +54,16 @@ void UserData::setEmail(const QString &email) {
m_email = email;
}
void UserData::setNickname(const QString& nickname) {
m_nickname = nickname;
}
bool operator !=(const UserData &left, const UserData &right) {
return left.m_email != right.m_email ||
left.m_country != right.m_country ||
left.m_rawPassword != right.m_rawPassword ||
left.m_firstName != right.m_firstName ||
left.m_nickname != right.m_nickname ||
left.m_lastName != right.m_lastName;
}

@ -1,17 +1,20 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef USERDATA_H
#define USERDATA_H
#ifndef LV_USERDATA_H
#define LV_USERDATA_H
#include <QObject>
#include "loginview_global.h"
namespace LoginView {
/**
* @brief The UserData class This is base class for save user data.
*/
class LOGINVIEW_EXPORT UserData
{
Q_GADGET
@ -20,6 +23,7 @@ class LOGINVIEW_EXPORT UserData
Q_PROPERTY(QString lastName READ lastName WRITE setLastName)
Q_PROPERTY(QString rawPassword READ rawPassword WRITE setRawPassword)
Q_PROPERTY(QString email READ email WRITE setEmail)
Q_PROPERTY(QString nickname READ nickname WRITE setNickname)
public:
UserData();
@ -32,6 +36,7 @@ public:
friend bool operator !=(const UserData& left, const UserData& right);
friend bool operator ==(const UserData& left, const UserData& right);
QString nickname() const;
public slots:
void setCountry(int country);
@ -40,13 +45,17 @@ public slots:
void setRawPassword(const QString& rawPassword);
void setEmail(const QString& email);
void setNickname(const QString &nickname);
private:
int m_country;
QString m_firstName;
QString m_lastName;
QString m_rawPassword;
QString m_email;
QString m_nickname;
};
}
#endif // USERDATA_H
#endif // LV_USERDATA_H

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -14,7 +14,9 @@ enum class ValidationAddersses {
FirstName = 0x02,
LastName = 0x04,
RawPassword = 0x08,
Email = 0x10
Email = 0x10,
Nickname = 0x20
};
UserViewValidationData::UserViewValidationData() {
@ -22,6 +24,7 @@ UserViewValidationData::UserViewValidationData() {
static_cast<int>(ValidationAddersses::Country) |
static_cast<int>(ValidationAddersses::LastName) |
static_cast<int>(ValidationAddersses::RawPassword) |
static_cast<int>(ValidationAddersses::Nickname) |
static_cast<int>(ValidationAddersses::Email);
}
@ -49,6 +52,10 @@ bool UserViewValidationData::noError() const {
return !m_data;
}
bool UserViewValidationData::nickname() const {
return m_data & static_cast<int>(ValidationAddersses::Nickname);
}
bool operator !=(const UserViewValidationData &left,
const UserViewValidationData &right) {
return left.m_data != right.m_data;
@ -84,4 +91,9 @@ void UserViewValidationData::setEmail(bool email) {
m_data |= (static_cast<int>(ValidationAddersses::Email) * (email & 0x01));
}
void UserViewValidationData::setNickname(bool nickname) {
m_data &= ~static_cast<int>(ValidationAddersses::Nickname);
m_data |= (static_cast<int>(ValidationAddersses::Nickname) * (nickname & 0x01));
}
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -12,6 +12,9 @@
namespace LoginView {
/**
* @brief The UserViewValidationData class contains data of the last validation.
*/
class UserViewValidationData
{
Q_GADGET
@ -20,12 +23,13 @@ class UserViewValidationData
Q_PROPERTY(bool lastName READ lastName WRITE setLastName) // ValidationAddersses::LastName
Q_PROPERTY(bool rawPassword READ rawPassword WRITE setRawPassword) // ValidationAddersses::RawPassword
Q_PROPERTY(bool email READ email WRITE setEmail) // ValidationAddersses::Email
Q_PROPERTY(bool nickname READ nickname WRITE setNickname) // ValidationAddersses::nickname
Q_PROPERTY(bool noError READ noError)
public:
UserViewValidationData();
/**
* @return true if member has error
* @return True if member has error.
*/
bool country() const;
bool firstName() const;
@ -39,6 +43,7 @@ public:
const UserViewValidationData &right);
bool noError() const;
bool nickname() const;
public slots:
void setCountry(bool country);
@ -47,6 +52,8 @@ public slots:
void setRawPassword(bool rawPassword);
void setEmail(bool email);
void setNickname(bool nickname);
private:
int m_data;
};

@ -0,0 +1,55 @@
#include "viewcomponents.h"
namespace LoginView {
int ViewComponentsQML::noShow() const
{
return ViewComponents::NoShow;
}
int ViewComponentsQML::title() const
{
return ViewComponents::Title;
}
int ViewComponentsQML::firstName() const
{
return ViewComponents::FirstName;
}
int ViewComponentsQML::lastName() const
{
return ViewComponents::LastName;
}
int ViewComponentsQML::eMail() const
{
return ViewComponents::EMail;
}
int ViewComponentsQML::nickname() const
{
return ViewComponents::Nickname;
}
int ViewComponentsQML::password() const
{
return ViewComponents::Password;
}
int ViewComponentsQML::sigupPage() const
{
return ViewComponents::SigupPage;
}
int ViewComponentsQML::loginPage() const
{
return ViewComponents::LoginPage;
}
int ViewComponentsQML::termOfUse() const
{
return ViewComponents::TermOfUse;
}
}

@ -0,0 +1,81 @@
//#
//# Copyright (C) 2020-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#ifndef VIEWCOMPONENTS_H
#define VIEWCOMPONENTS_H
#include <QObject>
namespace LoginView {
/**
* @brief The ViewComponents enum used for control of the components view.
* default is All
*/
enum ViewComponents {
/// No show any componets.
NoShow = 0x0000,
/// Show Title of the qml page.
Title = 0x0001,
/// Show first name input widget.
FirstName = 0x0002,
/// Show last name input widget.
LastName = 0x0004,
/// Show email name input widget.
EMail = 0x0008,
/// Show nickname input widget.
Nickname = 0x0010,
/// Show password input widget.
Password = 0x0020,
/// Show register page.
SigupPage = 0x0040,
/// Show login page.
LoginPage = 0x0080,
/// Show term of use button and accept term of use checkbox.
TermOfUse = 0x0100,
/// Show only one input widget with name.
RegNameOnly = Title | Nickname | SigupPage,
/// Show all widgets and pages.
All = EMail | Title | FirstName | LastName | Nickname | Password | SigupPage | LoginPage | TermOfUse
};
/**
* @brief The ViewComponentsQML class This is qml implementation of the ViewComponents enum.
*/
class ViewComponentsQML
{
Q_GADGET
Q_PROPERTY(int noShow READ noShow)
Q_PROPERTY(int title READ title)
Q_PROPERTY(int firstName READ firstName)
Q_PROPERTY(int lastName READ lastName)
Q_PROPERTY(int eMail READ eMail)
Q_PROPERTY(int nickname READ nickname)
Q_PROPERTY(int password READ password)
Q_PROPERTY(int sigupPage READ sigupPage)
Q_PROPERTY(int loginPage READ loginPage)
Q_PROPERTY(int termOfUse READ termOfUse)
public:
ViewComponentsQML() = default;
int noShow() const;
int title() const;
int firstName() const;
int lastName() const;
int eMail() const;
int nickname() const;
int password() const;
int sigupPage() const;
int loginPage() const;
int termOfUse() const;
};
}
Q_DECLARE_METATYPE(LoginView::ViewComponentsQML)
#endif // VIEWCOMPONENTS_H

@ -1,9 +1,8 @@
# QMLLoginView
test work for Logic Way Solutions
## Introdaction
![logo](https://user-images.githubusercontent.com/12465465/79076393-77b55300-7d02-11ea-8128-498f954dec92.png)
![Banner](res/Banner.jpeg)
This is a simple login window library for qml projects. The project is built with the help of the сmake build system and may be easily included into existing projects.
@ -21,9 +20,11 @@ This is a simple login window library for qml projects. The project is built wit
### Screenshots
#### Login View
![scrinshot Login](https://user-images.githubusercontent.com/12465465/79075704-2060b400-7cfd-11ea-9891-db1671d085e9.png)
#### Register View
![Screenshot register](https://user-images.githubusercontent.com/12465465/79075702-1dfe5a00-7cfd-11ea-9abe-8cfdb3820fe6.png)
@ -34,7 +35,9 @@ This is a simple login window library for qml projects. The project is built wit
* git submodule update --init --recursive
* Include in your CMakeLists.txt file the main CMakeLists.txt file of QMLLoginView library
``` cmake
include(QMLLoginView)
add_subdirectory(QMLLoginView)
target_link_libraries(${CURRENT_PROJECT} PRIVATE LoginView)
```
* Rebuild yuor project
@ -51,6 +54,8 @@ This is a simple login window library for qml projects. The project is built wit
```
``` qml
import LoginViewModule 1.0
LoginView {
lognViewModel: exampleLogin // exampleLogin - this is inited model in main.cpp
anchors.fill: parent
@ -73,6 +78,7 @@ This is a simple login window library for qml projects. The project is built wit
```
### LoginView::LVMainModel Methods
``` cpp
/**
* @brief setCounrySource - sets path to xml source file and extract list of countrys
@ -92,6 +98,7 @@ This is a simple login window library for qml projects. The project is built wit
```
#### LoginView::LVMainModel Signals
``` cpp
/**
@ -120,6 +127,7 @@ This is a simple login window library for qml projects. The project is built wit
```
#### UserData properties
``` cpp
Q_PROPERTY(int country READ country WRITE setCountry)
Q_PROPERTY(QString firstName READ firstName WRITE setFirstName)
@ -132,8 +140,9 @@ This is a simple login window library for qml projects. The project is built wit
## Build Example
### Prepare
1. install cqtdeployer
2. install cqtdeployer ([gitHubRelises](https://github.com/QuasarApp/CQtDeployer/releases or [snap-store](https://snapcraft.io/cqtdeployer)))
2. install cqtdeployer ([gitHub releases](https://github.com/QuasarApp/CQtDeployer/releases) or [snap-store](https://snapcraft.io/cqtdeployer)))
3. if you use snap store version of cqtdeployer add all permisions for cqdeployer.
### build on Linux
@ -157,3 +166,27 @@ chmod +x InstallerExampleLoginView.run
./InstallerExampleLoginView.run
```
## Translations
This library sipprots a next languages:
* English
* Russian
* Ukrainian
* Japanese
* Turkish
### Include translations
For include translations into your projects you need to use the QuasarAppUtils::Locales class. See oficiald [documentation](https://quasarapp.ddns.net:3031/docs/QuasarApp/QuasarAppLib/latest/classQuasarAppUtils_1_1Locales.html)
```cpp
if(!QuasarAppUtils::Locales::init(locale, {":/lv_languages/"})) {
QuasarAppUtils::Params::log("Error load language : " , QuasarAppUtils::Error);
}
```
Or you can manually load needed qm file.
All qm files located in lv_languages folder.

2495
doxygen.conf Normal file

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
@ -18,25 +18,23 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ProjectOut.cmake)
find_package(Qt5 COMPONENTS Core QuickControls2 REQUIRED)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core QuickControls2 REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core QuickControls2 REQUIRED)
if(ANDROID)
add_library(${PROJECT_NAME} SHARED
add_library(${PROJECT_NAME}
main.cpp
qml.qrc
lv_example_res.qrc
)
else()
add_executable(${PROJECT_NAME}
main.cpp
qml.qrc
lv_example_res.qrc
icon.rc
)
endif()
target_compile_definitions(${PROJECT_NAME}
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::QuickControls2 LoginView)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Core Qt::QuickControls2 LoginView)

Binary file not shown.

Before

(image error) Size: 8.8 KiB

After

(image error) Size: 66 KiB

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -32,7 +32,7 @@ int main(int argc, char *argv[])
pathXML = QString(argv[1]);
}
if (!loginModel.setCounrySource(pathXML)) {
if (!loginModel.setCountriesSource(pathXML)) {
return -2;
}

@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2020 Yankovich Andrei (EndrII).
//# Copyright (C) 2018-2021 Yankovich Andrei (EndrII).
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
@ -7,7 +7,6 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls 2.12 as Controls
import QtQuick.Layouts 1.12
import LoginViewModule 1.0
import QtQuick.Dialogs 1.3

5
plug.pro Normal file

@ -0,0 +1,5 @@
TEMPLATE = subdirs
QMAKE_EXTRA_TARGETS += \
test

BIN
res/Banner.jpeg Normal file

Binary file not shown.

After

(image error) Size: 34 KiB

Binary file not shown.

Before

(image error) Size: 8.8 KiB

After

(image error) Size: 66 KiB

Binary file not shown.

Before

(image error) Size: 22 KiB

After

(image error) Size: 211 KiB

Binary file not shown.

Before

(image error) Size: 15 KiB

After

(image error) Size: 18 KiB