📄 mainform.ui.h
字号:
/****************************************************************************** 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -