- 博客(20)
- 资源 (8)
- 收藏
- 关注
原创 第一个裸机程序---点亮led小灯
Linux /home/program/test2 需要三个文件,led.lds , led.S和Makefile三个文件;---------------------------------led.S-----------------------------------------------@****************************@File:LED1@@功能
2015-10-29 11:09:01 796
转载 arm-linux-gcc的命令参数介绍
我们需要编译出运行在ARM平台上的代码,所使用的交叉编译器为 arm-linux-gcc。下面将arm-linux-gcc编译工具的一些常用命令参数介绍给大家。在此之前首先介绍下编译器的工作过程,在使用GCC编译程序时,编译过程分为四个阶段:1. 预处理(Pre-Processing)2. 编译(Compiling)3. 汇编(Assembling)4. 链接(Linkin
2015-10-29 09:47:29 526
转载 常见的几个Qt编程问题的处理
1、如果在窗体关闭前自行判断是否可关闭答:重新实现这个窗体的closeEvent()函数,加入判断操作引用void MainWindow::closeEvent(QCloseEvent *event){ if (maybeSave()) { writeSettings(); ev
2015-10-07 19:53:34 362
转载 Qt基于对话框---查找
12#ifndef FINDDIALOG_H#define FINDDIALOG_H#include class QCheckBox;class QLabel;class QLineEdit;class QPushButton;class FindDialog : public QDialog{ Q_OBJECTpublic: FindDialog
2015-10-07 16:25:24 1214
原创 Qt5.3.2 mingw32环境变量设置方法
Qt 5.3.2的mingw中自带creater,所以下载qt-opensource-windows-x86-mingw482_opengl-5.3.2.exe安装,就可以了!环境变量的设置方法:右击“计算机”-》“属性”-》“高级系统设置”,在弹出的窗口如下: 在该界面的“系统变量”栏里:选择“Path”选项,在弹出的窗口里,“变量值”一栏中加入以下内容“;C:\Qt
2015-10-06 15:56:07 5385 1
原创 hello.cpp:1:24: fatal error: QApplication: No such file or directory
之前编写的Qt程序是基于qt 4.7.3后来安装了Qt5.3.2测试一个小程序,发现有错误:hello.cpp:1:24: fatal error: QApplication: No such file or directory上网一查:应该在hello.pro的最后添加 QT += widgets 重新编译,问题解决!!!!!!
2015-10-06 15:51:17 2076
原创 Qt--使用widget部件
使用widget部件,创建一个主窗口,添加一个SpinBox部件和一个水平的Slider部件,并建立两者的连接,是两者能互相调节。age.cpp#include #include //水平布局#include //滑动条#include //微调框int main(int argc,char *argv[]){ QA
2015-10-06 14:54:48 337
原创 Qt -- button的使用
创建一个button部件,作为主窗口,点击该button退出窗体;quit.cpp//使用按键作为主窗口,带有退出功能#include #include int main(int argc,char *argv[]){ QApplication app(argc,argv); //创建QAppli
2015-10-06 14:46:55 622
原创 QT开发--hello
创建QT第一个小程序:使用标签创建一个窗口,并显示 "hello QT!"1.创建cpp文件:hello.cpp#include #include //标签int main(int argc,char *argv[]){ QApplication app(argc,argv); //创建QApplica
2015-10-06 14:33:36 335
原创 抽象类
//抽象类//---------main.cpp------------#include using namespace std;class Display{private:public: virtual void init()=0; //在声明之后写上“=0”,就是纯虚函数 virtual void write(char *pStr)=0; //};
2015-10-04 10:26:25 244
原创 使用多态的注意事项
多态是使用虚函数实现的,虚函数用于继承结构层次的父类与子类中,除了基类与子类的函数名必须相同外,连参数类型、个数和顺序都要相同,也就是说,父类和子类的虚函数不能只是名字重载,而是其声明要一模一样。否则,尽管标记virtual,也不能发生多态。一种例外的情形,返回类型例外。void fn(int);int fn(int);如果父类和子类的虚函数正如上述两个函数的差异,可以多态。
2015-10-03 15:41:56 980
原创 通过 虚函数 来实现多态
在C++中,使用虚函数机制,父类与子类的同名操作,主要标记上virtual,则该操作便具有多态性。//-----------student.h--------------#ifndef STUDENT__H#define STUDENT__H#include class Student{private: std::string name; int semesterHours
2015-10-03 15:01:05 467
原创 通过对象类型区分来实现多态
一个操作随着所传递或捆绑的对象类型的不同能够做出不同的反应,其行为模式称为多态。下面的例子中,通过对象类型不同来区分不同的类,实现多态。要求类层次中的父类有一个反映类型的数据成员,而且该成员要能够被使用者所访问(要求是public)。//-----------student.h--------------#ifndef STUDENT__H#define STUDENT__H#
2015-10-03 11:14:40 438
原创 虚拟继承
//---------main.cpp------------#include #include //多重继承using namespace std;class Furniture{protected: int weight;public: Furniture(){} //构造函数 void setWeight(int i){we
2015-10-02 19:26:40 355
原创 多重继承
多重继承:一个类可以从多个父类派生。//---------main.cpp------------#include #include //多重继承using namespace std;class Bed{protected: int weight;public: Bed(){weight=0;}//构造函数 void sleep(){std::cout<<"Sle
2015-10-02 18:55:09 287
原创 继承包含 与 组合包含的区别
//---------main.cpp------------#include #include //继承包含 与 组合包含using namespace std;class Vehicle{};class Motor{};class Car :public Vehicle //继承包含{public: Motor motor; //组合包含};
2015-10-02 17:58:52 821
原创 构造派生类
//---------main.cpp------------#include #include //继承:构造派生类using namespace std;class Student{private: string name; int semesterHours ; double average;public: Student(string pName = "no
2015-10-02 16:15:47 348
原创 error: L6047U: The size of this image (32868 bytes) exceeds the maximum allowed for this version of
keil编译stm32出现..\OBJ\Template.axf: error: L6047U: The size of this image (32868 bytes) exceeds the maximum allowed for this version of the linker激活后:
2015-10-02 11:52:25 33475 5
原创 类中公有继承的访问权限
class A //父类{private: int a; void f(){std::cout<<a;}protected: int b; void g(){std::cout<<a;}public: int c; void k(){std::cout<<a;}};class B : public A //子类B 公有继承 父类 A{public: v
2015-10-01 11:13:17 697
原创 类的继承
//---------main.cpp------------#include #include //继承using namespace std;class Student{private: string name; int semesterHours ; double average;public: Student(string pName = "noName")
2015-10-01 10:38:20 278
the java programming language fourth editionArnoldGoslingHolmes06
2014-08-30
ascii-码表
2014-08-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人