pull/2/head
parent
b4bbd4d715
commit
9c9a627ac0
@ -0,0 +1,46 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2025-02-09T23:05:25
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui sql
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = car
|
||||
TEMPLATE = app
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any feature of Qt which has been marked as deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
SOURCES += \
|
||||
function.cpp \
|
||||
main.cpp \
|
||||
login.cpp \
|
||||
userfunction.cpp
|
||||
|
||||
HEADERS += \
|
||||
function.h \
|
||||
login.h \
|
||||
userfunction.h
|
||||
|
||||
FORMS += \
|
||||
function.ui \
|
||||
login.ui \
|
||||
userfunction.ui
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
@ -0,0 +1,337 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.9.0, 2025-09-11T12:51:18. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{8faed5cd-70e9-4715-b3d4-c715632476ff}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
|
||||
<value type="QString">-fno-delayed-template-parsing</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5123.win64_mingw73_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/build-car-Desktop_Qt_5_12_3_MinGW_64_bit-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/build-car-Desktop_Qt_5_12_3_MinGW_64_bit-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/Qt/build-car-Desktop_Qt_5_12_3_MinGW_64_bit-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy Configuration</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
|
||||
<value type="QString">cpu-cycles</value>
|
||||
</valuelist>
|
||||
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
|
||||
<value type="int" key="Analyzer.Perf.Frequency">250</value>
|
||||
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">car</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:D:/Qt/car/car.pro</value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/Qt/build-car-Desktop_Qt_5_12_3_MinGW_64_bit-Debug</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">21</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">21</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
@ -0,0 +1,14 @@
|
||||
#include "first.h"
|
||||
#include "ui_first.h"
|
||||
|
||||
first::first(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::first)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
first::~first()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
#ifndef FIRST_H
|
||||
#define FIRST_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class first;
|
||||
}
|
||||
|
||||
class first : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit first(QWidget *parent = nullptr);
|
||||
~first();
|
||||
|
||||
private:
|
||||
Ui::first *ui;
|
||||
};
|
||||
|
||||
#endif // FIRST_H
|
||||
@ -0,0 +1,129 @@
|
||||
#include "function.h"
|
||||
#include "ui_function.h"
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlRecord>
|
||||
#include <QDate>
|
||||
|
||||
function::function(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::function)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (!QSqlDatabase::contains("qt_sql_default_connection")) {
|
||||
db = QSqlDatabase::addDatabase("QODBC");
|
||||
}
|
||||
else{
|
||||
// 如果存在,使用现有的连接
|
||||
db = QSqlDatabase::database("qt_sql_default_connection");
|
||||
}
|
||||
|
||||
QString dsn = QString::fromLocal8Bit("qtdsn"); //数据源名称
|
||||
db.setHostName("127.0.0.1"); //本地主机
|
||||
db.setDatabaseName(dsn); //设置数据源名称
|
||||
db.setUserName("sa"); //登录用户
|
||||
db.setPassword("200557"); //密码
|
||||
if(!db.open()){
|
||||
qDebug() << "无法打开数据库:" ;
|
||||
}
|
||||
else{
|
||||
qDebug() << "成功打开数据库!";
|
||||
}
|
||||
}
|
||||
|
||||
function::~function()
|
||||
{
|
||||
delete ui;
|
||||
if (db.isOpen()) {
|
||||
db.close();
|
||||
}
|
||||
}
|
||||
|
||||
void function::on_pushButton_clicked()
|
||||
{
|
||||
static QString id=ui->lineEdit->text();
|
||||
static QString password=ui->lineEdit_2->text();
|
||||
static QString carnum=ui->lineEdit_3->text();
|
||||
if(id=="sheep"&&password=="200557"){
|
||||
QSqlQuery result(db);
|
||||
// 执行查询操作
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE carnum = :carnum");
|
||||
result.bindValue(":carnum",carnum);
|
||||
if (result.exec()){
|
||||
bool hasRecord = false; // 标记是否有匹配记录
|
||||
while (result.next()){
|
||||
hasRecord = true;
|
||||
for (int i = 0; i < result.record().count(); ++i) {
|
||||
qDebug() << result.record().fieldName(i) << ": " << result.value(i).toString();
|
||||
}
|
||||
qDebug() << "-------------------"; // 分隔不同车辆信息
|
||||
}
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "查询失败", "输入日期错误,请重试");
|
||||
}
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "查询失败", "用户名或密码错误,请重试");
|
||||
}
|
||||
}
|
||||
|
||||
void function::on_pushButton_2_clicked()
|
||||
{
|
||||
static QString id=ui->lineEdit->text();
|
||||
static QString password=ui->lineEdit_2->text();
|
||||
static QString parkingdate=ui->lineEdit_4->text();
|
||||
|
||||
|
||||
if(id=="sheep"&&password=="200557"){
|
||||
QSqlQuery result(db);
|
||||
// 执行查询操作
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingdate = :parkingdate");
|
||||
result.bindValue(":parkingdate", parkingdate);
|
||||
if (result.exec()){
|
||||
bool hasRecord = false; // 标记是否有匹配记录
|
||||
while (result.next()){
|
||||
hasRecord = true;
|
||||
for (int i = 0; i < result.record().count(); ++i){
|
||||
qDebug() << result.record().fieldName(i) << ": " << result.value(i).toString();
|
||||
}
|
||||
qDebug() << "-------------------"; // 分隔不同车辆信息
|
||||
}
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "查询失败", "输入日期错误,请重试");
|
||||
}
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "查询失败", "用户名或密码错误,请重试");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void function::on_pushButton_3_clicked()
|
||||
{
|
||||
QDate currentDate = QDate::currentDate();
|
||||
QString parkingdate = currentDate.toString("yyyy-MM-dd");
|
||||
|
||||
qDebug()<<"本车库车位A1-A100";
|
||||
|
||||
QSqlQuery result(db);
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingdate = :parkingdate AND status = '被使用中'");
|
||||
result.bindValue(":parkingdate", parkingdate); // 绑定参数
|
||||
if (result.exec()){
|
||||
bool hasRecord = false; // 标记是否有匹配记录
|
||||
while (result.next()){
|
||||
hasRecord = true;
|
||||
qDebug() << "目前停车场车位"<< result.value(1).toString() << "正在被使用!";
|
||||
}
|
||||
if (!hasRecord) {
|
||||
qDebug() << "没有正在被使用的车位,所有车位都可使用";
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, "查询失败", "查询过程中出现错误");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
#ifndef FUNCTION_H
|
||||
#define FUNCTION_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
namespace Ui {
|
||||
class function;
|
||||
}
|
||||
|
||||
class function : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit function(QWidget *parent = nullptr);
|
||||
~function();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_2_clicked();
|
||||
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_pushButton_3_clicked();
|
||||
|
||||
private:
|
||||
Ui::function *ui;
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
|
||||
};
|
||||
|
||||
#endif // FUNCTION_H
|
||||
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>function</class>
|
||||
<widget class="QMainWindow" name="function">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>491</width>
|
||||
<height>392</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>160</y>
|
||||
<width>221</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 11pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>查询该车停车记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>160</y>
|
||||
<width>71</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>车牌号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>40</y>
|
||||
<width>101</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>40</y>
|
||||
<width>61</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>账号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>100</y>
|
||||
<width>61</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>密码</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>100</y>
|
||||
<width>101</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>160</y>
|
||||
<width>101</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>220</y>
|
||||
<width>51</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>日期</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>220</y>
|
||||
<width>221</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 11pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>查询该日期停车记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>220</y>
|
||||
<width>101</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>280</y>
|
||||
<width>391</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 11pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>查询目前车库车位使用情况</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>491</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,36 @@
|
||||
#include "login.h"
|
||||
#include "ui_login.h"
|
||||
#include "function.h"
|
||||
#include "userfunction.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_clicked()
|
||||
{
|
||||
static function *functionpage = nullptr;
|
||||
if (functionpage == nullptr) {
|
||||
functionpage = new function;
|
||||
this->hide();
|
||||
functionpage->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_2_clicked()
|
||||
{
|
||||
static userfunction *functionpage = nullptr;
|
||||
if (functionpage == nullptr) {
|
||||
functionpage = new userfunction;
|
||||
this->hide();
|
||||
functionpage->show();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
#ifndef LOGIN_H
|
||||
#define LOGIN_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_pushButton_2_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // LOGIN_H
|
||||
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>386</width>
|
||||
<height>359</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>120</y>
|
||||
<width>121</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>管理员</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>70</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> 请选择您的身份</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>180</y>
|
||||
<width>121</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 12pt "Agency FB";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>用户</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>386</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,11 @@
|
||||
#include "login.h"
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
@ -0,0 +1,25 @@
|
||||
<?xml version='1.0'?>
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>480</width>
|
||||
<height>640</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QMenuBar" name="menubar"/>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -0,0 +1,208 @@
|
||||
#include "userfunction.h"
|
||||
#include "ui_userfunction.h"
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlRecord>
|
||||
#include<QDateTime>
|
||||
|
||||
userfunction::userfunction(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::userfunction)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (!QSqlDatabase::contains("qt_sql_default_connection")) {
|
||||
db = QSqlDatabase::addDatabase("QODBC");
|
||||
}
|
||||
else{
|
||||
// 如果存在,使用现有的连接
|
||||
db = QSqlDatabase::database("qt_sql_default_connection");
|
||||
}
|
||||
|
||||
QString dsn = QString::fromLocal8Bit("qtdsn"); //数据源名称
|
||||
db.setHostName("127.0.0.1"); //本地主机
|
||||
db.setDatabaseName(dsn); //设置数据源名称
|
||||
db.setUserName("sa"); //登录用户
|
||||
db.setPassword("200557"); //密码
|
||||
if(!db.open()){
|
||||
qDebug() << "无法打开数据库:" ;
|
||||
}
|
||||
else{
|
||||
qDebug() << "成功打开数据库!";
|
||||
}
|
||||
}
|
||||
|
||||
userfunction::~userfunction()
|
||||
{
|
||||
delete ui;
|
||||
if (db.isOpen()) {
|
||||
db.close();
|
||||
}
|
||||
}
|
||||
|
||||
void userfunction::on_pushButton_clicked()
|
||||
{
|
||||
QDate currentDate = QDate::currentDate();
|
||||
QString parkingdate = currentDate.toString("yyyy-MM-dd");
|
||||
|
||||
qDebug()<<"本车库车位A1-A100";
|
||||
|
||||
QSqlQuery result(db);
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingdate = :parkingdate AND status = '被使用中'");
|
||||
result.bindValue(":parkingdate", parkingdate); // 绑定参数
|
||||
if (result.exec()){
|
||||
bool hasRecord = false; // 标记是否有匹配记录
|
||||
while (result.next()){
|
||||
hasRecord = true;
|
||||
qDebug() << result.value(1).toString() << "车位正在被使用!";
|
||||
}
|
||||
if (!hasRecord) {
|
||||
qDebug() << "没有正在被使用的车位,所有车位都可使用";
|
||||
}
|
||||
else{
|
||||
qDebug() <<"其余车位都可使用";
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, "查询失败", "查询过程中出现错误");
|
||||
}
|
||||
}
|
||||
|
||||
void userfunction::on_pushButton_2_clicked()
|
||||
{
|
||||
static QString carnum=ui->lineEdit->text();
|
||||
static QString parkingnum=ui->lineEdit_2->text();
|
||||
QDate currentDate = QDate::currentDate();
|
||||
QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
QString parkingdate = currentDate.toString("yyyy-MM-dd");
|
||||
QString intime= currentDateTime.toString("yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
|
||||
QSqlQuery result(db);
|
||||
// 执行查询操作
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingnum= :parkingnum AND status='被使用中'");
|
||||
result.bindValue(":parkingnum",parkingnum);
|
||||
if(carnum!=nullptr){
|
||||
if(result.exec()){
|
||||
QSqlQuery insertUser(db);
|
||||
insertUser.prepare("INSERT INTO [car].[dbo].[car] (parkingdate,parkingnum,carnum,status,intime) VALUES (:parkingdate,:parkingnum,:carnum,:status,:intime )");
|
||||
insertUser.bindValue(":parkingdate",parkingdate);
|
||||
insertUser.bindValue(":carnum", carnum);
|
||||
insertUser.bindValue(":parkingnum",parkingnum);
|
||||
insertUser.bindValue(":status","被使用中");
|
||||
insertUser.bindValue(":intime",intime);
|
||||
if (insertUser.exec()){
|
||||
qDebug() << "停车成功!";
|
||||
}
|
||||
else{
|
||||
qDebug() << "停车失败!";
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "停车失败", "该车位正在使用中!");
|
||||
}
|
||||
}
|
||||
else{
|
||||
QMessageBox::warning(this, "选择失败", "请输入选择车位!");
|
||||
}
|
||||
}
|
||||
|
||||
void userfunction::on_pushButton_3_clicked()
|
||||
{
|
||||
QString carnum = ui->lineEdit->text();
|
||||
QString parkingnum = ui->lineEdit_2->text();
|
||||
QDate currentDate = QDate::currentDate();
|
||||
QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
QString parkingdate = currentDate.toString("yyyy-MM-dd");
|
||||
QString outtime = currentDateTime.toString("yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
QSqlQuery result(db);
|
||||
// 执行查询操作
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingdate = :parkingdate AND parkingnum = :parkingnum AND carnum = :carnum");
|
||||
result.bindValue(":parkingdate", parkingdate);
|
||||
result.bindValue(":parkingnum", parkingnum);
|
||||
result.bindValue(":carnum", carnum);
|
||||
|
||||
if (result.exec()) {
|
||||
while (result.next()) {
|
||||
QString valueStr = result.value(4).toString().trimmed(); // 去除首尾空格
|
||||
if (valueStr.isEmpty()) {
|
||||
qDebug() << "时间字段为空: " << valueStr;
|
||||
continue; // 跳过本次循环
|
||||
}
|
||||
qDebug() << valueStr;
|
||||
QDateTime intime;
|
||||
QStringList formats = {
|
||||
"yyyy-MM-dd hh:mm:ss",
|
||||
"yyyy/MM/dd hh:mm:ss",
|
||||
"yyyy-MM-dd hh:mm:ss.zzz",
|
||||
"yyyy-MM-dd HH:mm:ss" // 添加更多可能的格式
|
||||
};
|
||||
for (const QString& format : formats) {
|
||||
intime = QDateTime::fromString(valueStr, format);
|
||||
if (intime.isValid()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!intime.isValid()) {
|
||||
qDebug() << "无效的时间字符串: " << valueStr;
|
||||
continue; // 跳过本次循环
|
||||
}
|
||||
|
||||
// 检查 intime 是否在当前时间之前
|
||||
if (intime > currentDateTime) {
|
||||
qDebug() << "入库时间晚于当前时间,可能数据异常: " << valueStr;
|
||||
continue;
|
||||
}
|
||||
|
||||
qint64 secondsDifference = intime.secsTo(currentDateTime);
|
||||
qDebug() << "时间差(秒):" << secondsDifference;
|
||||
|
||||
int cost = secondsDifference*2;
|
||||
|
||||
QSqlQuery query;
|
||||
query.prepare("UPDATE [car].[dbo].[car] SET status = :status, outtime = :outtime, cost = :cost WHERE parkingdate = :parkingdate AND parkingnum = :parkingnum AND carnum = :carnum");
|
||||
query.bindValue(":status", "未使用");
|
||||
query.bindValue(":outtime", outtime);
|
||||
query.bindValue(":cost", cost);
|
||||
query.bindValue(":parkingdate", parkingdate);
|
||||
query.bindValue(":parkingnum", parkingnum);
|
||||
query.bindValue(":carnum", carnum);
|
||||
|
||||
if (!query.exec()) {
|
||||
qDebug() << "更新数据失败: ";
|
||||
}else {
|
||||
qDebug() << "出库成功!";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
qDebug() << "出库失败!";
|
||||
}
|
||||
}
|
||||
|
||||
void userfunction::on_pushButton_4_clicked()
|
||||
{
|
||||
static QString carnum=ui->lineEdit->text();
|
||||
static QString parkingnum=ui->lineEdit_2->text();
|
||||
|
||||
QSqlQuery result(db);
|
||||
result.prepare("SELECT * FROM [car].[dbo].[car] WHERE parkingnum=:parkingnum AND carnum = :carnum" );
|
||||
result.bindValue(":parkingnum",parkingnum);
|
||||
result.bindValue(":carnum",carnum);
|
||||
if (result.exec()) {
|
||||
if (result.next()) { // 将指针移动到第一条记录
|
||||
qDebug()<<"------电子小票------";
|
||||
qDebug() << "入库时间:" << result.value(4).toString();
|
||||
qDebug() << "出库时间:" << result.value(5).toString();
|
||||
qDebug() << "花费:" << result.value(6).toString();
|
||||
}
|
||||
else{
|
||||
qDebug() << "未找到符合条件的记录";
|
||||
}
|
||||
}
|
||||
else{
|
||||
qDebug() << "查询执行失败: ";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
#ifndef USERFUNCTION_H
|
||||
#define USERFUNCTION_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
namespace Ui {
|
||||
class userfunction;
|
||||
}
|
||||
|
||||
class userfunction : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit userfunction(QWidget *parent = nullptr);
|
||||
~userfunction();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_pushButton_2_clicked();
|
||||
|
||||
void on_pushButton_3_clicked();
|
||||
|
||||
void on_pushButton_4_clicked();
|
||||
|
||||
private:
|
||||
Ui::userfunction *ui;
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
|
||||
};
|
||||
|
||||
#endif // USERFUNCTION_H
|
||||
Loading…
Reference in new issue