当前位置: 首页 > 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…...

在eclipse中导入idea项目步骤

一、可以把其它项目的.project&#xff0c; .classpath文件拷贝过来&#xff0c;修改相应的地方则可。 1、.project文件只需要修改<name>xxx</name>这个项目名称则可 2、.classpath文件通常不用改&#xff0c; 二、右击 项目名 >选择“Properties”>选择 Re…...

海思SS928/SD3403开发笔记4——u盘挂载

首先一定要将u盘格式化成fat32。 挂载 mkdir /mnt/usb mount /dev/sda1 /mnt/usb成功示意图&#xff1a; 取消挂载 umount /mnt/usb...

偏微分方程算法之抛物型方程差分格式编程示例六(混合边界条件下C-N格式)

目录 一、研究问题 二、C++代码 三、计算结果 一、研究问题 对于混合边界条件下的抛物型偏微分方程求解,我们使用Crank-Nicolson格式(C-N格式),边界条件采用中心差商,即...

【5G核心网】5G NWDAF(Network Data Analytics Function)网元功能介绍

博主未授权任何人或组织机构转载博主任何原创文章&#xff0c;感谢各位对原创的支持&#xff01; 博主链接 本人就职于国际知名终端厂商&#xff0c;负责modem芯片研发。 在5G早期负责终端数据业务层、核心网相关的开发工作&#xff0c;目前牵头6G技术研究。 博客内容主要围绕…...

今日思考分享:全网爆火的山东车牌之歌原因是什么?

山东车牌之歌的爆火反映了一种潜在而又浅显的需求被满足的过程。 首先&#xff0c;这首歌击中了人们的“潜”需求。在日常出行中&#xff0c;我们确实会偶尔对看到的不同地区车牌产生好奇&#xff0c;但往往这种好奇心一闪而过&#xff0c;没有具体的途径去满足。而山东车牌之歌…...

Spring Boot 2.x + Mybatis Plus 多数据源配置

MP官方文档提供有多数据源配置方案&#xff0c;这里没有使用其方案&#xff0c;原因是项目不想引入过多依赖 提供一下官网的文档供各位选择多数据源支持 | MyBatis-Plus (baomidou.com) 配置文件 application.properties文件配置两个数据源信息&#xff0c;yaml文件自行修改…...

2、数据库模型图、er图

关系 user和administarators是多对一的关系 user和order是一对多的关系 shipped和order是多对一的关系 order和books是多对多的关系 leavewords和order是一对一的关系 stock和books是一对多的关系 Chens 数据库表示法——ER图 Crows Foot数据库表示法——数据库模型图 Navicat表…...

Docker的理解

Docker的理解 Docker为什么用Docker&#xff1f;1.提升系统资源利用率2.更快速的交付和部署3.高效的部署和扩容4.更简单的管理 Docker核心技术Docker镜像Docker容器Docker仓库 Docker实现原理Linux NamespaceCgroupUnion FS Docker的应用场景1.微服务架构2.持续集成3.快速部署和…...

通信协议总结

IIC 基本特点 同步&#xff0c;半双工 标准100KHz&#xff0c;最高400KHz&#xff08;IIC主要应用于低速设备&#xff09; 硬件组成 需外接上拉电阻 通信过程 空闲状态 SDA和SCL都处于高电平 开始信号S和终止信号P 在数据传输过程中&#xff0c;当SCL0时&#xff0c;SDA才…...

Pinia + 组合式写法 + 选项式写法

选项式&#xff1a; 1.定义Store import { defineStore } from pinia// option api 选项式 export const useAlterStore defineStore(alter, {state: () > {return {num: 1}},getters: { // 可以看做是计算属性doubleCount: (state) > state.num * 2},actions: {// 同…...

网站建设 教程/百度关键词怎么优化

Arduino开发环境搭建 获取Arduino IDE开发工具 下载地址 &#xff1a;http://arduino.cc/en/Main/Software 可以下载release 版、Beta版和前期版本 Arduino的开发性&#xff0c;支持源码下载 支持的平台有 Windows、MAC OS X、Linux Windows 平台上面 Arduino IDE下载后为zip包…...

wordpress手动更新插件/百度推广的方式

我有点困惑&#xff0c;我无法使用MSVC在Windows上进行C开发设置Visual Studio Code . 网络上的所有人都说他们对设置和使用一切都很容易感到高兴&#xff0c;但我找不到任何简单的指南;他们中的大多数只是跳过设置部分&#xff0c;并显示一切有效&#xff0c;包括代码完成/智能…...

酒店网站怎么做/企业品牌网站营销

很多朋友看完macOS Big Sur的介绍就把系统升级到big sur了&#xff0c;面对半成品的开发者预览版&#xff08;Developer Preview&#xff09;&#xff0c;很多人表示无法接受&#xff0c;可降回10.15.5 的时候&#xff0c;提示不能回退老版本&#xff0c;那么macOS Big Sur如何…...

我想学做网站/重庆排名优化整站优化

通过对全球2944位首席信息官的年度调查&#xff0c;全球领先的信息技术研究和顾问公司Gartner发现人们现已深处数字商业时代&#xff0c;许多企业正根据数字化能力重构业务与运营模式。本文探讨了2016年中国首席信息官议程的三项主要调查结果&#xff0c;此次调查包含来自中国8…...

做网站源代码/成都seo论坛

通过kmeans分析出租车数据并进行可视化&#xff08;1&#xff09;数据准备&#xff08;2&#xff09;创建dataframe&#xff08;3&#xff09;kmeans聚类分析&#xff08;4&#xff09;调用百度API进行数据可视化&#xff08;1&#xff09;数据准备 采用数据为出租车载客时的G…...

浙江华临建设集团有限公司网站/seo行业网

天龙八部(武侠世界)的源码很可能是天龙八部代码流出后改写的&#xff0c;因为在看了代码中可以找到一些证据&#xff0c;整个客户端分为&#xff1a;一个是编辑器&#xff0c;一个是客户端&#xff0c;采用OGREcegui自写的简单的物理碰撞检测FMOD自写的网络库。 服务器端代码目…...