Snake::Snake(QWidget *parent)
    :   QWidget(parent),step(30)
{
    setFocusPolicy(Qt::StrongFocus);
    setFixedSize(1024,768);
    qsrand(QTime(0,0,0).msecsTo(QTime::currentTime()));
    map_row=Height/step;
    map_col=Width/step;
    CanGoThroughWall=false;
    iniWidget();
    iniConnect();
    iniGame();
}
Example #2
0
CMainWindow::CMainWindow(QWidget* parent)
 :	QMainWindow(parent)
{
	setupUi(this);
	
	iniDockWidget();
	iniStatusBar();
	iniConnect();
	updateRecentFiles();
	showMaximized();
	
	isUntitled = true;
	curFile = tr("untitled");
	setWindowTitle(curFile + "[*]");	
}