mainform.ui.h
来自「在Linux底下用QtDesigner开发的一个进程同步例子。基本思想是设计一个」· C头文件 代码 · 共 72 行
H
72 行
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you wish to add, delete or rename functions or slots use** Qt Designer which will update this file, preserving your code. Create an** init() function in place of a constructor, and a destroy() function in** place of a destructor.*****************************************************************************/#include"queue.h"#include <qmessagebox.h>#include<qstring.h>HQueue hq;static int in=0;static int out=0;void mainForm::addSlot(){ //HQueue hq; /* Circle item;*/ if(!hq.IsFull()&&0==out) { Circle item; item.InitX=lineEdit1->text().toInt(); item.InitY=lineEdit2->text().toInt(); item.InitR=lineEdit3->text().toInt(); hq.EnQueue(item); in++; } else if(in==3) { in=0; QMessageBox::warning(this,"warning","you cannot add item,buffer is full!"); } else QMessageBox::warning(this,"warning","Buffer is not empty,you cannot add item!");}void mainForm::GetSlot(){ if(!hq.IsEmpty()&&0==in) { Circle item; item=hq.DeQueue(); //item=hq.GetFront(); QString strX; QString strY; QString strR; strX=strX.setNum(item.InitX); strY=strY.setNum(item.InitY); strR=strR.setNum(item.InitR); lineEdit4->setText("x="+strX);//+item.InitX); lineEdit5->setText("y="+strY); lineEdit6->setText("r="+strR); out++; } else if(out==3) { out=0; QMessageBox::warning(this,"warning","you cannot get item! Buffer is empty"); } else QMessageBox::warning(this,"warning","Buffer is not full,you cannot get item!"); //lineEdit1->setText() }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?