Compare commits
4 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
ad7fd7e64f | 12 months ago |
|
|
674609f154 | 1 year ago |
|
|
5e48445274 | 1 year ago |
|
|
0b397554d2 | 1 year ago |
@ -1,28 +1,23 @@
|
||||
#include "widget.h"
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QStyle>
|
||||
#include <QStyleFactory>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// print SDK Version
|
||||
qDebug() << "ViewLink SDK Version: " << GetSDKVersion();
|
||||
|
||||
// initialize SDK
|
||||
VLK_Init();
|
||||
|
||||
|
||||
|
||||
// 应用样式表
|
||||
QFile styleFile(":/styles/resources/styles/main.qss");
|
||||
if (styleFile.open(QFile::ReadOnly)) {
|
||||
QString styleSheet = QLatin1String(styleFile.readAll());
|
||||
a.setStyleSheet(styleSheet);
|
||||
styleFile.close();
|
||||
}
|
||||
|
||||
Widget w;
|
||||
w.show();
|
||||
|
||||
int ret = a.exec();
|
||||
|
||||
// diconnect all
|
||||
VLK_Disconnect();
|
||||
|
||||
// uninitialize SDK
|
||||
VLK_UnInit();
|
||||
|
||||
return ret;
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@ -1,7 +1,23 @@
|
||||
<RCC>
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/image">
|
||||
<file>circle_empty_48x48.png</file>
|
||||
<file>circle_selected_32x32.png</file>
|
||||
<file>RecordingFlash_32x32.png</file>
|
||||
<!-- 新增图标 -->
|
||||
<file>resources/icons/up.png</file>
|
||||
<file>resources/icons/down.png</file>
|
||||
<file>resources/icons/left.png</file>
|
||||
<file>resources/icons/right.png</file>
|
||||
<file>resources/icons/home.png</file>
|
||||
<file>resources/icons/zoom_in.png</file>
|
||||
<file>resources/icons/zoom_out.png</file>
|
||||
<file>resources/icons/camera.png</file>
|
||||
<file>resources/icons/record_start.png</file>
|
||||
<file>resources/icons/record_stop.png</file>
|
||||
<file>resources/icons/connect.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
<qresource prefix="/styles">
|
||||
<file>resources/styles/main.qss</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
@ -0,0 +1,225 @@
|
||||
/* 主窗口样式 */
|
||||
QWidget {
|
||||
background-color: #1e1e1e;
|
||||
font-family: "Microsoft YaHei", "SimHei", "Arial";
|
||||
font-size: 9pt;
|
||||
color: #2d2d30;
|
||||
}
|
||||
|
||||
/* 顶部分组框样式 */
|
||||
QGroupBox {
|
||||
background-color: #2d2d30;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 4px;
|
||||
margin-top: 10px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
QGroupBox::title {
|
||||
subcontrol-origin: margin;
|
||||
left: 10px;
|
||||
padding: 0 8px;
|
||||
color: #7a9fb8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 按钮通用样式 */
|
||||
QPushButton {
|
||||
background-color: #333337;
|
||||
color: #e0e0e0;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
min-height: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: #404045;
|
||||
border: 1px solid #535358;
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: #292929;
|
||||
border: 1px solid #535358;
|
||||
}
|
||||
|
||||
/* 方向和功能按钮样式 */
|
||||
#btnUp, #btnDown, #btnLeft, #btnRight, #btnHome,
|
||||
#btnZoomIn, #btnZoomOut {
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 15px;
|
||||
min-width: 30px;
|
||||
min-height: 30px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#btnUp:hover, #btnDown:hover, #btnLeft:hover, #btnRight:hover, #btnHome:hover,
|
||||
#btnZoomIn:hover, #btnZoomOut:hover {
|
||||
background-color: #3a3a3c;
|
||||
border: 1px solid #535358;
|
||||
}
|
||||
|
||||
/* 拍照和录像按钮样式 */
|
||||
#btnGimbalTakePhoto, #btnStartRecord, #btnStopRecord {
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#btnGimbalTakePhoto:hover, #btnStartRecord:hover {
|
||||
background-color: #3a3a3c;
|
||||
border: 1px solid #535358;
|
||||
}
|
||||
|
||||
/* 连接按钮样式 */
|
||||
#btnConnectTCP, #btnConnctSerialPort {
|
||||
background-color: #3a3a3c;;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
#btnConnectTCP:hover, #btnConnctSerialPort:hover {
|
||||
background-color: #3a3a3c;;
|
||||
}
|
||||
|
||||
/* 视频控制按钮样式 */
|
||||
#btnOpenNetworkVideo, #btnOpenUSBVideo {
|
||||
background-color: #3a3a3c;;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
#btnOpenNetworkVideo:hover, #btnOpenUSBVideo:hover {
|
||||
background-color: #3a3a3c;
|
||||
}
|
||||
|
||||
/* 输入框和下拉框样式 */
|
||||
QComboBox, QLineEdit {
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
background-color: #2d2d30;
|
||||
color: #e0e0e0;
|
||||
selection-background-color: #3f3f66;
|
||||
min-height: 32px;
|
||||
qproperty-alignment: 'AlignCenter';
|
||||
}
|
||||
|
||||
QComboBox:focus, QLineEdit:focus {
|
||||
border: 1px solid #7a9fb8;
|
||||
}
|
||||
|
||||
QComboBox::drop-down {
|
||||
border: none;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
QComboBox::down-arrow {
|
||||
image: url(:/image/resources/icons/down.png);
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView {
|
||||
background-color: #252526;
|
||||
border: 1px solid #3f3f46;
|
||||
selection-background-color: #3f3f66;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
/* 滑块样式 */
|
||||
QSlider::groove:horizontal {
|
||||
height: 6px;
|
||||
background: #3d3d3d;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal {
|
||||
background: #7a9fb8;
|
||||
border: none;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-top: -4px;
|
||||
margin-bottom: -4px;
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal {
|
||||
background: #4a6b82;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 文本浏览器样式 */
|
||||
QTextBrowser {
|
||||
background-color: #252526;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
color: #e0e0e0;
|
||||
selection-background-color: #3f3f66;
|
||||
}
|
||||
|
||||
/* 视频显示区域样式 */
|
||||
#widgetMainVideo {
|
||||
background-color: #121212;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 控制面板区域样式 */
|
||||
#widgetDevControl {
|
||||
background-color: #2d2d30;
|
||||
border: 1px solid #3f3f46;
|
||||
border-radius: 3px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* 状态显示区域样式 */
|
||||
#widgetDevStatus {
|
||||
background-color: #252526;
|
||||
border-top: 1px solid #3f3f46;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#widgetDevStatus QLabel {
|
||||
color: #a0a0a0;
|
||||
font-weight: normal;
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
/* 数值标签特殊样式 */
|
||||
#lbYaw, #lbPitch, #lbTargetLat, #lbTargetLng,
|
||||
#lbTargetAlt, #lbZoom, #lbLaserDistance {
|
||||
color: #7a9fb8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 标签样式 */
|
||||
QLabel {
|
||||
color: #e0e0e0;
|
||||
background-color: #2d2d30; /* 与 QGroupBox 相同 */
|
||||
}
|
||||
|
||||
/* 复选框样式 */
|
||||
QCheckBox {
|
||||
spacing: 5px;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
QCheckBox::indicator {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked {
|
||||
border: 1px solid #3f3f46;
|
||||
background-color: #252526;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:checked {
|
||||
border: 1px solid #7a9fb8;
|
||||
background-color: #2c4257;
|
||||
border-radius: 2px;
|
||||
}
|
||||