Qt-Advanced-Docking-System示例程序

news2024/11/16 17:59:49

写了一些简单的示例程序,帮助我更好地使用和了解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_OBJECT

public:
    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_OBJECT

public:
    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_OBJECT

public:
    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);
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1860755.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MinIO下载和安装(Windows)

1、MinIO下载和安装 | 用于创建高性能对象存储的代码和下载内容 2、在本地硬盘中并新建一个minio文件夹 里面再创建bin文件夹和data文件夹 bin 用于存放下载的minio.exe data 用于存放数据 logs 用于存放日志 3、 编写启动脚本start.bat echo off echo [信息] 运行MinIO文服务…

探索新质生产力,Coremail邮件新品系列重磅发布!

数字化发展至今&#xff0c;新一轮科技革命与产业变革加速推进&#xff0c;利用新质生产力成为企业发展的关键&#xff0c;而邮箱作为日常工作的重要软件应用&#xff0c;如何紧追时代风口助力行业革新&#xff1f; 6月20日&#xff0c;探索新质生产力&#xff1a;Coremail智能…

自动化IC封装模拟分析工作流程

在IC封装制程的制程模拟中&#xff0c;为了同时提升工作效率与质量&#xff0c;CAE团队常会面临到许多挑战。在一般的CAE分析流程中&#xff0c;仿真分析产生结构性网格&#xff0c;是非常繁琐且相当花时间的。必须要先汇入2D (或3D) 图档&#xff0c;接着陆续建立表面网格、高…

华为升腾显卡选型备忘

目录 1. 开发套件 2. 加速模块 3. 加速卡 4. 训练卡 官方地址&#xff1a;https://www.hiascend.com/ 备注&#xff1a; &#xff08;1&#xff09;V后缀的都是Video视频解析卡&#xff0c;本质是推理卡&#xff1b; &#xff08;2&#xff09;I后缀的都是推理卡&#…

Ubuntu server 22.04 (Linux) 安装部署 redis 7.4 详细步骤 Tab 不能自动补全

1 安装依赖软件 sudo apt update sudo apt-get install tcl-dev 2 下载 wget https://download.redis.io/releases/redis-7.4-rc1.tar.gz 3 编译安装 #解压 tar zxvf redis-7.4-rc1.tar.gz # cd redis-7.4-rc1/ #编译 make make test #安装 sudo make install PREFIX/usr…

防爆气象站的工作原理

TH-FBCQX2防爆气象监测设备是为了在存在爆炸性气体或粉尘的潜在危险环境中进行气象监测而专门设计的设备。以下是对防爆气象监测设备的详细介绍&#xff1a; 防爆气象监测设备符合防爆安全标准&#xff0c;确保在易燃易爆环境中不会产生火花或热源&#xff0c;从而避免引发爆炸…

IDEA2024关闭自动AI代码补全功能

文章目录 一、背景二、教程四、写在后面 一、背景 在本人前段时间的一次面试算法题中&#xff0c;面试官让我关闭代码提示功能&#xff0c;当时气氛尴尬的可以抠出三室一厅&#xff0c;但是这个功能是2024新版参考文献自带的&#xff0c;本次来分享如何关闭新版代码补全功能。…

Model3C芯片方案--86彩屏中控面板Modbus协议说明

一、概述 Model3C芯片是一款基于RISC-V的高性能、国产自主、工业级高清显示与智能控制MCU&#xff0c;配备强大的2D图形加速处理器、PNG/JPEG解码引擎&#xff0c;并支持工业宽温。基于Model3C芯片的86彩屏中控面板&#xff0c;通过集成Modbus协议&#xff0c;实现了与多种控制…

一键登录功能实现(采用极光SDK)

前端流程 1. 引入极光认证 SDK&#xff1a; 通过 <script> 标签引入 &#xff0c;在 public/index.html 中确认 SDK 脚本已正确加载&#xff1a;参考官网Web SDK 概述 - 极光文档 <!-- 引入极光认证 SDK --> <script type"text/javascript" src&qu…

three.js - 置换贴图(displacementMap)、凹凸贴图(bumpMap)

这就是个灰度图 瞅瞅下面的贴图们&#xff0c;加深一下印象吧 说一下灰度图 在灰度图中&#xff0c; 黑色&#xff1a;代表最低的深度&#xff08;或最低的置换&#xff09; 白色&#xff1a;代表最高的深度&#xff08;或最高的置换&#xff09; 中间的灰度值&#xff0c;则…

java基于ssm+jsp 网络视频播放器

1前台首页功能模块 网络视频播放器&#xff0c;在系统首页可以查看首页、视频信息、系统公告、论坛信息、我的、跳转到后台、客服等内容&#xff0c;如图1所示。 图1前台首页功能界面图 用户登录&#xff0c;在登录页面可以填写账号、密码等信息进行登录&#xff0c;如图2所示…

Day4: 两两交换链表中的节点 24 删除链表的倒数第N个节点 19 链表相交 02.07 环形链表II 142

题目24. 两两交换链表中的节点 - 力扣&#xff08;LeetCode&#xff09; /*** Definition for singly-linked list.* struct ListNode {* int val;* ListNode *next;* ListNode() : val(0), next(nullptr) {}* ListNode(int x) : val(x), next(nullptr) {}* …

Kivy tutorial 003: Building a full GUI

Kivy tutorial 003: Building a full GUI – Kivy Blog Central themes: Adding Widgets to one another 中心主题&#xff1a; 添加组件到另一个组件中 The tutorals so far have covered the very basics of a Kivy application; getting everything running, adding a Wid…

【linux】TCP交流状态变迁及一些函数调用

代码 登录 - Gitee.comhttps://gitee.com/r77683962/linux-6.9.0/commit/50bb00d844b9423c9bacf44d9b06604fab941686 https://gitee.com/r77683962/linux-6.9.0/raw/50bb00d844b9423c9bacf44d9b06604fab941686/dmesg_log/kern_tcp_with_state.log 从打印的日志&#xff0c;…

石油化工厂为什么要用专业防爆手机?

防爆手机之所以必须使用专业设计的产品&#xff0c;主要是出于安全考虑&#xff0c;以防止在易燃易爆环境中因手机使用不当引发爆炸事故。以下几点详细解释了使用专业化工防爆手机的必要性&#xff1a; 本质安全设计&#xff1a;顶坚专业防爆手机采用了本质安全&#xff08;本安…

线程版服务器实现(pthread_server)

用到的所有方法所需要的参数可以在wrap.c文件中查询&#xff0c;wrap中找不到的直接通过man手册查询 1.首先介绍一下我自己写的包裹文件&#xff0c;里面有各种在可能要用到的方法 wrap.c: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #…

【IDEA】单项目多启动

IDEA 允许多次运行项目 一般来说一个项目仅允许启动一次&#xff0c;启动后它的启动按钮就会变成重启按钮&#xff0c;但是一些情况下我们可能需要启动多个客户端&#xff0c;可以用于模拟多个网络请求的发送等&#xff0c;多启动的开启方式如下&#xff1a; 2023.x 之后的版本…

常见网络攻击威胁分享

今天我来分享一下比较常见的网络攻击形式&#xff0c; ARP 欺骗攻击、CC 攻击和 DDoS 流量攻击是较为常见且危害巨大的攻击方式。 一、ARP欺骗攻击 ARP&#xff08;AddressResolutionProtocol&#xff0c;地址解析协议&#xff09;是用于将IP地址转换为MAC地址的协议。ARP欺骗…

web-原生Ajax

概念: Asynchronous JavaScript And XML&#xff0c;异步的JavaScript和XML。 作用: 数据交换:通过Ajax可以给服务器发送请求&#xff0c;并获取服务器响应的数据。 异步交互:可以在不重新加载整个页面的情况下&#xff0c;与服务器交换数据并更新部分网页的技术&#xff0c;如…