feat: 对 Tcp 的 Server/Client的 UI进行设计
且添加了对于MacOS和Win10的应用程序图标;使用QMake设置(.pro文件书写)
@ -34,7 +34,25 @@ HEADERS += \
|
|||||||
FORMS += \
|
FORMS += \
|
||||||
ExTcpClient.ui
|
ExTcpClient.ui
|
||||||
|
|
||||||
|
macx {
|
||||||
|
ICON = images/icon.icns
|
||||||
|
}
|
||||||
|
|
||||||
|
unix:!macx{
|
||||||
|
# linux only
|
||||||
|
}
|
||||||
|
|
||||||
|
win32 {
|
||||||
|
RC_ICONS = images/icon.ico
|
||||||
|
}
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
images/Image2.jpg \
|
||||||
|
images/Image1.png \
|
||||||
|
images/Image4.png \
|
||||||
|
images/Image5.png
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>ExTcpClient</class>
|
<class>ExTcpClient</class>
|
||||||
<widget class="QMainWindow" name="ExTcpClient" >
|
<widget class="QMainWindow" name="ExTcpClient">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
@ -9,16 +10,107 @@
|
|||||||
<height>300</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>ExTcpClient</string>
|
<string>ExTcpClient</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenuBar" name="menuBar" />
|
<widget class="QWidget" name="centralWidget">
|
||||||
<widget class="QToolBar" name="mainToolBar" />
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<widget class="QWidget" name="centralWidget" />
|
<item>
|
||||||
<widget class="QStatusBar" name="statusBar" />
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labIP">
|
||||||
|
<property name="text">
|
||||||
|
<string>服务器地址:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox">
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string>127.0.0.1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPort">
|
||||||
|
<property name="text">
|
||||||
|
<string>端口:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>10000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnSenf">
|
||||||
|
<property name="text">
|
||||||
|
<string>发送</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menuBar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolBar" name="mainToolBar">
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutDefault spacing="6" margin="11" />
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<pixmapfunction></pixmapfunction>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
BIN
QtTcpEx/ExTcpClient/images/Image1.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
QtTcpEx/ExTcpClient/images/Image2.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
QtTcpEx/ExTcpClient/images/Image3.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
QtTcpEx/ExTcpClient/images/Image4.png
Normal file
After Width: | Height: | Size: 803 B |
BIN
QtTcpEx/ExTcpClient/images/Image5.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
QtTcpEx/ExTcpClient/images/Image6.png
Normal file
After Width: | Height: | Size: 468 B |
BIN
QtTcpEx/ExTcpClient/images/icon.icns
Executable file
BIN
QtTcpEx/ExTcpClient/images/icon.ico
Executable file
After Width: | Height: | Size: 4.2 KiB |
@ -34,7 +34,25 @@ HEADERS += \
|
|||||||
FORMS += \
|
FORMS += \
|
||||||
ExTcpServer.ui
|
ExTcpServer.ui
|
||||||
|
|
||||||
|
macx {
|
||||||
|
ICON = images/icon.icns
|
||||||
|
}
|
||||||
|
|
||||||
|
unix:!macx{
|
||||||
|
# linux only
|
||||||
|
}
|
||||||
|
|
||||||
|
win32 {
|
||||||
|
RC_ICONS = images/icon.ico
|
||||||
|
}
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
images/Image2.jpg \
|
||||||
|
images/Image1.png \
|
||||||
|
images/Image3.png \
|
||||||
|
images/Image6.png
|
||||||
|
@ -1,24 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>ExTcpServer</class>
|
<class>ExTcpServer</class>
|
||||||
<widget class="QMainWindow" name="ExTcpServer" >
|
<widget class="QMainWindow" name="ExTcpServer">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>517</width>
|
||||||
<height>300</height>
|
<height>314</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>ExTcpServer</string>
|
<string>ExTcpServer</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenuBar" name="menuBar" />
|
<widget class="QWidget" name="centralWidget">
|
||||||
<widget class="QToolBar" name="mainToolBar" />
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<widget class="QWidget" name="centralWidget" />
|
<item>
|
||||||
<widget class="QStatusBar" name="statusBar" />
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labIP">
|
||||||
|
<property name="text">
|
||||||
|
<string>监听地址:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox">
|
||||||
|
<property name="editable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string>127.0.0.1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPort">
|
||||||
|
<property name="text">
|
||||||
|
<string>端口:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>10000</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="plainTextEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnSenf">
|
||||||
|
<property name="text">
|
||||||
|
<string>发送</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menuBar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>517</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolBar" name="mainToolBar">
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutDefault spacing="6" margin="11" />
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<pixmapfunction></pixmapfunction>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
BIN
QtTcpEx/ExTcpServer/images/Image1.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
QtTcpEx/ExTcpServer/images/Image2.jpg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
QtTcpEx/ExTcpServer/images/Image3.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
QtTcpEx/ExTcpServer/images/Image4.png
Normal file
After Width: | Height: | Size: 803 B |
BIN
QtTcpEx/ExTcpServer/images/Image5.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
QtTcpEx/ExTcpServer/images/Image6.png
Normal file
After Width: | Height: | Size: 468 B |
BIN
QtTcpEx/ExTcpServer/images/icon.icns
Executable file
BIN
QtTcpEx/ExTcpServer/images/icon.ico
Executable file
After Width: | Height: | Size: 4.2 KiB |