-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
75 lines (67 loc) · 1.85 KB
/
main.cpp
File metadata and controls
75 lines (67 loc) · 1.85 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "RCWidgets.h"
#include <QtWidgets/QApplication>
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
RCWidgets RC;
RC.resize(1080, 1920);
//Serial->show();
RC.show();
return a.exec();
}
//int main(int argc, char* argv[]) {
// QApplication app(argc, argv);
// SerialPort window;
// window.resize(400, 400); // ´°¿Ú´óС
// window.show();
// return app.exec();
//}
//
//#include <QApplication>
//#include <QWidget>
//#include <QVBoxLayout>
//#include <QLabel>
//#include <QNetworkInterface>
//#include <QHostAddress>
//
//QString getLocalIP() {
// QString ipAddress;
//
// const QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
//
// for (const QNetworkInterface& interface : interfaces) {
// if (interface.flags().testFlag(QNetworkInterface::IsUp) &&
// !interface.flags().testFlag(QNetworkInterface::IsLoopBack)) {
//
// const QList<QNetworkAddressEntry> entries = interface.addressEntries();
// for (const QNetworkAddressEntry& entry : entries) {
// if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
// ipAddress = entry.ip().toString();
// break;
// }
// }
// }
// if (!ipAddress.isEmpty()) {
// break;
// }
// }
//
// return ipAddress.isEmpty() ? "No IP Address found" : ipAddress;
//}
//
//int main(int argc, char* argv[]) {
// QApplication app(argc, argv);
//
// QWidget window;
// window.setWindowTitle("Local IP Address");
//
// QVBoxLayout* layout = new QVBoxLayout(&window);
// QLabel* ipLabel = new QLabel("Your Local IP Address: " + getLocalIP());
// layout->addWidget(ipLabel);
//
// window.setLayout(layout);
// window.resize(300, 100);
// window.show();
//
// return app.exec();
//}