OfficeAssistant_Win10/OfficeAssistant_msvc/navbar.h

68 lines
1.3 KiB
C
Raw Normal View History

2023-07-26 19:48:14 +08:00
//
// Created by HW on 2023/07/26.
//
#ifndef OFFICEASSISTANT_NAVBAR_H
#define OFFICEASSISTANT_NAVBAR_H
#include <QWidget>
#include <QList>
#include <map>
2023-07-30 01:06:42 +08:00
#include "netio.h"
2023-07-26 19:48:14 +08:00
#include "MyButton.h"
2023-07-30 01:06:42 +08:00
#include <QColor>
#include <QPainter>
#include <QResizeEvent>
2023-07-26 19:48:14 +08:00
#include "buttonstruct.h"
2023-07-30 01:06:42 +08:00
#include <QtNetwork/QtNetwork>
2023-07-31 19:06:37 +08:00
#include "mainscreen.h"
2023-08-01 23:51:40 +08:00
#include <QImage>
2023-07-30 10:26:41 +08:00
#include "mainwindowlayout.h"
2023-07-30 01:06:42 +08:00
2023-07-26 19:48:14 +08:00
QT_BEGIN_NAMESPACE
namespace Ui { class NavBar; }
QT_END_NAMESPACE
class NavBar : public QWidget {
Q_OBJECT
2023-07-31 19:06:37 +08:00
signals:
void firstUrl(QString url);
2023-07-26 19:48:14 +08:00
public:
2023-07-31 19:06:37 +08:00
NavBar(ConfigResponse *configResponse,MainScreen *mainScreen,QWidget *parent = nullptr);
2023-07-26 19:48:14 +08:00
~NavBar() override;
protected:
2023-07-27 13:44:54 +08:00
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
2023-07-26 19:48:14 +08:00
private:
Ui::NavBar *ui;
2023-07-30 01:06:42 +08:00
QColor qColor;
2023-07-26 19:48:14 +08:00
QList<MyButton *> buttons;
2023-07-30 01:06:42 +08:00
QList<ButtonStruct> buttonStructs;
QByteArray *buffer;
2023-07-27 13:44:54 +08:00
int width2;
int height2;
2023-07-30 01:06:42 +08:00
QNetworkAccessManager *manager;
QNetworkReply *reply;
QEventLoop eventLoop;
QImage *logo;
2023-08-01 23:51:40 +08:00
QLabel *logo_label;
2023-07-30 01:06:42 +08:00
bool downloadSuccess=true;
void getLogoFromInternet(ConfigResponse *configResponse);
void getLogoFromLocal();
2023-07-31 19:06:37 +08:00
MainScreen *mainScreen;
2023-08-01 23:51:40 +08:00
QHBoxLayout *layout_left;
QHBoxLayout *layout_right;
QHBoxLayout *layout2;
2023-07-30 01:06:42 +08:00
private slots:
void storeToBuffer();
void cancelDownload();
2023-07-26 19:48:14 +08:00
};
#endif //OFFICEASSISTANT_NAVBAR_H