68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
//
|
|
// Created by HW on 2023/07/26.
|
|
//
|
|
|
|
#ifndef OFFICEASSISTANT_NAVBAR_H
|
|
#define OFFICEASSISTANT_NAVBAR_H
|
|
|
|
#include <QWidget>
|
|
#include <QList>
|
|
#include <map>
|
|
#include "netio.h"
|
|
#include "MyButton.h"
|
|
#include <QColor>
|
|
#include <QPainter>
|
|
#include <QResizeEvent>
|
|
#include "buttonstruct.h"
|
|
#include <QtNetwork/QtNetwork>
|
|
#include "mainscreen.h"
|
|
#include <QImage>
|
|
#include "mainwindowlayout.h"
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class NavBar; }
|
|
QT_END_NAMESPACE
|
|
|
|
class NavBar : public QWidget {
|
|
Q_OBJECT
|
|
signals:
|
|
void firstUrl(QString url);
|
|
public:
|
|
NavBar(ConfigResponse *configResponse,MainScreen *mainScreen,QWidget *parent = nullptr);
|
|
|
|
~NavBar() override;
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
|
|
private:
|
|
Ui::NavBar *ui;
|
|
QColor qColor;
|
|
QList<MyButton *> buttons;
|
|
QList<ButtonStruct> buttonStructs;
|
|
QByteArray *buffer;
|
|
int width2;
|
|
int height2;
|
|
QNetworkAccessManager *manager;
|
|
QNetworkReply *reply;
|
|
QEventLoop eventLoop;
|
|
QImage *logo;
|
|
QLabel *logo_label;
|
|
bool downloadSuccess=true;
|
|
void getLogoFromInternet(ConfigResponse *configResponse);
|
|
void getLogoFromLocal();
|
|
MainScreen *mainScreen;
|
|
QHBoxLayout *layout_left;
|
|
QHBoxLayout *layout_right;
|
|
QHBoxLayout *layout2;
|
|
private slots:
|
|
void storeToBuffer();
|
|
void cancelDownload();
|
|
};
|
|
|
|
|
|
#endif //OFFICEASSISTANT_NAVBAR_H
|