Skip to content

Commit

Permalink
create button
Browse files Browse the repository at this point in the history
  • Loading branch information
AMOSOMNUM committed Dec 15, 2023
1 parent 8dc060a commit 248eb54
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 107 deletions.
2 changes: 2 additions & 0 deletions SAST_Evento.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@
<file>res/image/department/lambda_2.png</file>
<file>res/font/MiSans-Regular.ttf</file>
<file>app.icns</file>
<file>qml/page/T_LessonPic.qml</file>
<file>res/image/department/SRD_lesson_pic_bg.jpg</file>
</qresource>
</RCC>
16 changes: 16 additions & 0 deletions qml/page/T_Calendar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ FluScrollablePage {
}
}
*/
FluButton {
id: btn_SRD_lesson_pic
text: "本周软研课表"
anchors {
top: parent.top
topMargin: 10
right: btn_create.left
rightMargin: 10
}
onClicked: {
CalendarController.generateLessonPic(CalendarController.SoftwareResearchAndDevelopmentDep)
MainWindow.window.pushPage(
"qrc:/qml/page/T_LessonPic.qml")
}
}

FluFilledButton {
id: btn_create
text: "创建活动"
Expand Down
217 changes: 112 additions & 105 deletions qml/page/T_LessonPic.qml
Original file line number Diff line number Diff line change
@@ -1,146 +1,153 @@
import QtQuick
import QtQuick.Controls
import FluentUI
import SAST_Evento

Rectangle {
id: lesson_pic
width: 1080
height: 1920 + (lesson_detail.num - 2) * 430
color: "#EAEAEA"

Image {
id: bg_image
anchors {
top: parent.top
left: parent.left
right: parent.right
}
FluScrollablePage {
id: calendar
launchMode: FluPageType.SingleTask

Rectangle {
id: lesson_pic
width: 1080
height: 1920 + (lesson_detail.num - 2) * 430
color: "#EAEAEA"

Text {
id: dep_title
Image {
id: bg_image
anchors {
top: parent.top
topMargin: 196
left: parent.left
leftMargin: 90
right: parent.right
}

text: qsTr("%1").arg(dep_name)
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
Text {
id: dep_title
anchors {
top: parent.top
topMargin: 196
left: parent.left
leftMargin: 90
}

property string dep_name: "软研"
}
text: qsTr("%1").arg(dep_name)
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop

Text {
id: week_title
anchors {
top: dep_title.bottom
left: dep_title.left
property string dep_name: "软研"
}

text: qsTr("第%1周").arg(week_num)
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
font.bold: true
Text {
id: week_title
anchors {
top: dep_title.bottom
left: dep_title.left
}

property int week_num: 15
}
text: qsTr("第%1周").arg(week_num)
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
font.bold: true

Text {
id: title_txt
anchors {
top: week_title.bottom
left: dep_title.left
property int week_num: 15
}

text: qsTr("授课课表")
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
font.bold: true
}
Text {
id: title_txt
anchors {
top: week_title.bottom
left: dep_title.left
}

source: "images/软研背景.jpg"
fillMode: Image.PreserveAspectFit
}
text: qsTr("授课课表")
font.pixelSize: 90
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignTop
font.bold: true
}

Column {
anchors {
top: bg_image.bottom
topMargin: 100
left: parent.left
leftMargin: 50
right: parent.right
source: "qrc:/res/image/department/SRD_lesson_pic_bg.jpg"
fillMode: Image.PreserveAspectFit
}

spacing: 100
Column {
anchors {
top: bg_image.bottom
topMargin: 100
left: parent.left
leftMargin: 50
right: parent.right
}

Repeater {
id: lesson_detail
property int num: 2
property var dep: ["柒世纪", "软件研发中心"]
spacing: 100

model: num
delegate: Rectangle {
height: 330
anchors {
left: parent.left
right: parent.right
rightMargin: 100
}
Repeater {
id: lesson_detail
property int num: 2
property var dep: ["C++", "软件研发中心"]

Rectangle {
id: dep_title_block_rect
height: 100
model: num
delegate: Rectangle {
height: 330
anchors {
left: parent.left
leftMargin: 50
right: dep_title_block.right
right: parent.right
rightMargin: 100
}
color: "#fdd547"
}

Row {
id: dep_title_block
anchors {
left: dep_title_block_rect.left
Rectangle {
id: dep_title_block_rect
height: 100
anchors {
left: parent.left
leftMargin: 50
right: dep_title_block.right
}
color: "#fdd547"
}

Image {
Row {
id: dep_title_block
anchors {
top: parent.top
topMargin: 5
bottom: parent.bottom
bottomMargin: 5
left: parent.left
leftMargin: 60
}

source: "images/柒世纪.png"
fillMode: Image.PreserveAspectFit
}
Image {
anchors {
top: parent.top
topMargin: 5
bottom: parent.bottom
bottomMargin: 5
}
source: "qrc:/res/image/department/cpp_1.svg"
fillMode: Image.PreserveAspectFit
}

Text {
rightPadding: 40
height: dep_title_block_rect.height
text: lesson_detail.dep[index]
font.pixelSize: 50
verticalAlignment: Text.AlignVCenter
font.bold: true
Text {
leftPadding: 20
rightPadding: 40
height: dep_title_block_rect.height
text: lesson_detail.dep[index]
font.pixelSize: 50
verticalAlignment: Text.AlignVCenter
font.bold: true
}
}
}

Text {
id: txt
anchors {
top: dep_title_block_rect.bottom
topMargin: 20
left: dep_title_block_rect.left
right: parent.right
bottom: parent.bottom
Text {
id: txt
anchors {
top: dep_title_block_rect.bottom
topMargin: 20
left: dep_title_block_rect.left
right: parent.right
bottom: parent.bottom
}
text: qsTr("%1").arg(index)
}
text: qsTr("%1").arg(index)
}
}
}
Expand Down
Binary file added res/image/department/SRD_lesson_pic_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions src/controller/ui/calendar.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
#ifndef CALENDARCONTROLLER_H
#define CALENDARCONTROLLER_H

#include "types.h"

#include <QtQml>

#include "types.h"

class CalendarController : public QObject {
Q_OBJECT
QML_NAMED_ELEMENT(CalendarController)
QML_SINGLETON

public:
enum DepartmentEnum {
SoftwareResearchAndDevelopmentDep,
MultiMediaDep,
ElectronicsDep
};
Q_ENUM(DepartmentEnum)

public:
Q_INVOKABLE void loadAllEventoInfo(QString date);
Q_INVOKABLE void loadEventoInfo(EventoID eventId);
Q_INVOKABLE void deleteEvento(EventoID eventId);
Q_INVOKABLE void cancelEvento(EventoID eventId);
Q_INVOKABLE void loadCheckCode(EventoID eventId);
Q_INVOKABLE void generateLessonPic(DepartmentEnum dep) {}

signals:
void loadAllEventoSuccessEvent();
Expand Down

0 comments on commit 248eb54

Please sign in to comment.