⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c.ui.h

📁 QT编写的简单计算器
💻 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.*****************************************************************************/QString s;int n=0;int tem[30];void Form1::toHex(){count(16);}void Form1::toBinary(){count(2);}void Form1::toOctal(){count(8);}void Form1::count(int a){    int b;    int i=0;    s=lENum->text();    if(s!="")    {	n=atoi(s);	s="";	b=n;	while(b>0)	{	  tem[i]=b%a;	  b=b/a;	  i++;	  	}	if(i>0)	{	  i--;	  for(;i>=0;i--)    {	switch( tem[i] )	{	    case 15 : 	    s=s+"F";	    break;	    case 14 : 	    s=s+"E"; 	    break;	    case 13 : 	    s=s+"D";	    break;	    case 12 : 	    s=s+"C";	    break;           case 11 : 	    s=s+"B"; 	    break;	    case 10 : 	    s=s+"A"; 	    break;	    case  9: 	    s=s+"9"; 	    break;	     case  8: 	    s=s+"8"; 	    break;	     case  7: 	    s=s+"7"; 	    break;	     case  6: 	    s=s+"6"; 	    break; 	case  5: 	    s=s+"5"; 	    break; 	case  4: 	    s=s+"4"; 	    break; 	case  3: 	    s=s+"3"; 	    break; 	case  2: 	    s=s+"2"; 	    break; 	case  1: 	    s=s+"1"; 	    break; 	case  0: 	    s=s+"0"; 	    break;          // default :		  // s=s+gcvt(tem[i]);       }    }	      }	else	{	  tem[i]=0;	  s="0";      }	lEResult->setText(tr(s));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -