@ -0,0 +1,24 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 7
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 5
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
/usr/include/c++/7 \
|
||||
/usr/include/x86_64-linux-gnu/c++/7 \
|
||||
/usr/include/c++/7/backward \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include \
|
||||
/usr/local/include \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed \
|
||||
/usr/include/x86_64-linux-gnu \
|
||||
/usr/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
/usr/lib/gcc/x86_64-linux-gnu/7 \
|
||||
/usr/lib/x86_64-linux-gnu \
|
||||
/usr/lib \
|
||||
/lib/x86_64-linux-gnu \
|
||||
/lib
|
@ -0,0 +1,113 @@
|
||||
#include "album.h"
|
||||
#include "ui_album.h"
|
||||
#include <QPixmap>
|
||||
|
||||
album::album(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::album)
|
||||
{
|
||||
|
||||
ui->setupUi(this);
|
||||
this->installEventFilter(this);
|
||||
// showapp = new QLabel(this);
|
||||
// showapp->setMaximumSize(800, 480);
|
||||
// showapp->setMinimumSize(800, 480);
|
||||
// showapp->setGeometry(0,0,800,480);
|
||||
// showapp->setPixmap(QPixmap(":/album/images/8.jpg"));
|
||||
floatingbutton= new FloatingButton (this);
|
||||
// 将悬浮球的pressed()信号连接到槽函数onButtonPressed()上
|
||||
connect(floatingbutton, &FloatingButton::pressed, this, &album::onButtonPressed);
|
||||
}
|
||||
|
||||
album::~album()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
void album::onButtonPressed()
|
||||
{
|
||||
emit album_close(false);
|
||||
qDebug() << "悬浮球被按下了!";
|
||||
}
|
||||
void album::album_init()
|
||||
{
|
||||
}
|
||||
bool album::eventFilter(QObject *watch, QEvent *evn)
|
||||
{
|
||||
// static int press_x;
|
||||
// static int press_y;
|
||||
// static int relea_x;
|
||||
// static int relea_y;
|
||||
|
||||
// QMouseEvent *event = static_cast<QMouseEvent *>(evn);
|
||||
|
||||
// if(event->type()==QEvent::MouseButtonPress)
|
||||
// {
|
||||
// press_x = event->globalX();
|
||||
// press_y = event->globalY();
|
||||
// }
|
||||
|
||||
// if(event->type()==QEvent::MouseButtonRelease)
|
||||
// {
|
||||
// relea_x = event->globalX();
|
||||
// relea_y = event->globalY();
|
||||
// }
|
||||
|
||||
// //判断滑动方向(右滑)
|
||||
// if((relea_x - press_x)>20 && event->type()==QEvent::MouseButtonRelease && qAbs(relea_y-press_y)<50)
|
||||
// {
|
||||
// int current_page = ui->stackedWidget->currentIndex();
|
||||
// if(current_page<=2)
|
||||
// {
|
||||
// ui->label->setPixmap(ui->stackedWidget->currentWidget()->grab());
|
||||
|
||||
// QPropertyAnimation *animation1 = new QPropertyAnimation(ui->label,"geometry");
|
||||
// animation1->setDuration(1000);
|
||||
// animation1->setStartValue(QRect(0,0,this->width(),this->height()));
|
||||
// animation1->setEndValue(QRect(this->width()*2,0,this->width(),this->height()));
|
||||
// //animation1->start();
|
||||
|
||||
// ui->stackedWidget->setCurrentIndex(current_page+1);
|
||||
|
||||
// QPropertyAnimation *animation2 = new QPropertyAnimation(ui->stackedWidget->currentWidget(),"geometry");
|
||||
// animation2->setDuration(1000);
|
||||
// animation2->setStartValue(QRect(-this->width()*2,0,this->width(),this->height()));
|
||||
// animation2->setEndValue(QRect(0,0,this->width(),this->height()));
|
||||
|
||||
// QParallelAnimationGroup *group = new QParallelAnimationGroup;
|
||||
// group->addAnimation(animation1);
|
||||
// group->addAnimation(animation2);
|
||||
// group->start();
|
||||
// }
|
||||
// }
|
||||
|
||||
// //判断滑动方向(左滑)
|
||||
// if((press_x - relea_x)>20 && event->type()==QEvent::MouseButtonRelease && qAbs(relea_y-press_y)<50)
|
||||
// {
|
||||
// int current_page = ui->stackedWidget->currentIndex();
|
||||
// if(current_page>=0)
|
||||
// {
|
||||
// ui->label->setPixmap(ui->stackedWidget->currentWidget()->grab());
|
||||
|
||||
// QPropertyAnimation *animation1 = new QPropertyAnimation(ui->label,"geometry");
|
||||
// animation1->setDuration(1000);
|
||||
// animation1->setStartValue(QRect(0,0,this->width(),this->height()));
|
||||
// animation1->setEndValue(QRect(-this->width(),0,this->width(),this->height()));
|
||||
// //animation1->start();
|
||||
|
||||
// ui->stackedWidget->setCurrentIndex(current_page-1);
|
||||
|
||||
// QPropertyAnimation *animation2 = new QPropertyAnimation(ui->stackedWidget->currentWidget(),"geometry");
|
||||
// animation2->setDuration(1000);
|
||||
// animation2->setStartValue(QRect(this->width()*2,0,this->width(),this->height()));
|
||||
// animation2->setEndValue(QRect(0,0,this->width(),this->height()));
|
||||
|
||||
// QParallelAnimationGroup *group = new QParallelAnimationGroup;
|
||||
// group->addAnimation(animation1);
|
||||
// group->addAnimation(animation2);
|
||||
// group->start();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// return QWidget::eventFilter(watch,evn);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
#ifndef ALBUM_H
|
||||
#define ALBUM_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QParallelAnimationGroup>
|
||||
#include <QDebug>
|
||||
#include <QMouseEvent>
|
||||
#include <QString>
|
||||
#include "flyme/flyme.h"
|
||||
#include <QLabel>
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class album; }
|
||||
QT_END_NAMESPACE
|
||||
class FloatingButton;
|
||||
|
||||
class album : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
album(QWidget *parent = nullptr);
|
||||
~album();
|
||||
bool eventFilter(QObject *watch, QEvent *evn); //事件监听函数
|
||||
QLabel *showapp;
|
||||
|
||||
private:
|
||||
Ui::album *ui;
|
||||
/*图片的标号*/
|
||||
int image_num;
|
||||
/*图片的路劲*/
|
||||
QString image_path;
|
||||
|
||||
FloatingButton *floatingbutton;
|
||||
|
||||
int image_max=10;
|
||||
int i;
|
||||
void album_init();
|
||||
private slots:
|
||||
/*悬浮球 */
|
||||
void onButtonPressed();
|
||||
signals:
|
||||
void album_close(bool t);
|
||||
};
|
||||
#endif // ALBUM_H
|
@ -0,0 +1,34 @@
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked 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 it uses 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
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
album.cpp
|
||||
|
||||
HEADERS += \
|
||||
album.h
|
||||
|
||||
FORMS += \
|
||||
album.ui
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
src.qrc
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>album</class>
|
||||
<widget class="QMainWindow" name="album">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>album</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>801</width>
|
||||
<height>481</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/album/images/8.jpg);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,11 @@
|
||||
#include "album.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
album w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>images/1.jpg</file>
|
||||
<file>images/2.jpg</file>
|
||||
<file>images/3.jpg</file>
|
||||
<file>images/4.jpg</file>
|
||||
<file>images/5.jpg</file>
|
||||
<file>images/6.jpg</file>
|
||||
<file>images/7.jpg</file>
|
||||
<file>images/8.jpg</file>
|
||||
<file>images/9.jpg</file>
|
||||
<file>images/10.jpg</file>
|
||||
<file>images/11.jpg</file>
|
||||
<file>images/此文件夹是相册图片.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,39 @@
|
||||
#include "assistant.h"
|
||||
#include "ui_assistant.h"
|
||||
#include<QDebug>
|
||||
#include<QTime>
|
||||
|
||||
assistant::assistant(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::assistant)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QTime time = QTime::currentTime();
|
||||
ui->label->setText(time.toString("hh:mm"));
|
||||
|
||||
QDate date = QDate::currentDate();
|
||||
ui->label_2->setText(date.toString("yyyy年MM月dd日 dddd"));
|
||||
}
|
||||
|
||||
|
||||
assistant::~assistant()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
void assistant::on_pushButton_clicked()
|
||||
{
|
||||
emit climate_ready(true);
|
||||
qDebug()<<"天气";
|
||||
}
|
||||
//课程表
|
||||
void assistant::on_pushButton_3_clicked()
|
||||
{
|
||||
emit class_ready(true);
|
||||
qDebug()<<"课程表";
|
||||
}
|
||||
//闹钟
|
||||
void assistant::on_pushButton_2_clicked()
|
||||
{
|
||||
emit alarm_ready(true);
|
||||
qDebug()<<"闹钟";
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
#ifndef ASSISTANT_H
|
||||
#define ASSISTANT_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class assistant; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class assistant : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
assistant(QWidget *parent = nullptr);
|
||||
~assistant();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
void on_pushButton_3_clicked();
|
||||
|
||||
void on_pushButton_2_clicked();
|
||||
|
||||
private:
|
||||
Ui::assistant *ui;
|
||||
signals:
|
||||
void climate_ready(bool t);
|
||||
void class_ready(bool t);
|
||||
void alarm_ready(bool t);
|
||||
};
|
||||
#endif // ASSISTANT_H
|
@ -0,0 +1,394 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>assistant</class>
|
||||
<widget class="QMainWindow" name="assistant">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<underline>false</underline>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>assistant</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget#centralwidget{
|
||||
border-image: url(:/icon/abc.png);
|
||||
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>120</y>
|
||||
<width>421</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font: 57 105pt "Ubuntu";
|
||||
color: rgb(117, 80, 123);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>13:00</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>340</y>
|
||||
<width>391</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QComboBox#comboBox{ border: 0px; padding: 0px; background: white; border-image: url(:/icon/abc.png);border-radius:10px;}
|
||||
|
||||
QComboBox::drop-down { width: 0px; }
|
||||
QComboBox::down-arrow { image: none; }
|
||||
</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>08:00 ~ 09:35 电机拖动 电子楼402</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10:55 ~11:30 PLC技术 旭日楼503</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>14:30 ~16:05 自动控制 田家炳402</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>781</width>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>60</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(238, 238, 236);
|
||||
font: 57 20pt "Ubuntu";</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2022年11月06日 星期三</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/notice.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/alarm.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/Internet.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/wifi.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/battery.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>371</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>距离</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>27</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>期末考试</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>还有</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>27</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(138, 226, 52);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>125</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>天</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>340</y>
|
||||
<width>371</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="5,1">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724562_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>天气</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="5,1">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724519_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>课程表</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="5,1">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724469_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>时钟</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,55 @@
|
||||
#ifndef CAM_H
|
||||
#define CAM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QComboBox>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
#include <QDebug>
|
||||
#include "flyme/flyme.h"
|
||||
#include "album/album.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class CAM; }
|
||||
QT_END_NAMESPACE
|
||||
class Camera;
|
||||
class FloatingButton;
|
||||
class album;
|
||||
|
||||
class CAM : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CAM(QWidget *parent = nullptr);
|
||||
~CAM();
|
||||
|
||||
private:
|
||||
Ui::CAM *ui;
|
||||
/* 扫描是否存在摄像头 */
|
||||
void scanCameraDevice();
|
||||
/* 摄像头设备 */
|
||||
Camera *camera;
|
||||
|
||||
/* 拍照保存的照片 */
|
||||
QImage saveImage;
|
||||
|
||||
FloatingButton *floatingbutton;
|
||||
|
||||
album *showapp;
|
||||
private slots:
|
||||
/* 显示图像 */
|
||||
void showImage(const QImage&);
|
||||
/* 保存照片到本地 */
|
||||
void saveImageToLocal();
|
||||
/*悬浮球 */
|
||||
void onButtonPressed();
|
||||
signals:
|
||||
void cam_close(bool t);
|
||||
|
||||
};
|
||||
#endif // CAM_H
|
@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CAM</class>
|
||||
<widget class="QWidget" name="CAM">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>CAM</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(0, 0, 0);</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="displayLabel">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>0</y>
|
||||
<width>480</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(238, 238, 236);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="cam_traBut">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>60</y>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/cam/images/camera_play.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="cam_playBut">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>200</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton#cam_playBut {
|
||||
border-image: url(:/cam/images/canera_off.png);}
|
||||
QPushButton#cam_playBut:checked:hover {
|
||||
|
||||
border-image: url(:/cam/images/camera_playon.png);}
|
||||
QPushButton#cam_playBut :hpver{
|
||||
border-image: url(:/cam/images/canera_off.png);}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>20</y>
|
||||
<width>61</width>
|
||||
<height>431</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cam_flashBut">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
QPushButton#cam_flashBut {
|
||||
border-image: url(:/cam/images/camera_flash.png);}
|
||||
QPushButton#cam_flashBut:checked {
|
||||
|
||||
border-image: url(:/cam/images/camera_flashon.png);}
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cam_hdrBut">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/cam/images/camera_hdr.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cam_vidBut">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/cam/images/camera_video.png);
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cam_setBut">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/cam/images/camera_set.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="cam_albumBut">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>350</y>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/cam/images/camera_album.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,46 @@
|
||||
#ifndef CAMERA_H
|
||||
#define CAMERA_H
|
||||
|
||||
#include <QImage>
|
||||
#include <QTimer>
|
||||
/* 使用命名空间cv下的VideoCapture与Mat类 */
|
||||
namespace cv {
|
||||
class VideoCapture;
|
||||
class Mat;
|
||||
}
|
||||
|
||||
class Camera : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Camera(QObject *parent = nullptr);
|
||||
~Camera();
|
||||
|
||||
signals:
|
||||
/* 声明信号,用于传递有图片信号时显示图像 */
|
||||
void readyImage(const QImage&);
|
||||
|
||||
public slots:
|
||||
/* 用于开启定时器 */
|
||||
bool cameraProcess(bool);
|
||||
|
||||
/* 选择摄像头 */
|
||||
void selectCameraDevice(int);
|
||||
|
||||
private slots:
|
||||
/* 定时器时间到处理函数,发送图像数据信号 */
|
||||
void timerTimeOut();
|
||||
|
||||
private:
|
||||
/* 声明OpenCV的cv命名空间下的VideoCapture对象 */
|
||||
cv::VideoCapture * capture;
|
||||
|
||||
/* 定时器,定时处理获取图像 */
|
||||
QTimer * timer;
|
||||
|
||||
/* 图像转换处理函数 */
|
||||
QImage matToQImage(const cv::Mat&);
|
||||
};
|
||||
|
||||
|
||||
#endif // CAMERA_H
|
@ -0,0 +1,54 @@
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked 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 it uses 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
|
||||
TARGET_ARCH = $${QT_ARCH}
|
||||
contains(TARGET_ARCH, arm){
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += opencv4
|
||||
INCLUDEPATH += /opt/st/stm32mp1/3.1-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include
|
||||
} else {
|
||||
#库文件路径
|
||||
LIBS += -L/usr/local/lib \
|
||||
-lopencv_core \
|
||||
-lopencv_highgui \
|
||||
-lopencv_imgproc \
|
||||
-lopencv_videoio \
|
||||
-lopencv_imgcodecs
|
||||
#头文件路径
|
||||
INCLUDEPATH += /usr/local/lib/include
|
||||
}
|
||||
SOURCES += \
|
||||
camera.cpp \
|
||||
main.cpp \
|
||||
mylabel.cpp \
|
||||
CAM.cpp\
|
||||
|
||||
|
||||
HEADERS += \
|
||||
camera.h \
|
||||
mylabel.h \
|
||||
CAM.h
|
||||
|
||||
FORMS += \
|
||||
CAM.ui
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
src.qrc
|
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,11 @@
|
||||
#include "CAM.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
CAM w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
#include "mylabel.h"
|
||||
#include <QMouseEvent>
|
||||
|
||||
MyLabel::MyLabel(QWidget *parent) :
|
||||
QLabel(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MyLabel::mouseReleaseEvent(QMouseEvent *ev)
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton)
|
||||
{
|
||||
Q_UNUSED(ev);
|
||||
emit Clicked();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#ifndef MYLABEL_H
|
||||
#define MYLABEL_H
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class MyLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyLabel(QWidget *parent = 0);
|
||||
|
||||
void mouseReleaseEvent(QMouseEvent *ev);
|
||||
|
||||
signals:
|
||||
void Clicked();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MYLABEL_H
|
@ -0,0 +1,14 @@
|
||||
<RCC>
|
||||
<qresource prefix="/image">
|
||||
<file>images/camera_play.png</file>
|
||||
<file>images/camera_album.png</file>
|
||||
<file>images/camera_flash.png</file>
|
||||
<file>images/camera_flashon.png</file>
|
||||
<file>images/camera_hdr.png</file>
|
||||
<file>images/camera_playon.png</file>
|
||||
<file>images/camera_round.png</file>
|
||||
<file>images/camera_set.png</file>
|
||||
<file>images/camera_video.png</file>
|
||||
<file>images/canera_off.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,67 @@
|
||||
#ifndef CLASS_TABLE_H
|
||||
#define CLASS_TABLE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
#include <QMainWindow>
|
||||
#include <QLabel>
|
||||
#include <QSqlTableModel>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QTableView>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QDataWidgetMapper>
|
||||
#include <QSqlQueryModel>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QSpinBox>
|
||||
#include <QStandardItemModel>
|
||||
#include "flyme/flyme.h"
|
||||
|
||||
namespace Ui {
|
||||
class class_table;
|
||||
}
|
||||
class FloatingButton;
|
||||
|
||||
class class_table : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit class_table(QWidget *parent = nullptr);
|
||||
~class_table();
|
||||
|
||||
private:
|
||||
Ui::class_table *ui;
|
||||
|
||||
/* 数据库连接类 */
|
||||
QSqlDatabase sqlDatabase;
|
||||
|
||||
/* 用于查询数据 */
|
||||
QSqlQueryModel *sqlQueryModel;
|
||||
|
||||
/* 数据库操作模型 */
|
||||
QSqlTableModel *model;
|
||||
|
||||
/* 数据映射 */
|
||||
QDataWidgetMapper *dataWidgetMapper;
|
||||
|
||||
/* 选择模型 */
|
||||
QItemSelectionModel * itemSelectionModel;
|
||||
|
||||
FloatingButton *floatingbutton;
|
||||
|
||||
/* 数据库初始化 */
|
||||
void sqldata_init();
|
||||
|
||||
/* 数据库删除 */
|
||||
void sqldata_delate(int row);
|
||||
/*悬浮球 */
|
||||
void onButtonPressed();
|
||||
signals:
|
||||
void class_close(bool t);
|
||||
};
|
||||
|
||||
#endif // CLASS_TABLE_H
|
@ -0,0 +1,34 @@
|
||||
QT += core gui sql
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked 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 it uses 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
|
||||
|
||||
SOURCES += \
|
||||
class_table.cpp \
|
||||
main.cpp
|
||||
|
||||
HEADERS += \
|
||||
class_table.h
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
src.qrc
|
||||
|
||||
FORMS += \
|
||||
class_table.ui
|
@ -0,0 +1,323 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>class_table</class>
|
||||
<widget class="QWidget" name="class_table">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>420</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>18:00</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>160</y>
|
||||
<width>41</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>60</y>
|
||||
<width>41</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>9:55</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>380</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>16:25</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>40</y>
|
||||
<width>761</width>
|
||||
<height>441</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QHeaderView::section {
|
||||
font: 20px "微软雅黑";
|
||||
font-weight:bold;
|
||||
color: rgb(24, 100, 249);
|
||||
padding-left: 4px;
|
||||
border: 1px solid #e2e2e2;
|
||||
background-color:#cddffe;
|
||||
}
|
||||
|
||||
QTableView{
|
||||
border:none;
|
||||
color: rgb(119, 119, 119);
|
||||
gridline-color:#e2e2e2;
|
||||
}
|
||||
|
||||
QTableView::item::selected{
|
||||
background-color:#cddffe;
|
||||
color:rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
/*QTableView 左上角样式*/
|
||||
QTableView QTableCornerButton::section {
|
||||
background-color:#cddffe;
|
||||
border: 1px solid #e2e2e2;
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>120</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>9:35</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>0</y>
|
||||
<width>41</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/class_table/photos/rest.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>10</y>
|
||||
<width>191</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2022-2023学年第二学期</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>260</y>
|
||||
<width>41</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>80</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>8:00</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>40</y>
|
||||
<width>20</width>
|
||||
<height>441</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>220</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>11:30</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>280</x>
|
||||
<y>0</y>
|
||||
<width>201</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>25</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>第五周</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>290</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>14:30</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>41</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/class_table/photos/attend.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>750</x>
|
||||
<y>0</y>
|
||||
<width>41</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/class_table/photos/class1.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>10</y>
|
||||
<width>171</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2023-3-25 星期五</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>330</y>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>16:05</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,12 @@
|
||||
#include "class_table.h"
|
||||
#include "ui_class_table.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
class_table w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.0 KiB |
@ -0,0 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/addalarm1.png</file>
|
||||
<file>style.qss</file>
|
||||
<file>icons/addalarm2.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,10 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>photos/attend.png</file>
|
||||
<file>photos/class.png</file>
|
||||
<file>photos/class1.png</file>
|
||||
<file>photos/rest.png</file>
|
||||
<file>photos/啊棠.jpg</file>
|
||||
<file>photos/啊万.jpg</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,11 @@
|
||||
//#include "comnet.h"
|
||||
|
||||
//Comnet::Comnet(QObject *parent) : QObject(parent)
|
||||
//{
|
||||
// connect(this, SIGNAL(getclue()), this, SLOT(on_pushButton_2_clicked()));
|
||||
//}
|
||||
//void Comnet::on_pushButton_2_clicked()
|
||||
//{
|
||||
// emit wificloed();
|
||||
// qDebug()<<"get value";
|
||||
//}
|
@ -0,0 +1,27 @@
|
||||
#ifndef COMNET_H
|
||||
#define COMNET_H
|
||||
|
||||
//#include <QObject>
|
||||
//#include <QDebug>
|
||||
|
||||
//class Comnet : public QObject
|
||||
//{
|
||||
// Q_OBJECT
|
||||
//public:
|
||||
// explicit Comnet(QObject *parent = nullptr);
|
||||
|
||||
// Q_INVOKABLE void getValFromQml(int v) {
|
||||
// qDebug() << "value from qml is :" << v;
|
||||
// emit getclue();
|
||||
// }
|
||||
//private slots:
|
||||
// void on_pushButton_2_clicked();
|
||||
|
||||
//signals:
|
||||
// void valueFromCpp(int val);
|
||||
// void wificloed();
|
||||
// void getclue();
|
||||
|
||||
//};
|
||||
|
||||
#endif // COMNET_H
|
@ -0,0 +1,204 @@
|
||||
#include "desktop.h"
|
||||
#include <QDebug>
|
||||
#include <QThread>
|
||||
|
||||
desktop::desktop()
|
||||
{
|
||||
this->setGeometry(0, 0, 800, 480);
|
||||
this->setMinimumSize(800, 480);
|
||||
/*背景初始化*/
|
||||
bgWidget=new QWidget(this);
|
||||
bgWidget->setStyleSheet("border-image: url(:/icon/abc.png);");
|
||||
|
||||
/*app初始化*/
|
||||
musicplay= new music();
|
||||
climateapp=new climate();
|
||||
classtable= new class_table();
|
||||
alarmnotice = new Alarm();
|
||||
cameraapp = new CAM();
|
||||
setapp = new set();
|
||||
albumapp = new album();
|
||||
|
||||
/*桌面初始化*/
|
||||
mySlidePage = new SlidePage(this);
|
||||
mySlidePage->resize(this->size());
|
||||
|
||||
|
||||
desktop1= new assistant();
|
||||
mySlidePage->addPage(desktop1);
|
||||
|
||||
desk2= new desktop2();
|
||||
mySlidePage->addPage(desk2);
|
||||
|
||||
|
||||
// music
|
||||
connect(desk2, SIGNAL(music_ready(bool)),this, SLOT(music_handle(bool)));
|
||||
connect(musicplay, SIGNAL(music_close(bool)),this, SLOT(music_handle(bool)));
|
||||
|
||||
// camera
|
||||
connect(desk2, SIGNAL(cam_ready(bool)),this, SLOT(cam_handle(bool)));
|
||||
connect(cameraapp, SIGNAL(cam_close(bool)),this, SLOT(cam_handle(bool)));
|
||||
|
||||
// set
|
||||
connect(desk2, SIGNAL(set_ready(bool)),this, SLOT(set_handle(bool)));
|
||||
connect(setapp, SIGNAL(set_close(bool)),this, SLOT(set_handle(bool)));
|
||||
|
||||
// ablum
|
||||
connect(desk2, SIGNAL(album_ready(bool)),this, SLOT(album_handle(bool)));
|
||||
connect(albumapp, SIGNAL(album_close(bool)),this, SLOT(album_handle(bool)));
|
||||
|
||||
// climate
|
||||
connect(desktop1, SIGNAL(climate_ready(bool)),this, SLOT(climate_handle(bool)));
|
||||
connect(climateapp, SIGNAL(climate_close(bool)),this, SLOT(climate_handle(bool)));
|
||||
|
||||
// classtable
|
||||
connect(desktop1, SIGNAL(class_ready(bool)),this, SLOT(class_handle(bool)));
|
||||
connect(classtable, SIGNAL(class_close(bool)),this, SLOT(class_handle(bool)));
|
||||
|
||||
// alarm
|
||||
connect(desktop1, SIGNAL(alarm_ready(bool)),this, SLOT(alarm_handle(bool)));
|
||||
connect(alarmnotice, SIGNAL(alarm_close(bool)),this, SLOT(alarm_handle(bool)));
|
||||
|
||||
|
||||
|
||||
}
|
||||
desktop::~desktop()
|
||||
{
|
||||
delete bgWidget;
|
||||
delete mySlidePage;
|
||||
delete desktop1;
|
||||
delete desk2;
|
||||
delete musicplay;
|
||||
delete classtable;
|
||||
delete alarmnotice;
|
||||
delete climateapp;
|
||||
delete cameraapp;
|
||||
delete setapp;
|
||||
}
|
||||
|
||||
void desktop::onButtonPressed()
|
||||
{
|
||||
qDebug() << "悬浮球被按下了!";
|
||||
}
|
||||
void desktop::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
mySlidePage->resize(this->size());
|
||||
bgWidget->resize(this->size());
|
||||
}
|
||||
/*music handle*/
|
||||
void desktop::music_handle(bool t)
|
||||
{
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
musicplay->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
musicplay->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
|
||||
/*climate handle*/
|
||||
void desktop::climate_handle(bool t)
|
||||
{
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
climateapp->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
climateapp->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
/*class handle*/
|
||||
void desktop::class_handle(bool t)
|
||||
{
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
classtable->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
classtable->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
/*alarm handle*/
|
||||
void desktop::alarm_handle(bool t)
|
||||
{
|
||||
qDebug()<<t;
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
alarmnotice->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
alarmnotice->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
/*cam handle*/
|
||||
void desktop::cam_handle(bool t)
|
||||
{
|
||||
qDebug()<<t;
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
cameraapp->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
cameraapp->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
/*set handle*/
|
||||
void desktop::set_handle(bool t)
|
||||
{
|
||||
qDebug()<<t;
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
setapp->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
setapp->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
||||
/*set handle*/
|
||||
void desktop::album_handle(bool t)
|
||||
{
|
||||
if(t)
|
||||
{
|
||||
mySlidePage->close();
|
||||
albumapp->show();
|
||||
qDebug() << "open success";
|
||||
}
|
||||
else
|
||||
{
|
||||
mySlidePage->show();
|
||||
albumapp->close();
|
||||
qDebug() << "close success";
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
#ifndef DESKTOP_H
|
||||
#define DESKTOP_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "assistant.h"
|
||||
#include "slidepage/slidepage.h"
|
||||
#include "desktop2.h"
|
||||
#include "slidepage/slidepage.h"
|
||||
#include "music/music.h"
|
||||
#include "weather/climate.h"
|
||||
#include "class_table/class_table.h"
|
||||
#include "timer/alarm.h"
|
||||
#include "cam/CAM.h"
|
||||
#include "set/set.h"
|
||||
#include "album/album.h"
|
||||
|
||||
class assistant;
|
||||
class assistant;
|
||||
class SlidePage;
|
||||
class desktop2;
|
||||
class music;
|
||||
class climate;
|
||||
class class_table;
|
||||
class Alarm;
|
||||
class CAM;
|
||||
class set;
|
||||
class album;
|
||||
|
||||
class desktop : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
desktop();
|
||||
~desktop();
|
||||
private:
|
||||
|
||||
/*第一页*/
|
||||
assistant *desktop1;
|
||||
/*第二页*/
|
||||
desktop2 *desk2;
|
||||
/* 滑动页面管理对象*/
|
||||
SlidePage *mySlidePage;
|
||||
|
||||
QWidget *bgWidget;
|
||||
|
||||
/*app*/
|
||||
music *musicplay;
|
||||
class_table *classtable;
|
||||
Alarm *alarmnotice;
|
||||
climate *climateapp;
|
||||
CAM *cameraapp;
|
||||
set *setapp;
|
||||
album *albumapp;
|
||||
|
||||
/* 重设大小 */
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
private slots:
|
||||
void onButtonPressed();
|
||||
void music_handle(bool t);
|
||||
void climate_handle(bool t);
|
||||
void class_handle(bool t);
|
||||
void alarm_handle(bool t);
|
||||
void cam_handle(bool t);
|
||||
void set_handle(bool t);
|
||||
void album_handle(bool t);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // DESKTOP_H
|
@ -0,0 +1,43 @@
|
||||
#include "desktop2.h"
|
||||
#include "ui_desktop2.h"
|
||||
#include <QDebug>
|
||||
#include <QDate>
|
||||
#include "music/music.h"
|
||||
|
||||
desktop2::desktop2(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::desktop2)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QDate date = QDate::currentDate();
|
||||
ui->label_16->setText(date.toString("yyyy年MM月dd日 dddd"));
|
||||
}
|
||||
desktop2::~desktop2()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/*music*/
|
||||
void desktop2::on_pushButton_6_clicked()
|
||||
{
|
||||
emit music_ready(true);
|
||||
qDebug()<<"music";
|
||||
}
|
||||
/*相机*/
|
||||
void desktop2::on_pushButton_4_clicked()
|
||||
{
|
||||
emit cam_ready(true);
|
||||
qDebug()<<"camera";
|
||||
}
|
||||
|
||||
void desktop2::on_pushButton_5_clicked()
|
||||
{
|
||||
emit set_ready(true);
|
||||
qDebug()<<"set";
|
||||
}
|
||||
|
||||
void desktop2::on_pushButton_8_clicked()
|
||||
{
|
||||
emit album_ready(true);
|
||||
qDebug()<<"album";
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
#ifndef DESKTOP2_H
|
||||
#define DESKTOP2_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class desktop2;
|
||||
}
|
||||
|
||||
class desktop2 : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit desktop2(QWidget *parent = nullptr);
|
||||
~desktop2();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_6_clicked();
|
||||
|
||||
void on_pushButton_4_clicked();
|
||||
|
||||
void on_pushButton_5_clicked();
|
||||
|
||||
void on_pushButton_8_clicked();
|
||||
|
||||
private:
|
||||
Ui::desktop2 *ui;
|
||||
|
||||
signals:
|
||||
|
||||
void music_ready(bool t);
|
||||
void cam_ready(bool t);
|
||||
void set_ready(bool t);
|
||||
void album_ready(bool t);
|
||||
};
|
||||
|
||||
#endif // DESKTOP2_H
|
@ -0,0 +1,459 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>desktop2</class>
|
||||
<widget class="QWidget" name="desktop2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget#desktop2{
|
||||
border-image: url(:/icon/abc.png);
|
||||
}</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>781</width>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>60</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(238, 238, 236);
|
||||
background-image: none;
|
||||
font: 57 20pt "Ubuntu";
|
||||
</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>2022年11月06日 星期三</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/notice.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/alarm.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/Internet.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/wifi.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/battery.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>70</y>
|
||||
<width>741</width>
|
||||
<height>391</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<property name="spacing">
|
||||
<number>37</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724462_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>相机</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724531_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_23">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>设置</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724514_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>音乐</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724497_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>信息</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724488_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>相片</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724506_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_27">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>语音助手</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724563_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>视频</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="5,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_11">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border-image: url(:/icon/4724541_2.png);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_29">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>智能家庭</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,31 @@
|
||||
#ifndef FLYME_H
|
||||
#define FLYME_H
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QPoint>
|
||||
#include <QPushButton>
|
||||
#include <QIcon>
|
||||
|
||||
class FloatingButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FloatingButton(QWidget *parent = nullptr);
|
||||
~FloatingButton();
|
||||
|
||||
protected:
|
||||
void FloatingButton_init();
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
|
||||
signals:
|
||||
void pressed();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // FLYME_H
|
@ -0,0 +1,31 @@
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked 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 it uses 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
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
flyme.cpp
|
||||
|
||||
HEADERS += \
|
||||
flyme.h
|
||||
|
||||
FORMS += \
|
||||
flyme.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,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>flyme</class>
|
||||
<widget class="QMainWindow" name="flyme">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>flyme</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar"/>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,14 @@
|
||||
#include "flyme.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// 创建悬浮球按钮并显示
|
||||
FloatingButton button;
|
||||
button.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.2 KiB |