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

📄 main.cpp

📁 这是一款象棋游戏
💻 CPP
字号:
/************************************************************************ * *    linux版仿联众俄罗斯方块 * *    该软件在GPL(GNU通用公共许可证)下发布 * *    Copyright (C)   <codeky@126.com> * *   This source code is licensed under the GNU General Public License */ //************************************************************************#include <qapplication.h>#include <stdlib.h>#ifndef WIN32#include <unistd.h>#else#include <limits.h>#endif#include "qmainwidget.h"char curPath[_MAX_PATH];int main( int argc, char **argv ){	QApplication app( argc, argv );	int rt = 0;//lee mask readlink("/proc/self/exe", curPath, PATH_MAX);	if(rt< 0||rt >=_MAX_PATH){		rt =0;	}		curPath[rt] = '\0';	int pos = strlen(curPath)-1;	while(pos>=0){		if(curPath[pos]=='/'){			break;		}		pos--;	}	curPath[pos+1]='\0';//lee add	memset(curPath,0,sizeof(_MAX_PATH));	QString pathstr = app.applicationDirPath() + "/";	strcpy(curPath,(const char *)pathstr.local8Bit());//lee add end	QMainWidget w;	app.setMainWidget( &w );	w.setCaption("linux-tetris -- Codekey@126.com");	w.show();		app.connect(&app,SIGNAL(lastWindowClosed()),&app,SLOT(quit()));	return app.exec();}

⌨️ 快捷键说明

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