forked from changfeng1050/SerialWizard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.h
45 lines (24 loc) · 1.16 KB
/
global.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Created by chang on 2017-08-02.
//
#ifndef SERIALWIZARD_GLOBAL_H
#define SERIALWIZARD_GLOBAL_H
#include <QString>
#include <QWidget>
extern QString utf82Gbk(const QString &inStr);
extern QString fromUtf8(const QByteArray &data);
extern QString fromGbk(const QByteArray &data);
extern QByteArray toGbkByteArray(const QString &text);
extern QByteArray toUtf8ByteArray(const QString &text);
extern QString getTimestamp();
extern bool okToContinue(const QString &title, const QString &text, QWidget *parent = nullptr);
extern bool showQuestion(const QString &title, const QString &text, QWidget *parent = nullptr);
extern void showError(const QString &title, const QString &text, QWidget *parent = nullptr);
extern bool showWarning(const QString &title, const QString &text, QWidget *parent = nullptr);
extern void showMessage(const QString &title, const QString &text, QWidget *parent = nullptr);
extern QString getFileSuffix(const QString &filePath);
extern QString getFileDir(const QString &filePath);
extern QString getIp();
extern QByteArray dataToHex(const QByteArray &data);
extern QByteArray dataFromHex(const QString &data);
#endif //SERIALWIZARD_GLOBAL_H