全部以图片格式存储:

全部以图片格式存储:

//snakegame.h
#ifndef SNAKEGAME_H
#define SNAKEGAME_H
#include<QList>
#include<QtWidgets/QLabel>
#include<QtWidgets/QDialog>
#include<QKeyEvent>
#include<QTimer>
/*枚举,表示方向*/
enum Direction{D_UP,D_DOWN,D_LEFT,D_RIGHT};
class SnakeGame:public QDialog
{
Q_OBJECT
public:
SnakeGame() ;
~SnakeGame();
public slots:
void snakemove();/*移动*/
public:
QLabel* getfood();/*产生新食物*/
void keyPressEvent(QKeyEvent *key);
private:
QList<QLabel*> snake;/*蛇*/
QLabel * food;/*食物*/
Direction dire;/*方向*/
int foodlen;/*食物长度*/
int maxlen;/*最大长度*/
QTimer * timer;/*定时器*/
};
#endif // SNAKEGAME_H//在3t2目录下
//adder.h
/*
qt简单加法计算器
*/
#ifndef ADDER_H
#define ADDER_H
#include<QDialog>
#include<QLineEdit>
#include<QtWidgets/QPushButton>
#include<QtWidgets/QLabel>
class Adder:public QDialog{
Q_OBJECT//让自定义的槽函数生效
private:
QLineEdit * add1;
QLabel * oper;
QLineEdit *add2;
QPushButton * equ;
QLineEdit * res;
QPushButton * bclose;
public:
Adder();
~Adder();
/*自定义槽函数*/
public slots:
void getres();
};
#endif//qt 5.2.1
//1t目录下
//1t.cpp
/*
第一个qt程序
*/
#include <QApplication>
#include<QtWidgets/QLabel>
#include<QString>
#include<QTextCodec>
int main(int argc,char** argv){
/*构造一个对象*/
QApplication app(argc,argv);
QTextCodec* coder=QTextCodec::codecForName("utf-8");
/*设置编码对象*/
// QTextCodec::setCodecForTr(coder);
//set code to the words
//QLabel qlab(QObject::tr("hello qt你好 ,today is a nice day!"));
QLabel qlab(coder->toUnicode("hello qt你好 ,today is a nice day!"));
qlab.show();
/*让程序进入事件循环*/
return app.exec();
}//在1t目录下,输入命令:
最近用MySQL,花时间写了一个过程用来生成EF的model类,有注释,挺方便,用EF类Entity自动生成的没有字段注释。
场景
现在公司的测试环境一些文本日志不让接触,提供一个网络http服务器让人直接访问,这文件大时,一般10MB一个文件,不在同一局域网,网速限制200K,要等很久,访问很慢。
.Net代码请求文本文件最新内容(类似于tail文件)
一、背景
最近用.Net WinForm做一个桌面应用程序,刚开始有一些问题,后面总结出做WinForm最常见的两个问题,就是多线程的使用和多线程中的控件操作。
其实挺简单,但是没做过的话也会耽误一点时间。
二、技术
//需求:由于项目刚上传,没有票数,为了表现出一定的人气,需要在一开始把各项目的票数赋一个值 ,
但每个项目不能一样,否则容易看出问题,呵呵 。
原文:http://www.codeproject.com/Articles/43637/Weird-Error-Unable-to-Validate-Data-in-ASP-NET-web
1、背景
xcopy命令的作用就是复制文件,而我们在使用visual studio开发软件有些时候是要在编译成功后,把编译好的文件复制到一个特定的目录,并且不需要自己开发额外的功能,那就可以使用xcopy。
2、使用示例
Powered By Z-BlogPHP 1.7.5
Copyright 2024-2029 pukuimin Rights Reserved.