OfficeAssistant_Win10/OfficeAssistant_msvc/navbar.h

72 lines
1.4 KiB
C
Raw Permalink Normal View History

2023-08-17 01:10:27 +08:00
//
2023-08-13 12:16:22 +08:00
// 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);
2023-08-18 19:09:55 +08:00
public slots:
void refresh(int state);
2023-08-13 12:16:22 +08:00
public:
2023-08-15 11:17:09 +08:00
NavBar(MainScreen *mainScreen,QWidget *parent = nullptr);
2023-08-13 12:16:22 +08:00
~NavBar() override;
protected:
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
2023-08-17 01:10:27 +08:00
void getLogoFromInternet(ConfigResponse* configResponse);
2023-08-13 12:16:22 +08:00
private:
Ui::NavBar *ui;
QColor qColor;
QList<MyButton *> buttons;
QList<ButtonStruct> buttonStructs;
QByteArray *buffer;
int width2;
int height2;
2023-08-18 19:09:55 +08:00
QWidget* parent;
2023-08-13 12:16:22 +08:00
QNetworkAccessManager *manager;
QNetworkReply *reply;
QEventLoop eventLoop;
QPixmap *logo;
QLabel *logo_label;
bool downloadSuccess=true;
//void getLogoFromLocal();
MainScreen *mainScreen;
QHBoxLayout *layout_left;
QHBoxLayout *layout_right;
QHBoxLayout *layout2;
private slots:
void storeToBuffer();
void cancelDownload();
};
#endif //OFFICEASSISTANT_NAVBAR_H