当前位置: 首页 > news >正文

Qt-Advanced-Docking-System示例程序

写了一些简单的示例程序,帮助我更好地使用和了解Qt-Advanced-Docking-System

1.写一个如图页面布局的程序

 

    m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidget=new ads::CDockWidget("中心页面");m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("页面2");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ads::CDockWidget* pDockWidget3=new ads::CDockWidget("页面3");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget4=new ads::CDockWidget("页面4");m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,pDockWidget4,centerDockWidget->dockAreaWidget());

2.在centerDockWidget->dockAreaWidget()的ads::BottomDockWidgetArea添加widget

    m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidget=new ads::CDockWidget("中心页面");m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("页面2");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ads::CDockWidget* pDockWidget3=new ads::CDockWidget("页面3");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget4=new ads::CDockWidget("页面4");m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,pDockWidget4,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget5=new ads::CDockWidget("页面5");m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,pDockWidget5,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget6=new ads::CDockWidget("页面6");m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,pDockWidget6,centerDockWidget->dockAreaWidget());

3.写一个如图所示的程序

    m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("页面2");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ads::CDockWidget* pDockWidget3=new ads::CDockWidget("页面3");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());

4.

    m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("页面2");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ads::CDockWidget* pDockWidget3=new ads::CDockWidget("页面3");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget4=new ads::CDockWidget("页面4");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget4,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget5=new ads::CDockWidget("页面5");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget5,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget6=new ads::CDockWidget("页面6");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget6,centerDockWidget->dockAreaWidget());

5.

    m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("页面2");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ads::CDockWidget* pDockWidget3=new ads::CDockWidget("页面3");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget4=new ads::CDockWidget("页面4");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget4,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget5=new ads::CDockWidget("页面5");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget5,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget6=new ads::CDockWidget("页面6");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget6,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget7=new ads::CDockWidget("页面7");m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,pDockWidget7,centerDockWidget->dockAreaWidget());ads::CDockWidget* pDockWidget8=new ads::CDockWidget("页面8");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget8,pDockWidget7->dockAreaWidget());ads::CDockWidget* pDockWidget9=new ads::CDockWidget("页面9");m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,pDockWidget9,pDockWidget7->dockAreaWidget());

6.

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QListWidget>
#include <QLabel>
#include "DockManager.h"
#include "QtDock/DockAreaWidget.h"
namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{Q_OBJECTpublic:explicit MainWindow(QWidget *parent = 0);~MainWindow();private slots:void on_actionAdd_triggered();private:Ui::MainWindow *ui;ads::CDockManager* m_pDockManger;ads::CDockWidget* centerDockWidget;ads::CDockWidget* bottomDockWidget;QListWidget* ListWidget;int mProjectNum=0;
};#endif // MAINWINDOW_H
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("测试页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("项目管理");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ListWidget=new QListWidget(pDockWidget2);pDockWidget2->setWidget(ListWidget);ads::CDockWidget* pDockWidget3=new ads::CDockWidget("测试页面2");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());bottomDockWidget=new ads::CDockWidget("底部页面");bottomDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,bottomDockWidget,centerDockWidget->dockAreaWidget());
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::on_actionAdd_triggered()
{mProjectNum++;ListWidget->addItem(QString("项目%1").arg(mProjectNum));ads::CDockWidget* cDockWidget=new ads::CDockWidget(QString("中心页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,cDockWidget,centerDockWidget->dockAreaWidget());ads::CDockWidget* bDockWidget=new ads::CDockWidget(QString("底部页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,bDockWidget,bottomDockWidget->dockAreaWidget());
}

7.dockWidgetsMap()

        QMap<QString, ads::CDockWidget*> map=m_pDockManger->dockWidgetsMap();qDebug()<<map.keys();for(auto key:map.keys()){qDebug()<<key.toStdString().c_str();}

中心页面

中心页面1

中心页面2

中心页面3

中心页面4

底部页面

底部页面1

底部页面2

底部页面3

底部页面4

测试页面1

测试页面2

项目管理

qDebug()<<"centralWidget():"<<m_pDockManger->centralWidget()->objectName().toStdString().c_str();

centralWidget(): 中心页面

8. 


        QMap<QString, ads::CDockWidget*> map=m_pDockManger->dockWidgetsMap();for(auto key:map.keys()){qDebug()<<key.toStdString().c_str();auto value = map[key];qDebug()<<"ads::CDockWidget:"<<value;qDebug()<<"dockAreaWidget:"<<value->dockAreaWidget();}

中心页面

ads::CDockWidget: ads::CDockWidget(0x3052108, name = "\u4E2D\u5FC3\u9875\u9762")

dockAreaWidget: ads::CDockAreaWidget(0x30818f0)

中心页面1

ads::CDockWidget: ads::CDockWidget(0x41f25a8, name = "\u4E2D\u5FC3\u9875\u97621")

dockAreaWidget: ads::CDockAreaWidget(0x30818f0)

底部页面

ads::CDockWidget: ads::CDockWidget(0x30f8f68, name = "\u5E95\u90E8\u9875\u9762")

dockAreaWidget: ads::CDockAreaWidget(0x30f90a8)

底部页面1

ads::CDockWidget: ads::CDockWidget(0x41f26c0, name = "\u5E95\u90E8\u9875\u97621")

dockAreaWidget: ads::CDockAreaWidget(0x30f90a8)

测试页面1

ads::CDockWidget: ads::CDockWidget(0x3092060, name = "\u6D4B\u8BD5\u9875\u97621")

dockAreaWidget: ads::CDockAreaWidget(0x3091ea8)

测试页面2

ads::CDockWidget: ads::CDockWidget(0x30eca80, name = "\u6D4B\u8BD5\u9875\u97622")

dockAreaWidget: ads::CDockAreaWidget(0x30ecad0)

项目管理

ads::CDockWidget: ads::CDockWidget(0x30d81b0, name = "\u9879\u76EE\u7BA1\u7406")

dockAreaWidget: ads::CDockAreaWidget(0x30d84a8)

9.

        QList<ads::CDockAreaWidget*> areas=m_pDockManger->openedDockAreas();qDebug()<<areas;

 (ads::CDockAreaWidget(0x3071828), ads::CDockAreaWidget(0x3082448), ads::CDockAreaWidget(0x30c81b0), ads::CDockAreaWidget(0x30dd250), ads::CDockAreaWidget(0x30e8fb8))

对应5块区域 

 

10.

        QMap<QString, ads::CDockWidget*> map=m_pDockManger->dockWidgetsMap();for(auto key:map.keys()){qDebug()<<key.toStdString().c_str();auto value = map[key];qDebug()<<"ads::CDockWidget:"<<value;qDebug()<<"dockAreaWidget:"<<value->dockAreaWidget();}

area: ads::CDockAreaWidget(0x31118a0) count: 5

area: ads::CDockAreaWidget(0x3122128) count: 1

area: ads::CDockAreaWidget(0x3168458) count: 1

area: ads::CDockAreaWidget(0x317c440) count: 1

area: ads::CDockAreaWidget(0x3189440) count: 5

相关函数:

QList<CDockWidget*> CDockAreaWidget::dockWidgets() const

 这个信号也比较好用

ads::CDockAreaWidget::currentChanged

11.

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QListWidget>
#include <QLabel>
#include "DockManager.h"
#include "QtDock/DockAreaWidget.h"
namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{Q_OBJECTpublic:explicit MainWindow(QWidget *parent = 0);~MainWindow();private slots:void on_actionAdd_triggered();private:Ui::MainWindow *ui;ads::CDockManager* m_pDockManger;ads::CDockWidget* centerDockWidget;QHash<int,ads::CDockWidget*> centerHash;QHash<int,ads::CDockWidget*> bottomHash;ads::CDockWidget* bottomDockWidget;QListWidget* ListWidget;int mProjectNum=0;QLabel * mLabelOne;QLabel * mLabelTwo;
};#endif // MAINWINDOW_H
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);m_pDockManger=new ads::CDockManager(this);this->setCentralWidget(m_pDockManger);centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("测试页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);mLabelOne=new QLabel(pDockWidget1);pDockWidget1->setWidget(mLabelOne);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("项目管理");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ListWidget=new QListWidget(pDockWidget2);connect(ListWidget,&QListWidget::currentItemChanged,this,[=](QListWidgetItem *current, QListWidgetItem *previous){int index=current->data(Qt::UserRole).toInt();ads::CDockAreaWidget* centerArea=centerDockWidget->dockAreaWidget();centerArea->setCurrentDockWidget(centerHash[index]);ads::CDockAreaWidget* bottomArea=bottomDockWidget->dockAreaWidget();bottomArea->setCurrentDockWidget(bottomHash[index]);QString msg=QString("当时是项目%1").arg(index);mLabelOne->setText(msg);mLabelTwo->setText(msg);});pDockWidget2->setWidget(ListWidget);ads::CDockWidget* pDockWidget3=new ads::CDockWidget("测试页面2");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());mLabelTwo=new QLabel(pDockWidget3);pDockWidget3->setWidget(mLabelTwo);bottomDockWidget=new ads::CDockWidget("底部页面");bottomDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,bottomDockWidget,centerDockWidget->dockAreaWidget());
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::on_actionAdd_triggered()
{mProjectNum++;QListWidgetItem *item;item=new QListWidgetItem(ListWidget);item->setText(QString("项目%1").arg(mProjectNum));item->setData(Qt::UserRole,mProjectNum);ListWidget->addItem(item);ListWidget->setCurrentItem(item);ads::CDockWidget* cDockWidget=new ads::CDockWidget(QString("中心页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,cDockWidget,centerDockWidget->dockAreaWidget());centerHash.insert(mProjectNum,cDockWidget);ads::CDockWidget* bDockWidget=new ads::CDockWidget(QString("底部页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,bDockWidget,bottomDockWidget->dockAreaWidget());bottomHash.insert(mProjectNum,bDockWidget);QString msg=QString("当时是项目%1").arg(mProjectNum);mLabelOne->setText(msg);mLabelTwo->setText(msg);
}

12.

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QListWidget>
#include <QLabel>
#include "DockManager.h"
#include "QtDock/DockAreaWidget.h"
namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{Q_OBJECTpublic:explicit MainWindow(QWidget *parent = 0);~MainWindow();private slots:void on_actionAdd_triggered();void onProjectChanged(int index);
private:Ui::MainWindow *ui;ads::CDockManager* m_pDockManger;ads::CDockWidget* centerDockWidget;ads::CDockWidget* bottomDockWidget;QListWidget* ListWidget;QHash<int,ads::CDockWidget*> centerHash;QHash<int,ads::CDockWidget*> bottomHash;QHash<int,QListWidgetItem*>  itemHash;int mProjectNum=0;QLabel * mLabelOne;QLabel * mLabelTwo;
};#endif // MAINWINDOW_H
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);m_pDockManger=new ads::CDockManager(this);qDebug()<<"m_pDockManger:"<<m_pDockManger;this->setCentralWidget(m_pDockManger);centerDockWidget=new ads::CDockWidget("中心页面");centerDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->setCentralWidget(centerDockWidget);m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,centerDockWidget);ads::CDockAreaWidget* centerArea=centerDockWidget->dockAreaWidget();connect(centerArea,&ads::CDockAreaWidget::currentChanged,this,&MainWindow::onProjectChanged);bottomDockWidget=new ads::CDockWidget("底部页面");bottomDockWidget->setFeature(ads::CDockWidget::NoTab,true);m_pDockManger->addDockWidget(ads::BottomDockWidgetArea,bottomDockWidget,centerDockWidget->dockAreaWidget());ads::CDockAreaWidget* bottomArea=bottomDockWidget->dockAreaWidget();connect(bottomArea,&ads::CDockAreaWidget::currentChanged,this,&MainWindow::onProjectChanged);ads::CDockWidget* pDockWidget1=new ads::CDockWidget("测试页面1");m_pDockManger->addDockWidget(ads::LeftDockWidgetArea,pDockWidget1);mLabelOne=new QLabel(pDockWidget1);pDockWidget1->setWidget(mLabelOne);ads::CDockWidget* pDockWidget2=new ads::CDockWidget("项目管理");m_pDockManger->addDockWidget(ads::TopDockWidgetArea,pDockWidget2,pDockWidget1->dockAreaWidget());ListWidget=new QListWidget(pDockWidget2);pDockWidget2->setWidget(ListWidget);connect(ListWidget,&QListWidget::currentItemChanged,this,[=](QListWidgetItem *current, QListWidgetItem *previous){int index=current->data(Qt::UserRole).toInt();onProjectChanged(index);});ads::CDockWidget* pDockWidget3=new ads::CDockWidget("测试页面2");m_pDockManger->addDockWidget(ads::RightDockWidgetArea,pDockWidget3,centerDockWidget->dockAreaWidget());mLabelTwo=new QLabel(pDockWidget3);pDockWidget3->setWidget(mLabelTwo);
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::on_actionAdd_triggered()
{mProjectNum++;QListWidgetItem *item;item=new QListWidgetItem(ListWidget);item->setText(QString("项目%1").arg(mProjectNum));item->setData(Qt::UserRole,mProjectNum);ListWidget->addItem(item);itemHash.insert(mProjectNum,item);ListWidget->setCurrentItem(item);ads::CDockWidget* cDockWidget=new ads::CDockWidget(QString("中心页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,cDockWidget,centerDockWidget->dockAreaWidget());centerHash.insert(mProjectNum,cDockWidget);ads::CDockWidget* bDockWidget=new ads::CDockWidget(QString("底部页面%1").arg(mProjectNum));m_pDockManger->addDockWidget(ads::CenterDockWidgetArea,bDockWidget,bottomDockWidget->dockAreaWidget());bottomHash.insert(mProjectNum,bDockWidget);QString msg=QString("当时是项目%1").arg(mProjectNum);mLabelOne->setText(msg);mLabelTwo->setText(msg);
}void MainWindow::onProjectChanged(int index)
{ListWidget->setCurrentItem(itemHash[index]);ads::CDockAreaWidget* centerArea=centerDockWidget->dockAreaWidget();centerArea->setCurrentDockWidget(centerHash[index]);ads::CDockAreaWidget* bottomArea=bottomDockWidget->dockAreaWidget();bottomArea->setCurrentDockWidget(bottomHash[index]);QString msg=QString("当时是项目%1").arg(index);mLabelOne->setText(msg);mLabelTwo->setText(msg);
}

相关文章:

Qt-Advanced-Docking-System示例程序

写了一些简单的示例程序&#xff0c;帮助我更好地使用和了解Qt-Advanced-Docking-System 1.写一个如图页面布局的程序 m_pDockMangernew ads::CDockManager(this);this->setCentralWidget(m_pDockManger);ads::CDockWidget* centerDockWidgetnew ads::CDockWidget("中…...

戴尔笔记本重装系统?笔记本卡顿失灵?一键重装系统!

随着科技的快速发展&#xff0c;笔记本电脑已成为我们日常生活和工作中不可或缺的工具。然而&#xff0c;随着时间的推移&#xff0c;笔记本可能会遇到各种问题&#xff0c;如系统卡顿、失灵等。这时&#xff0c;重装系统往往是一个有效的解决方案。本文将详细介绍如何在戴尔笔…...

ViewController 的常用跳转及返回方法

ViewController 的常用跳转及返回方法 ViewController 的常用跳转及返回方法模态跳转导航控制器选项卡控制器Storyboard 的 segues 方式跳转 ViewController 的常用跳转及返回方法 模态跳转 一个普通的视图控制器一般只有模态跳转的功能&#xff0c;这个方法是所有视图控制器…...

FFmpeg开发笔记(四十一)结合OBS与MediaMTX实现SRT直播推流

《FFmpeg开发实战&#xff1a;从零基础到短视频上线》一书的“10.2 FFmpeg推流和拉流”提到直播行业存在RTSP和RTMP两种常见的流媒体协议。除此以外&#xff0c;还有于2017年推出的SRT协议&#xff0c;相比常见的RTMP协议&#xff0c;SRT协议具有更低的延迟&#xff0c;并且消…...

探索AI的巅峰:详解GPT-3.5与GPT-4系列模型的区别

人工智能领域不断涌现出令人惊叹的技术突破&#xff0c;其中OpenAI的ChatGPT系列模型尤为引人注目。随着GPT-4的发布&#xff0c;技术开发者们对比分析其与前一代GPT-3.5的差异显得尤为重要。本文将深入探讨GPT-3.5和GPT-4系列模型的主要区别&#xff0c;帮助大家更好地理解和应…...

Linux-笔记 使用SCP命令传输文件报错 :IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

前言 使用scp命令向开发板传输文件发生报错&#xff0c;报错见下图; 解决 rm -rf /home/<用户名>/.ssh/known_hosts 此方法同样适用于使用ssh命令连接开发板报错的情况。 参考 https://blog.csdn.net/westsource/article/details/6636096...

计算机网络 静态路由及动态路由RIP

一、理论知识 1.静态路由 静态路由是由网络管理员手动配置在路由器上的固定路由路径。其优点是简单和对网络拓扑变化不敏感&#xff0c;缺点是维护复杂、易出错&#xff0c;且无法自动适应网络变化。 2.动态路由协议RIP RIP是一种基于距离向量的动态路由协议。它使用跳数作…...

Django实现部门管理功能

在这篇文章中,我们将介绍如何使用Django框架实现一个简单的部门管理功能。这个功能包括部门列表展示、添加新部门、编辑和删除部门等操作。 1. 项目设置 首先,确保你已经安装了Django并创建了一个新的Django项目。在项目中,我们需要创建一个名为​​app01​​的应用。 2.…...

概率论与数理统计期末复习

概率论常考知识点汇总 总括 1. 基础概率论 概率定义&#xff1a;理解概率是事件发生的可能性度量&#xff0c;范围从0&#xff08;不可能&#xff09;到1&#xff08;必然发生&#xff09;。概率公理&#xff1a;掌握概率的三大公理&#xff0c;即非负性、规范性和可加性。条…...

python 识别图片点击,设置坐标,离设置坐标越近的优先识别点击

import pyautogui import cv2 import numpy as np import mathdef find_and_click(template_path, target_x, target_y, match_threshold0.8):"""在屏幕上查找目标图片并点击。Args:template_path: 目标图片的路径。target_x: 预设的坐标 x 轴值。target_y: 预设…...

【实战教程】如何使用JMeter来轻松测试WebSocket接口?

1、websocket接口原理 打开网页&#xff1a;从http协议&#xff0c;升级到websocket协议&#xff0c;请求建立websocket连接服务器返回建立成功成功客户端向服务端发送匹配请求服务端选择一个客服上线服务器返回客服id客户端向服务器发送消息服务器推送消息给指定的客服服务器…...

【linux】详解——库

目录 概述 库 库函数 静态库 动态库 制作动静态库 使用动静态库 如何让系统默认找到第三方库 lib和lib64的区别 /和/usr/和/usr/local下lib和lib64的区别 环境变量 配置相关文件 个人主页&#xff1a;东洛的克莱斯韦克-CSDN博客 简介&#xff1a;C站最萌博主 相关…...

RuntimeError: “exp_vml_cpu“ not implemented for ‘Half‘

遇到 "exp_vml_cpu" not implemented for Half 这个运行时错误&#xff0c;意味着你尝试在一个操作中使用了半精度&#xff08;Half 或 float16&#xff09;数据类型&#xff0c;但是该操作在当前环境下并没有针对半精度数据类型的实现。 半精度&#xff08;float16&…...

JVM之双亲委派机制

1.双亲委派机制 在Java中&#xff0c;类加载器具有层次结构。每个Java实现的类加载器中保存了一个成员变量叫“父”类加载器&#xff08;parent&#xff09;&#xff0c;可以理解为上级&#xff0c;并不是继承关系。应用程序类加载器的parent父加载器是扩展类加载器&#xff0…...

Gemalto SafeNet Luna HSM服务器硬件监控指标解读

在现代化的信息安全体系中&#xff0c;硬件安全模块&#xff08;HSM&#xff09;扮演着至关重要的角色&#xff0c;它负责保护和管理敏感的数据和密钥。Gemalto SafeNet Luna HSM作为一款高性能的硬件安全模块&#xff0c;广泛应用于金融、政府和企业等领域。为了确保Luna HSM的…...

计算机视觉与人工智能领域常用期刊和会议缩写

在撰写论文时有时候会面临超篇幅的情况&#xff0c;这时候一个常用的操作便是使用期刊&#xff08;会议&#xff09;的缩写或者半缩写来替换期刊&#xff08;会议&#xff09;全称 为了方便自己后续使用相关的缩写 特此整理 如有不当之处 欢迎大家指正~~ 计算机视觉与人工智能…...

ONLYOFFICE桌面编辑器8.1版:个性化编辑和功能强化的全面升级

ONLYOFFICE是一款全面的办公套件&#xff0c;由Ascensio System SIA开发。该软件提供了一系列与微软Office系列产品相似的办公工具&#xff0c;包括处理文档&#xff08;ONLYOFFICE Document Editor&#xff09;、电子表格&#xff08;ONLYOFFICE Spreadsheet Editor&#xff0…...

用一个实例看如何分享大量照片 续篇二,关于Exif (Exchangeable Image File) - 可交换图像文件

续篇二&#xff1a;说说关于照片隐含的 Exif (Exchangeable Image File) 可交换图像文件 数码照片的Exif 参数有很多&#xff0c;重要的Exif信息&#xff1a;拍摄日期、时间、拍摄器材、GPS信息。 当然这主要对自己的档案有意义&#xff0c;如果放到网上还是建议抹去这些信息。…...

使用Python自动化收集和处理视频资源的教程

在这篇教程中&#xff0c;我们将介绍如何利用Python脚本自动化收集和处理视频资源。这篇文章将帮助您掌握基本的网络自动化技术&#xff0c;并使用相关库进行视频资源的获取和保存。以下是具体的实现步骤和代码示例。 环境准备 在开始之前&#xff0c;请确保您的工作环境中已…...

字节数组输出流转换为Base64方法记录

1. 今天在做字节数组转换Base64的时候遇到一个问题&#xff0c;转换成的Base64字符串自动换行&#xff0c;导致传输失败 关键代码&#xff1a; ByteArrayOutputStream out new ByteArrayOutputStream(); ............. BASE64Encoder encoder new BASE64Encoder(); Stri…...

浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)

✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义&#xff08;Task Definition&…...

论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(二)

HoST框架核心实现方法详解 - 论文深度解读(第二部分) 《Learning Humanoid Standing-up Control across Diverse Postures》 系列文章: 论文深度解读 + 算法与代码分析(二) 作者机构: 上海AI Lab, 上海交通大学, 香港大学, 浙江大学, 香港中文大学 论文主题: 人形机器人…...

DeepSeek 赋能智慧能源:微电网优化调度的智能革新路径

目录 一、智慧能源微电网优化调度概述1.1 智慧能源微电网概念1.2 优化调度的重要性1.3 目前面临的挑战 二、DeepSeek 技术探秘2.1 DeepSeek 技术原理2.2 DeepSeek 独特优势2.3 DeepSeek 在 AI 领域地位 三、DeepSeek 在微电网优化调度中的应用剖析3.1 数据处理与分析3.2 预测与…...

Xshell远程连接Kali(默认 | 私钥)Note版

前言:xshell远程连接&#xff0c;私钥连接和常规默认连接 任务一 开启ssh服务 service ssh status //查看ssh服务状态 service ssh start //开启ssh服务 update-rc.d ssh enable //开启自启动ssh服务 任务二 修改配置文件 vi /etc/ssh/ssh_config //第一…...

PPT|230页| 制造集团企业供应链端到端的数字化解决方案:从需求到结算的全链路业务闭环构建

制造业采购供应链管理是企业运营的核心环节&#xff0c;供应链协同管理在供应链上下游企业之间建立紧密的合作关系&#xff0c;通过信息共享、资源整合、业务协同等方式&#xff0c;实现供应链的全面管理和优化&#xff0c;提高供应链的效率和透明度&#xff0c;降低供应链的成…...

系统设计 --- MongoDB亿级数据查询优化策略

系统设计 --- MongoDB亿级数据查询分表策略 背景Solution --- 分表 背景 使用audit log实现Audi Trail功能 Audit Trail范围: 六个月数据量: 每秒5-7条audi log&#xff0c;共计7千万 – 1亿条数据需要实现全文检索按照时间倒序因为license问题&#xff0c;不能使用ELK只能使用…...

macOS多出来了:Google云端硬盘、YouTube、表格、幻灯片、Gmail、Google文档等应用

文章目录 问题现象问题原因解决办法 问题现象 macOS启动台&#xff08;Launchpad&#xff09;多出来了&#xff1a;Google云端硬盘、YouTube、表格、幻灯片、Gmail、Google文档等应用。 问题原因 很明显&#xff0c;都是Google家的办公全家桶。这些应用并不是通过独立安装的…...

今日学习:Spring线程池|并发修改异常|链路丢失|登录续期|VIP过期策略|数值类缓存

文章目录 优雅版线程池ThreadPoolTaskExecutor和ThreadPoolTaskExecutor的装饰器并发修改异常并发修改异常简介实现机制设计原因及意义 使用线程池造成的链路丢失问题线程池导致的链路丢失问题发生原因 常见解决方法更好的解决方法设计精妙之处 登录续期登录续期常见实现方式特…...

Linux --进程控制

本文从以下五个方面来初步认识进程控制&#xff1a; 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程&#xff0c;创建出来的进程就是子进程&#xff0c;原来的进程为父进程。…...

LeetCode - 199. 二叉树的右视图

题目 199. 二叉树的右视图 - 力扣&#xff08;LeetCode&#xff09; 思路 右视图是指从树的右侧看&#xff0c;对于每一层&#xff0c;只能看到该层最右边的节点。实现思路是&#xff1a; 使用深度优先搜索(DFS)按照"根-右-左"的顺序遍历树记录每个节点的深度对于…...