From 25daaecbc03daf49d8d442bdd76bc0aa99dc296b Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Wed, 26 Jul 2023 19:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++ MyButton.cpp | 34 ++++++++++++++++++++++++++ MyButton.h | 39 +++++++++++++++++++++++++++++ buttonstruct.h | 13 ++++++++++ images/address.png | Bin 0 -> 2743 bytes images/close-small.png | Bin 0 -> 2507 bytes images/close.png | Bin 0 -> 2811 bytes images/home.png | Bin 0 -> 2273 bytes images/maxsize.png | Bin 0 -> 3096 bytes images/minsize.png | Bin 0 -> 1745 bytes images/money.png | Bin 0 -> 1959 bytes images/personalcenter.png | Bin 0 -> 3891 bytes main.cpp | 12 +++++++++ mainwindow.cpp | 31 +++++++++++++++++++++++ mainwindow.h | 30 +++++++++++++++++++++++ mainwindow.ui | 34 ++++++++++++++++++++++++++ mainwindowlayout.cpp | 44 +++++++++++++++++++++++++++++++++ mainwindowlayout.h | 35 ++++++++++++++++++++++++++ mainwindowlayout.ui | 19 +++++++++++++++ navbar.cpp | 47 +++++++++++++++++++++++++++++++++++ navbar.h | 34 ++++++++++++++++++++++++++ navbar.ui | 22 +++++++++++++++++ 23 files changed, 447 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 MyButton.cpp create mode 100644 MyButton.h create mode 100644 buttonstruct.h create mode 100644 images/address.png create mode 100644 images/close-small.png create mode 100644 images/close.png create mode 100644 images/home.png create mode 100644 images/maxsize.png create mode 100644 images/minsize.png create mode 100644 images/money.png create mode 100644 images/personalcenter.png create mode 100644 main.cpp create mode 100644 mainwindow.cpp create mode 100644 mainwindow.h create mode 100644 mainwindow.ui create mode 100644 mainwindowlayout.cpp create mode 100644 mainwindowlayout.h create mode 100644 mainwindowlayout.ui create mode 100644 navbar.cpp create mode 100644 navbar.h create mode 100644 navbar.ui diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0970347 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +cmake-build-debug/ +cmake-build-release/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b3a59a4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 3.25) +project(officeassistant) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.6.3/5.6.3/mingw49_32") +add_definitions(-DOFFICEASSISTANT_NO_CONSOLE) +find_package(Qt5 COMPONENTS + Core + Gui + Widgets + REQUIRED) + +add_executable(officeassistant main.cpp mainwindow.cpp mainwindow.h mainwindow.ui mainwindowlayout.cpp mainwindowlayout.h mainwindowlayout.ui navbar.cpp navbar.h navbar.ui MyButton.cpp MyButton.h buttonstruct.h) +target_link_libraries(officeassistant + Qt5::Core + Qt5::Gui + Qt5::Widgets + ) +if (WIN32 AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) + set(DEBUG_SUFFIX) + if (MSVC AND CMAKE_BUILD_TYPE MATCHES "Debug") + set(DEBUG_SUFFIX "d") + endif () + set(QT_INSTALL_PATH "${CMAKE_PREFIX_PATH}") + if (NOT EXISTS "${QT_INSTALL_PATH}/bin") + set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") + if (NOT EXISTS "${QT_INSTALL_PATH}/bin") + set(QT_INSTALL_PATH "${QT_INSTALL_PATH}/..") + endif () + endif () + if (EXISTS "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll") + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + "$/plugins/platforms/") + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${QT_INSTALL_PATH}/plugins/platforms/qwindows${DEBUG_SUFFIX}.dll" + "$/plugins/platforms/") + endif () + foreach (QT_LIB Core Gui Widgets) + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${QT_INSTALL_PATH}/bin/Qt5${QT_LIB}${DEBUG_SUFFIX}.dll" + "$") + endforeach (QT_LIB) +endif () diff --git a/MyButton.cpp b/MyButton.cpp new file mode 100644 index 0000000..73b49ea --- /dev/null +++ b/MyButton.cpp @@ -0,0 +1,34 @@ +// +// Created by HW on 2023/07/26. +// + +#include "MyButton.h" +MyButton::MyButton(QString logo,QString text,int width,int height,QWidget *parent) : QPushButton(parent) { + this->width2=width; + this->height2=height; + this->text=text; + this->logo=new QImage; + this->logo->load(logo); + this->setStyleSheet("background-color:#333332;"); +} + +MyButton::~MyButton() { + delete logo; +} + +void MyButton::paintEvent(QPaintEvent *e) { + QPushButton::paintEvent(e); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + int logo_width=width()/2; + int logo_x=width()/4; + QFont ft; + ft.setPixelSize(7); + int text_x=0; + int text_y=(logo_width+logo_x); + QRectF logo_rect(logo_x, logo_x, logo_width, logo_width); + QRectF text_rect(text_x,text_y,7*text.length(),7); + painter.setPen(QColor("#FFFFFF")); + painter.drawImage(logo_rect, *logo); + painter.drawText(text_rect, Qt::AlignCenter, text); +} diff --git a/MyButton.h b/MyButton.h new file mode 100644 index 0000000..fe83337 --- /dev/null +++ b/MyButton.h @@ -0,0 +1,39 @@ +// +// Created by HW on 2023/07/26. +// + +#ifndef OFFICEASSISTANT_MYBUTTON_H +#define OFFICEASSISTANT_MYBUTTON_H + +#include +#include +#include +#include +#include + +class MyButton: public QPushButton{ +public: + MyButton(QString logo,QString text,int width,int height,QWidget *parent=nullptr); + ~MyButton() override; + QString getText(){ + return text; + } + QSize sizeHint() const override { + return QSize(width2/2,height2/2); + } + +protected: + void paintEvent(QPaintEvent *e) override; +private: + QImage *logo; + QLabel *logo_label; + QLabel *text_label; + QVBoxLayout *layout; + QPixmap* logo_pixmap; + QString text; + int width2; + int height2; +}; + + +#endif //OFFICEASSISTANT_MYBUTTON_H diff --git a/buttonstruct.h b/buttonstruct.h new file mode 100644 index 0000000..9f22c0f --- /dev/null +++ b/buttonstruct.h @@ -0,0 +1,13 @@ +// +// Created by HW on 2023/07/26. +// + +#ifndef OFFICEASSISTANT_BUTTONSTRUCT_H +#define OFFICEASSISTANT_BUTTONSTRUCT_H +#include +typedef struct taButtonStruct{ + int index; + QString logo; + QString text; +}ButtonStruct; +#endif //OFFICEASSISTANT_BUTTONSTRUCT_H diff --git a/images/address.png b/images/address.png new file mode 100644 index 0000000000000000000000000000000000000000..875b34a98d473e04df7424305e1a3e9868746b7b GIT binary patch literal 2743 zcmeH}*;kWE8pi8ONJ5Z=s4XN2F^#}MP+1ftAow8x0)$Q6XaONXWf71V#5jtdBW*W= z5+m56Y^{J27L`Q>lmI3HltrLfR3x$m;{rp27=+e|7xM?q#hkh6i>kMt^VD1C{N7U+ zPpZGK2SH0;3jjdyWHNTBYwP!=iB<3Adn@t)&`S1Xxa>S0`Z4#_osdAXw97NtOW#G3 zwjwH}j&Y+1@5PXu^-r`|zHa%}U#nkkgN=v1y|>nfn4>m#&Z6{xCV~+2KK|5&R}sz3Lc=r zc84QxNJOAH(+Ghd(e_qX(L*lS*$bsI2?QvY-K*N041l2Nz7{JgE6a**;oIA z0O5F&RY!7e^&d2TpFK#SmT5CXOWKxEXi&?L)l{#2hNunh=L*nb>FL~+f)BT)dM32% zPpYLgKl zdsic6k%vUxoi|VsG3#eXyEkUN+m0J1z`FSNiMzcp%o8(qrB%DE5~7G7@UZCkCU;Eh z&L~5M-vgosO?Wu5{(LIF&1lrk0pY!FYgXU{>E{6RTu_!aMv(4~`may-L95K_WR$z- zIpPRB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ii0+iiY3S;cL3q6a)_=Jqq+7q5FF0w4x6P zx9eU|(UP?n33UVldAg4p{OQY$ZF;r^>kTXCe}Oz+9x9)`X$PNsku#NzO^?m3cUE9f znF|E7XV_|XI1o~`9k+>4g|%sgK9zxk86SHeSL61aF#p8QAEWdO(a_T%g4yRe`b3v? zT+rORKIax4r!ogvpV^bQPe;P{*7;>#BL95$9w$;SJIoA+%B<~$v->!edZW`iC2Lwm z8WG~A@RKhyr-b&sxV;{-g}@wT{}Pw{IO%o;H{m^zA@12$$qUI*mi#%B@RfS#3p}6u zcHmIC-Um*z2vTzX(r!BA>HugO>TEXx5R#4oAlV@3v-C#82rK!+XqGy`Sx0StX3(yV pbnROz^jG3Q1WUie26yz0rOg?OwVdqtw(39%Jl%X572Cu9`ET`!bejMG literal 0 HcmV?d00001 diff --git a/images/close-small.png b/images/close-small.png new file mode 100644 index 0000000000000000000000000000000000000000..c8c864d69d52850acf83ed44ffe2de350b0b18bc GIT binary patch literal 2507 zcmd^>{Wnw#7sqEfni;|vFENcA=8(72)sT~y=169a5TeI4s;fr0rROn}io}rUg<~@G z!dx+ux=B;Wdr6r=M0G`?G%BSqZX&wfdH#*(`C;$9)?T0Q+H3E%*V;QPz@Me9N!7&R zaM~!_D@YY(|25(gmA?^MDaPSQLevWhKD_gDQ3KzQMb5a*p9+}%J?I!*wQE;=6r$ZhRsuR#DALZ93jr>B4(2ZAllQ$SR3#m@{6Ovjem zlJEdZVZ?kVf|)tXLr@~f78XZ8W#N#dp{qWgI7A5eUGh*P{*RTEX)3>d>i>P!1MZ>1 z>bGZ1+b0gkv|m!zS66?9&_^MI3~@gp`$Qz{aU*o_Q_b|yb^hgUqg;cw*2btpvlp>R z+LJpLYF`@dCtbX$PBiXRo-M0tytAZ_wNN{9c1+6&;|oHIUmEp2&P9&Z%v5r!Tvmkapr{Hi_><_0s+7BWPS#ywVo&TZwLheE>6G?3_q?{-B8^(rheO4zO+KrxjV5b96eo2R`JN-KqD) z{rNRgka+pgee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#n^}kf~;&gZRTYu^J*i}f*;=a!#N#A!}zV2v(Xof7Cvt>?s_v{L#UapXC3Z%d977>4FRg6c`b Np_}}@Dm{M{`~!^SCi4IQ literal 0 HcmV?d00001 diff --git a/images/close.png b/images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..dcc9b4004eaaf5b73cd9d5690c8ec7f359c7c6a7 GIT binary patch literal 2811 zcmc&$`#02!79ZnFGviOKy-%+wR-AeJ8s6G2Y`b8K1Xk^N9U!u!V>dO6Zm4D8Vz2Olg?d(BaU49ktDQwx5mT+uD z3py*F7P%tx>)aipYgQcjjlhnX<7Ai5qrL!59MkEF{4N%DW)(twXRtauYO{;UN&#jz zGeO-OZb6*IAME{8h%5@}iIX%Db4IqUcOxw!hSmk01H~IjnMAbFZ2}j((gsG0QedkA@JZ zq|X-F+0^vY5JHZ>cqMPw)ewvvjat&-?c%-WJZP!%)ug2kc;0!d_(e0O1Ji!FEar{d zDPm{Tk)84u%f|wnHqhRWTNQy!ukG{AcXC1;Dv9zYNAA4{NH>Ux*Yn1cMf$7d2ZV9? zeSI(}5`Q;bwP#c3^aJr^KeeO}IEip<`vs86*I9_sW=rM@o#h0T^|V==DQ|aU4FBs6 zm!a=wcS}6*!Q1Hl+r$h( zjW)D4W5J-WL>5Djyj7A8>WaRt>)#;jVQ9o);ZWxoT5X=J>sNJjaY$v>NZ5kg;Kaz&IiFy6$?iA)`J`vvh#EKu{L+5WE z&j4{jS>p`Cgbl-C}nCW=i4$^~88m-}5c3s}Y+=)Dwhtq~; z0YB`kN&{w{xlakGin6_`$kGe#(JUj3f^3i#)@BEJbM$wsk^OS4_8^Xl=ettL7ie=p zB`O^3eAz@@9lL+=jAheTKvZ^=*g1X9uA#*zd^z|kk?A~7S8nR0TX=E@rHCuN_zm zB$0+Rlw-Mi5qu@6DT-&ANE)zxK*bngc{Z`6LA#sOk4m~peaRVoEDo}FB{X+eWfDoS4lcvKhorB*Ca0%U$ zX=}NhtBQgC3LPEXG;MCsRcD8v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&}tPaQ5OnvD8 zXM}-UnkVY$XV1IEfR$1!6|l#Pw%D?1sUV^*yRe#Ml?oU;{oOK%1aH=xiwCX z-e)xS(BFwRc>rcmr}D6OSrN!LrtupUd=73l*f)(|uki6kaxQIQ(jJGZobt30O&^s! zr-s>a3<<%-quIQ4P()R7>AC3PS&({QB;l6Ahm7Qi9b$b3Lu=ROY3WR+YMlB7&{x(G z`>gUrpwAZ-)3SI+Kx$oQjaDI`A~|;>ixabXz5seTQq!mqfEvq~w@BglK1_@D$z-NC zl61*w1inQ|)x2og8Y1`bgf^kc5BVQa_n_17MSS8`R_(yTl@imPLA!|U%M)NpCqs&vD?z(xIKZj>Q|`~r{NG1K zh@A=wZxK-Mou}q{->$#yl`-|{bS}Ztci={f=_gyNezf-h_Sjl1r?kza;(4rN-hFfV%?$|-rH7y#Z z8JT5GTt7eHlWPf(tw{gGovJIfx0Yl&G5r~F`n~1tUc=97app%&hQFB!j&qVO|2JA< zMr*b?=jc#L`v!9NcIw5o_&B#D?$nWE%{76k`lRpL8RYJJ)yaDWGLd}R_~K19l$!h) z9{vk6+5PBUBWjfot^cax3t0_wAEgu1sa?uTAfLZxr5{SI=m77?az+bA0vl;qGx*ja`$G3!$&qN!smfkdE$U zAjCs9E|~d0ZehN27+(sZ2}8(rNKW`f-{`Rfr SHpT@!T_9f2&cJ$34EkT0M7v-B literal 0 HcmV?d00001 diff --git a/images/maxsize.png b/images/maxsize.png new file mode 100644 index 0000000000000000000000000000000000000000..d2539edebd71da267c4ebb96f5afcff97757c183 GIT binary patch literal 3096 zcmds3`#Y5F7Jl9_3?q!Ba-RC6gXBxfj6p9s4CNFF6B3mi3ONg}p)!dk#~dPq5HUmK zkYkA{mBBcK2%&F>a+pNezHk2t`G#+rLh125o5Cc z>CM{ycL)k>=BKu$SpW!+80+g=2RY6>G%s}EO1=)Wu(H_ZZj_&wu7`eFw1?KICzr4H zNJX6LCcInpw3W|!`6Ry{rHA`&DiY{Q&5;oTZ%<L{gt6j+Qh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JC4gv<e}4Im}X&hrJU z`fAE#AMILUfCpox`?Q5nIPk;z-t03Vh*T?^m{S27*5c-pQ~(M;d#5WA4ME-{%f@^l>uV&|* z*@13bDyjvFT$WE&87gKx`DHn;7SxcAhJl2?`U!(O__`im|2@FcHW#9|SuH{2Cobcj zPJHyKi|?Z1XM)MdgV%W?aKblfuW@N4^FGP3)W#vLFm|Q&DQd#gT>$!LuqrAqG<%${ ztyfElkoBH}!4pg4%FOrUc}k2SdC8M4vu7WPKa~~m4u-IJ;C+t;G~Ub>;^TTn~NH0%%8a$W1^Ea+@1JFg7sLFV#Cw F{Wng@bv*z8 literal 0 HcmV?d00001 diff --git a/images/minsize.png b/images/minsize.png new file mode 100644 index 0000000000000000000000000000000000000000..f08070fe51b1437184fb71dda1a2bdaa1af56c40 GIT binary patch literal 1745 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST~P>fo+DTi(^Pd+}qm=^OmNHv?lWL z^)ebWxi=k76yz`xZ+IYfV4{LS1PfzcQ;H7LQB?*e&j}pw7@U93;_)8IO|)m&|o(Tuacu+K*R z{hWUHUWU}FJeGeJ@h^{m{`hj@)925>h06bE&0@7Is`(Mp7cO71_@j9L0d@CD`cg^Z zTt!cQyg2Z472^aRL#F#Oo_X_|U+lMX?32ltQ`$eLfBNDSoqUB4KRiCg8hI>MxG%5p zUUlJ(Smy`VCqG%Md~*Ium(V7gzrI)BYf5|z6RP;m@yS^$a<;;Id4Y@hD_1JL**o3g z3;Q=SM?32ocHcKB6to}M{@nTmyQUJ0=fv&bqnKEJwqN-vdBl57w)||{`Oj6a$vWoU z_j}a-#g_lS>GWTUfAyArjy^*?M2>Id|JQfl04Uc-YMH>#r*v7 zXTSa1*Pm~%?!T-a_E+rn%;{10*3780D*C$$f2i|5VByZ=FcS(Wu9p2lj3W943@7e+w5@@F=xCw3Jgo SrdI>2Dh5wiKbLh*2~7a0YQV(+ literal 0 HcmV?d00001 diff --git a/images/money.png b/images/money.png new file mode 100644 index 0000000000000000000000000000000000000000..93c15670342aef892b43ab42031a24686285a865 GIT binary patch literal 1959 zcmeH|Z8TJQ9LMimH|{uWV`NgoofvKHl2vK-pt(b4ri^wyRfB0dtW+pzB12{_4l3N( z!cL{ab{0{@u%4#c7-b_BNkltV*2Bn*haEcY-S@k%_MCmOXJ7n(|2O~N`JVIp{lA}Y z`d40TW5bn(000ME{*~U%zE7Q8%9@@5L#F zj0_KJbZbKfZKLl?4dAWR>pZ$Mn4Zx!Y7=(t`g3!zf(iDEE(GqL%&-6TiHlhCA@YQi z?MPW;k1lbfAipl={`i0<2>_2VZa>f`K?7bAWbzZ}37tui8-P&MQl!&na79ro&krVH z$xuYQ6$#VU{$NOF;`p_UUK=KEwb_pj!BpzqFT@bs^~?9`k^z*3IfrHeXxwYx6bi!O zbheC}Ae<~&2?d16Tv7VlXef7j%(ZcX!D)*sriuBj)d@6_F_>f;>;EBW zJy+l`Q&)lP=w``tY0*~Fba>GhihXeW*L5`lDzG6w28r)xl&xZn!SE{Vki{J$ytSBV{Id zO=%S_@Ck%DtY?ZS6+>YWVi4+e)w4A6lpuPkh1C;eO2~rINk>N#X0$4^yJig&pV-iO zPXWPB$G_zFT?NpZ4yM7s+B~oVJ^Q}yfVb0eeZGZEAzL4_MRn->$K_)<`T6SO?jYo{ zI&gQ#9tom36o%PQ5v9oxKkf_&c`tL?qIDb2xF z`SD!0I6GiQy=QEGd^|Ssjd4(_;w&WS5oC2_u3@wgAnvECZpdn_r27fpbgQ(Dh9s;E z>$R&Q>|540DmDY5{Y$ENp$sOzKj+!pItZ>b43)L-k|0%fH`RVHCB&@VIsYPnhVs1L zlu{7oy1WRd&q!GNcbA*?65-?L*cakYAYhYALIsf{rNWxFG6G>oPv`_G0P24)Jm;SY ZD-wM!2hK*nVWLC;1Kgcn?&T~Y_6J&)EwKOq literal 0 HcmV?d00001 diff --git a/images/personalcenter.png b/images/personalcenter.png new file mode 100644 index 0000000000000000000000000000000000000000..e37d1c709c40dba3c96752e8d5df877974922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;ERcb8pOY1G5p=DnJjvg#)Xb=+ID!Tk6EW+F3o$2E(QwP3ZT8iX z))p=u-Yg}6-T1D$rM40$8kiRSSLtkX`N@_DQjHnrk}TU>c@;(39XwrR#0Ghov$G?f zeFKt2UQx#skoab|K@-?20;cp!$>utMyD)zPY%$NSSHP3mFm&D}bH4VQB1jQO7PD@? z)HHv(N{nY!e0V=!IPT=IkiPlyuF@Tv;r|XIE za(?sJcw&xma`eRlt)oL*cF`Yx;E{cTh6`|1^}q1+$@Mpb5OXhi@6gbe=5pvdjwS*- zM}G+hm(CgL^!LY<~)L~3B ziX9h?KM5-LXN?U0o7;|~w<}4_;YCBG=i=`ibCgIft3a|K3$Vvd$zK5>Ln6)VhEJMZ zU^dhV@^np__W`O<*(__Wh_ zI+OLI|8k!1QFVefD-A`c3m_>Vd9h=2I9d3G6R3pQ0kPYnB~Ac3Vv;pWVX>zx=`dyo ziv9Y3>U*|$VeQ|V%Rz#`mU3YLVB#+QIvD!fFdKK(c}xaimZnAG=?`+-?6Jf8CD3Tw zA0a?ER{4h`j~bkdn{XMk?S)%Dof;WTM%F62n=3Wwbf+KwV+DB)nX`G!mEBb8qYJig3 zAG^QWOby4ltUSxuY;dojtK&{#$@!1^PJmoOYVT@9!k0><81e>~th)U~I@e>uEYEb} zAHs;U@L(!JeO#;)Q8ETAc~X&-Eh)BWEFFO0uCbIEWXNK1L1|Cnrh*0%zBLU|^ObYIO$!lcA zK_iYqcjrsrKKU+&OSC|0%rO~95QLJiXe56Wgrtp8v!=nq&3ZXqbgn@tX$`s^KQsS7 c1J+C*o;t9?kC5aFn_=Lfm7Qg+xo_-$06lrEZU6uP literal 0 HcmV?d00001 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..7ba5a95 --- /dev/null +++ b/main.cpp @@ -0,0 +1,12 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..7431a92 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,31 @@ +// +// Created by HW on 2023/07/26. +// + +// You may need to build the project (run Qt uic code generator) to get "ui_MainWindow.h" resolved + +#include "mainwindow.h" +#include "ui_MainWindow.h" + + + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); + QDesktopWidget* desktopWidget = QApplication::desktop(); + QRect deskRect = desktopWidget->availableGeometry(); + if(deskRect.width()>=1920){ + resize(1920,1080); + }else if(deskRect.width()>=1333&&deskRect.width()<=1920) { + resize(800, 540); + } + delete desktopWidget; + mainWindowLayout=new MainWindowLayout(this); + setCentralWidget(mainWindowLayout); +} + +MainWindow::~MainWindow() { + delete mainWindowLayout; + delete layout; + delete ui; +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..2e0eef1 --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,30 @@ +// +// Created by HW on 2023/07/26. +// + +#ifndef UNTITLED_MAINWINDOW_H +#define UNTITLED_MAINWINDOW_H + +#include +#include +#include "mainwindowlayout.h" +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow { +Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = nullptr); + + ~MainWindow() override; + +private: + Ui::MainWindow *ui; + QVBoxLayout *layout; + MainWindowLayout *mainWindowLayout; +}; + + +#endif //UNTITLED_MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..0c3025c --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,34 @@ + + + + + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + 0 + 0 + 400 + 17 + + + + + + + + \ No newline at end of file diff --git a/mainwindowlayout.cpp b/mainwindowlayout.cpp new file mode 100644 index 0000000..5e92b2f --- /dev/null +++ b/mainwindowlayout.cpp @@ -0,0 +1,44 @@ +// +// Created by HW on 2023/07/26. +// + +// You may need to build the project (run Qt uic code generator) to get "ui_MainWindowLagout.h" resolved + +#include "mainwindowlayout.h" +#include "ui_MainWindowLayout.h" + + +MainWindowLayout::MainWindowLayout(QWidget *parent) : + QWidget(parent), ui(new Ui::MainWindowLayout) { + ui->setupUi(this); + layout=new QVBoxLayout(this); + buttons=new ButtonStruct[4]; + buttons[0].text="主页"; + buttons[0].logo=".\\images\\home.png"; + buttons[0].index=0; + buttons[1].text="我的网址"; + buttons[1].logo=".\\images\\address.png"; + buttons[1].index=1; + buttons[2].text="我的资产"; + buttons[2].logo=".\\images\\money.png"; + buttons[2].index=2; + buttons[3].text="个人中心"; + buttons[3].logo=".\\images\\personalcenter.png"; + buttons[3].index=3; + for(auto i=0;i<4;i++){ + list<<&buttons[i]; + } + navBar=new NavBar(list,this); + layout->addWidget(navBar,1); + layout->addStretch(4); + layout->setMargin(0); + setLayout(layout); +} + +MainWindowLayout::~MainWindowLayout() { + + delete[] list[0]; + delete navBar; + delete layout; + delete ui; +} diff --git a/mainwindowlayout.h b/mainwindowlayout.h new file mode 100644 index 0000000..a2f584a --- /dev/null +++ b/mainwindowlayout.h @@ -0,0 +1,35 @@ + +// +// Created by HW on 2023/07/26. +// + +#ifndef OFFICEASSISTANT_MAINWINDOWLAYOUT_H +#define OFFICEASSISTANT_MAINWINDOWLAYOUT_H + +#include +#include +#include "navbar.h" + + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindowLayout; } +QT_END_NAMESPACE + +class MainWindowLayout : public QWidget { +Q_OBJECT + +public: + explicit MainWindowLayout(QWidget *parent = nullptr); + + ~MainWindowLayout() override; + +private: + Ui::MainWindowLayout *ui; + QVBoxLayout *layout; + QList list; + NavBar *navBar; + ButtonStruct *buttons; +}; + + +#endif //OFFICEASSISTANT_MAINWINDOWLAYOUT_H diff --git a/mainwindowlayout.ui b/mainwindowlayout.ui new file mode 100644 index 0000000..704794c --- /dev/null +++ b/mainwindowlayout.ui @@ -0,0 +1,19 @@ + + + MainWindowLayout + + + + 0 + 0 + 400 + 300 + + + + MainWindowLagout + + + + + diff --git a/navbar.cpp b/navbar.cpp new file mode 100644 index 0000000..c8ac2cd --- /dev/null +++ b/navbar.cpp @@ -0,0 +1,47 @@ +// +// Created by HW on 2023/07/26. +// + +// You may need to build the project (run Qt uic code generator) to get "ui_NavBar.h" resolved + +#include "navbar.h" +#include "ui_NavBar.h" + + +NavBar::NavBar(QList &buttonNames,QWidget *parent) : + QWidget(parent), ui(new Ui::NavBar) { + ui->setupUi(this); + layout=new QHBoxLayout(); + layout->setMargin(0); + this->setMinimumHeight(48); + this->setMaximumHeight(150); + for(auto buttonName : buttonNames){ + MyButton *button=new MyButton(buttonName->logo,buttonName->text,height(),height()); + //QSizePolicy sizePolicy(QSizePolicy::Policy::Maximum, QSizePolicy::QSizePolicy::Maximum); + //button->setSizePolicy(sizePolicy); + layout->addWidget(button); + buttons<setAlignment(Qt::AlignHCenter); + + this->setLayout(layout); + +} + +NavBar::~NavBar() { + for(auto button : buttons){ + delete button; + } + delete layout; + delete ui; +} + +void NavBar::paintEvent(QPaintEvent *event) { + QWidget::paintEvent(event); + + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + + QRectF rect(0, 0, this->width(), this->height()); + painter.fillRect(rect, QColor("#333332")); +} diff --git a/navbar.h b/navbar.h new file mode 100644 index 0000000..0dc8ef8 --- /dev/null +++ b/navbar.h @@ -0,0 +1,34 @@ +// +// Created by HW on 2023/07/26. +// + +#ifndef OFFICEASSISTANT_NAVBAR_H +#define OFFICEASSISTANT_NAVBAR_H + +#include +#include +#include +#include "MyButton.h" +#include "buttonstruct.h" + +QT_BEGIN_NAMESPACE +namespace Ui { class NavBar; } +QT_END_NAMESPACE + +class NavBar : public QWidget { +Q_OBJECT + +public: + NavBar(QList &buttonNames,QWidget *parent = nullptr); + + ~NavBar() override; +protected: + void paintEvent(QPaintEvent *event); +private: + Ui::NavBar *ui; + QHBoxLayout *layout; + QList buttons; +}; + + +#endif //OFFICEASSISTANT_NAVBAR_H diff --git a/navbar.ui b/navbar.ui new file mode 100644 index 0000000..f072f6b --- /dev/null +++ b/navbar.ui @@ -0,0 +1,22 @@ + + + + + + NavBar + + + + 0 + 0 + 400 + 300 + + + + NavBar + + + + + \ No newline at end of file