共 24 篇文章 |
|
28 29 #endifSimpleFactory.h 1 #include ''SimpleFactory.h'' 2 3 4 AbstractFactory::AbstractFactory(){ 5 } 6 7 8 AbstractFactory::~AbstractFactory(){ 9 }10 11 12 SimpleFactory::SimpleFactory(){13 }14 15 16 SimpleFactory::~SimpleFactory(){17 }18 19 20 AbstractProduct* SimpleFactory::createProduct(int ... 阅284 转0 评0 公众公开 17-02-08 13:59 |
如何将MFC生成的exe转换为DLL.编译后可以再debug文件夹下找到对应工程的dll和lib文件。我发现之所以我生成的dll和lib在测试程序中调用失败,是因为生成的dll中参考dll中有黄颜色的不完整项,因为我大量调用VTK和Opencv,而它们又调用很多其他的库,最终缺少msvcr80.dll和msvcp80.dll,解决办法自然是添加这两个dll了,好不容易找到了,我不知道... 阅944 转2 评0 公众公开 16-11-01 16:36 |
QT 串口以十六进制发送数据。void Widget::String2Hex(QString str, QByteArray &senddata){ int hexdata,lowhexdata;else hexdata = hexdata*16+lowhexdata;senddata[hexdatalen] = (char)hexdata;char Widget::ConvertHexChar(char ch){ if((ch >= ''0'') &&(ch = ''A'') &&(ch = ... 阅3020 转4 评0 公众公开 16-11-01 14:50 |
//paintlabel.h文件#ifndef PAINTLABEL_H#define PAINTLABEL_H#include class PaintLabel:public QLabel{ Q_OBJECTpublic: explicit PaintLabel(QWidget *parent = 0); void paintEvent(QPaintEvent *event);};#endif // PAINTLABEL_H.#include #include #include #include #include #include PaintLabel::PaintLabel(QWidget *parent):QLabel(... 阅3656 转8 评0 公众公开 16-10-31 09:42 |
阅1600 转0 评0 公众公开 16-10-25 14:51 |
QT皮肤框架-TQUI.近一年来在网上也一直在搜索QT皮肤框架,希望能有人做好可以用的,但搜索的结果有点让人失望,QTCN上有几个伙计公布过自己的界面皮肤设计的效果及源码,但经使用发现都不是很方便,用于QT样式的学习还是不错的,但真正用于工程还差得比较远,原因一是样式设计较为混乱,可复制性不强,二是样式和皮肤未形成模板,无法快速方便... 阅944 转0 评0 公众公开 16-10-24 14:36 |
阅231 转2 评0 公众公开 16-10-21 17:52 |
1.更改窗体标题this->setWindowTitle(''窗体标题'');“窗体标题”就是更改的窗体标题。这时候窗体图标就已经准备好了,下面开始编写代码,在mainwindows.cpp文件中 this->setWindowTitle(''calculator''); //设置窗体标题 this->setMaximumSize(300,400); //窗体最大尺寸 this->setMinimumSize(30... 阅915 转1 评0 公众公开 16-09-20 15:56 |
类似qq那种,当窗口移动到桌面上边缘时,鼠标离开窗口,窗口自动向上隐藏,当鼠标回到靠边的位置,窗口又显示出来。sdu_hanson06-11 09:53 等级 1楼。可以判断窗口的位置,当与边缘的距离小于某值时,再判断鼠标是否在窗口,判断是否隐藏窗口;根据隐藏窗口的隐藏位置,获得某块区域,当鼠标在这个位置时,显示窗口。在头文件中声明这两个鼠... 阅27 转0 评0 公众公开 16-09-20 14:59 |
Qt中mouseMoveEvent在MainWindow中使用最近用Qt软件界面,需要用到mouseMoveEvent,研究了下,发现些问题,分享一下。原因:CentrolWIdget是QMainWindow的子类,你如果在子类上响应鼠标事件,只会触发子类的mouseMoveEvent,根据C++继承和重载的原理,所以子类也要setMouseTracking(true); 所以如果你想响应鼠标事件的控件被某个父控件包含,则... 阅297 转0 评0 公众公开 16-09-20 14:30 |