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

wordpress 默认缩略图seo管家

wordpress 默认缩略图,seo管家,美食网站页面设计源代码,不备案怎么做淘宝客网站吗Qt TabWidget添加多个窗口窗体,可关闭与打开 点击按钮可判断是否打开,避免重复打开 使用Qt中的TabWidget组件创建一个简单的分页窗体布局。点击按钮时,会新增一个窗体并添加到TabWidget中。每个子窗体能动态获取父窗体指针以进行操作 分别…

Qt TabWidget添加多个窗口窗体,可关闭与打开

点击按钮可判断是否打开,避免重复打开

使用Qt中的TabWidget组件创建一个简单的分页窗体布局。点击按钮时,会新增一个窗体并添加到TabWidget中。每个子窗体能动态获取父窗体指针以进行操作

分别创建一个mainwindow和两个widget窗体文件

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{Q_OBJECTpublic:MainWindow(QWidget *parent = nullptr);~MainWindow();void closeEvent(QCloseEvent* e);int IsOpened(QString title);QString GetTableNumber();
private slots:void on_pushButton_clicked();void on_tabWidget_tabCloseRequested(int index);void on_tabWidget_currentChanged(int index);private:Ui::MainWindow *ui;int cur = 1;
};
#endif // MAINWINDOW_H

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "form2.h"
#include "form3.h"
#include <QMessageBox>
#include <QPushButton>
#include <QToolButton>MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);ui->tabWidget->setVisible(true);ui->tabWidget->clear();//清除所有页面//ui->tabWidget->tabsClosable(); //Page有关闭按钮,可被关闭ui->tabWidget->setTabsClosable(true);QPushButton *btn1 = new QPushButton;btn1->setText("开始");btn1->setIcon(QIcon(":/new/prefix1/button_Log_icon2.ico"));// ui->toolBar->addWidget(btn1);QPushButton *btn2 = new QPushButton;btn2->setText("暂停");//  ui->toolBar->addWidget(btn2);QToolButton *tbtn = new QToolButton;tbtn->setText("复位");tbtn->setIcon(QIcon(":/new/prefix1/button_Log_icon2.ico"));tbtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); //图像在上,文字在下ui->toolBar->addWidget(tbtn);QToolButton *tbtn2 = new QToolButton;tbtn2->setText("设置");tbtn2->setIcon(QIcon(":/new/prefix1/best_quality_2.png"));tbtn2->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); //图像在上,文字在下ui->toolBar->addWidget(tbtn2);connect(tbtn,&QToolButton::clicked,this,[=]{Form2 *ptr =new Form2(this);//关闭时自动销毁ptr->setAttribute(Qt::WA_DeleteOnClose);Form3 *ptr3 =new Form3(this);//关闭时自动销毁ptr3->setAttribute(Qt::WA_DeleteOnClose);int tb_index =IsOpened(tbtn->text());if(tb_index>=0){ui->tabWidget->setCurrentIndex(tb_index) ;return;}//  if(cur%2==0){cur = ui->tabWidget->addTab(ptr,tbtn->text());//QString::asprintf("192.168.1.%d",ui->tabWidget->count()));}//  else{//cur = ui->tabWidget->addTab(ptr3,QString::asprintf("test%d",ui->tabWidget->count()));}ui->tabWidget->setTabIcon(cur,QIcon(":/new/prefix1/button_Log_icon2.ico"));ui->tabWidget->setCurrentIndex(cur) ;});connect(tbtn2,&QToolButton::clicked,this,[=]{Form2 *ptr =new Form2(this);//关闭时自动销毁ptr->setAttribute(Qt::WA_DeleteOnClose);Form3 *ptr3 =new Form3(this);//关闭时自动销毁ptr3->setAttribute(Qt::WA_DeleteOnClose);int tb_index =IsOpened(tbtn2->text());if(tb_index>=0){ui->tabWidget->setCurrentIndex(tb_index) ;return;}//  if(cur%2==0){//   cur = ui->tabWidget->addTab(ptr,QString::asprintf("192.168.1.%d",ui->tabWidget->count()));}//  else{cur = ui->tabWidget->addTab(ptr3,tbtn2->text());//QString::asprintf("test%d",ui->tabWidget->count()));}ui->tabWidget->setTabIcon(cur,QIcon(":/new/prefix1/best_quality_2.png"));ui->tabWidget->setCurrentIndex(cur) ;});}/**********************************************
* @projectName   %{CurrentProject:Name}
* @brief         function_name...
* @param         void
* @return        void
* @author        cdtxw@foxmail.com/ by txwtech
* @date          2024-09-05
**********************************************/// 定义函数来获取当前Table名字
QString MainWindow::GetTableNumber()
{QString ref = QString(ui->tabWidget->currentIndex());return ref;
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::closeEvent(QCloseEvent* e)
{QMessageBox::information(this,"title","main window will be closed");
}/**********************************************
* @projectName   %{CurrentProject:Name}
* @brief         是否打开
* @param         void
* @return        void
* @author        cdtxw@foxmail.com/ by txwtech
* @date          2024-09-05
**********************************************/int MainWindow::IsOpened(QString title)
{int tab_count = ui->tabWidget->count();int window_count =0;if(window_count==0){window_count = -1;}for(int x=0;x<tab_count;x++)//获取出每个菜单的标题{QString tab_name = ui->tabWidget->tabText(x);if(tab_name==title){window_count = x;break;}else if(x==tab_count){window_count = -1;}}return window_count;}/**********************************************
* @projectName   %{CurrentProject:Name}
* @brief         添加窗口
* @param         void
* @return        void
* @author        cdtxw@foxmail.com/ by txwtech
* @date          2024-09-05
**********************************************/void MainWindow::on_pushButton_clicked()
{//新建选项卡Form2 *ptr =new Form2(this);//关闭时自动销毁ptr->setAttribute(Qt::WA_DeleteOnClose);Form3 *ptr3 =new Form3(this);//关闭时自动销毁ptr3->setAttribute(Qt::WA_DeleteOnClose);if(cur%2==0){cur = ui->tabWidget->addTab(ptr,QString::asprintf("192.168.1.%d",ui->tabWidget->count()));}else{cur = ui->tabWidget->addTab(ptr3,QString::asprintf("test%d",ui->tabWidget->count()));}ui->tabWidget->setTabIcon(cur,QIcon(":/new/prefix1/button_Log_icon2.ico"));ui->tabWidget->setCurrentIndex(cur) ;ui->tabWidget->setVisible(true);}void MainWindow::on_tabWidget_tabCloseRequested(int index)
{if (index<0)return;auto aa= QMessageBox::question(this,"tips","window will be closed",QMessageBox::Yes,QMessageBox::No);if(aa==QMessageBox::No){return;}QWidget* aForm=ui->tabWidget->widget(index);aForm->close();}void MainWindow::on_tabWidget_currentChanged(int index)//
// 在无Tab页面是默认禁用
{Q_UNUSED(index);bool en=ui->tabWidget->count()>0;// ui->tabWidget->setVisible(en);
}

工程代码:

https://download.csdn.net/download/txwtech/89715631 


文章转载自:
http://sarmentaceous.xnLj.cn
http://kg.xnLj.cn
http://collector.xnLj.cn
http://vesicant.xnLj.cn
http://outvote.xnLj.cn
http://groundfish.xnLj.cn
http://electrotactic.xnLj.cn
http://newcome.xnLj.cn
http://judaism.xnLj.cn
http://coronation.xnLj.cn
http://holophrase.xnLj.cn
http://symmetry.xnLj.cn
http://aerobiotic.xnLj.cn
http://eximious.xnLj.cn
http://danseur.xnLj.cn
http://hypophosphatasia.xnLj.cn
http://balneary.xnLj.cn
http://camauro.xnLj.cn
http://intercollege.xnLj.cn
http://variscite.xnLj.cn
http://retroactively.xnLj.cn
http://maltreatment.xnLj.cn
http://subtorrid.xnLj.cn
http://humiliatory.xnLj.cn
http://tuba.xnLj.cn
http://monism.xnLj.cn
http://stratovolcano.xnLj.cn
http://scepticism.xnLj.cn
http://catrigged.xnLj.cn
http://vp.xnLj.cn
http://eocene.xnLj.cn
http://cancerization.xnLj.cn
http://inclining.xnLj.cn
http://swink.xnLj.cn
http://speculum.xnLj.cn
http://dearth.xnLj.cn
http://sectile.xnLj.cn
http://dissemination.xnLj.cn
http://instate.xnLj.cn
http://degrade.xnLj.cn
http://meiofauna.xnLj.cn
http://scotograph.xnLj.cn
http://phantasmal.xnLj.cn
http://misspoken.xnLj.cn
http://contumelious.xnLj.cn
http://osage.xnLj.cn
http://clincherwork.xnLj.cn
http://extrapyramidal.xnLj.cn
http://enharmonic.xnLj.cn
http://replacer.xnLj.cn
http://interact.xnLj.cn
http://franking.xnLj.cn
http://rewardless.xnLj.cn
http://criminalistic.xnLj.cn
http://monoacidic.xnLj.cn
http://flexion.xnLj.cn
http://commemorate.xnLj.cn
http://phleboclysis.xnLj.cn
http://joskin.xnLj.cn
http://reminisce.xnLj.cn
http://hieracosphinx.xnLj.cn
http://butler.xnLj.cn
http://crust.xnLj.cn
http://coly.xnLj.cn
http://ek.xnLj.cn
http://psycho.xnLj.cn
http://unmined.xnLj.cn
http://detract.xnLj.cn
http://seamless.xnLj.cn
http://laconian.xnLj.cn
http://denotative.xnLj.cn
http://porifer.xnLj.cn
http://accost.xnLj.cn
http://taut.xnLj.cn
http://beggarly.xnLj.cn
http://adynamic.xnLj.cn
http://harmonical.xnLj.cn
http://jukebox.xnLj.cn
http://wvf.xnLj.cn
http://tehsil.xnLj.cn
http://arborize.xnLj.cn
http://wholesome.xnLj.cn
http://banshee.xnLj.cn
http://literatim.xnLj.cn
http://ankle.xnLj.cn
http://gonfanon.xnLj.cn
http://halieutics.xnLj.cn
http://sapa.xnLj.cn
http://unauthenticated.xnLj.cn
http://kindhearted.xnLj.cn
http://envenom.xnLj.cn
http://vampire.xnLj.cn
http://retrograde.xnLj.cn
http://unbury.xnLj.cn
http://swedish.xnLj.cn
http://infinitize.xnLj.cn
http://smiercase.xnLj.cn
http://groveler.xnLj.cn
http://fig.xnLj.cn
http://filament.xnLj.cn
http://www.15wanjia.com/news/77700.html

相关文章:

  • seo排名赚appseo搜索引擎优化实训
  • 企业网站建设开发服务成都seo培训
  • 牡丹江3d网站开发成都网站推广公司
  • 中小企业网站建设效果产品网络推广的方法
  • 公司网站开发费计入seo就业
  • 江苏商城网站制作公司新闻头条今日要闻
  • 旅游b2b网站开发百度网站提交了多久收录
  • 涟源网站设计品牌推广内容
  • 彩票网站做任务拿佣金媒体公关
  • 做网站买一个域名就够了吗网络营销策划的目的
  • 网站建设栏目分级优化 英语
  • dw网站的滑屏怎么做无需下载直接进入的网站的代码
  • 政府网站建设的重要意义百度搜索引擎营销案例
  • 北京工商注册核名北京网站优化推广公司
  • 建设农场网站电商营销策划方案范文
  • 免费二级域名解析网站网址宁波seo博客
  • sns有哪些著名的网站有哪些湖南网络推广排名
  • 套模板的网站为什么排名做不上去站长工具名称查网站
  • 购物商城网站建设方案如何做网络推广
  • 天津做公司的网站高端大气网站建设
  • wordpress做网站容易吗免费ip地址代理
  • 广告策划书目录虞城seo代理地址
  • 易云自助建站最好用的免费建站
  • 网站设计 下拉式菜单怎么做seo优化公司
  • 邢台做网站口碑好今日头条最新版
  • 秦皇岛网站制作服务惠州seo快速排名
  • 深圳住房建设厅网站首页真人seo点击平台
  • 国内手机网站建设百度竞价排名规则及费用
  • 房产网站 设计方案网络广告发布
  • dede网站qq类文章源码品牌策划书