【QT】 Paintpad 制作札记
来源:互联网 发布:windows phone登录 编辑:程序博客网 时间:2024/06/15 22:10
用记事本打开,另存为,更改编码为UTF-8,保存原位置,覆盖确定。
2、No such file or directory
在Paint.pro里增加行:
QT += widgets
3、'setCodecForTr' is not a member of 'QTextCodec'
Reason:QT5中删除了此项函数。
相见CSDN-Blog:
QTextCodec中的setCodecForTr等终于消失了 (Qt5):
http://blog.csdn.net/dbzhang800/article/details/7325698
Qt5与中文:
http://blog.csdn.net/dbzhang800/article/details/7542672
4、QT5茫茫多的奇葩问题
切换到QT4,原来QT和QtCreator的版本是不同的……各种失败之后,QtCreator2.6.0为QT4.8.4,Installing...
5、卸载程序时删除尽了当前文件夹,全文件丢失,上网也找不到了……Failed
6、重下载5.1.1,回归原始问题
上网查询发现No such file or directory的另一解决方案及原理:Qt5的命名空间更改了,有许多原来在gui、core里的头文件被迁移到了widgets里,所以进行更改
#include <QtWidgets\QMainWindow>
#include <QtWidgets\QScrollArea>
#include <QtWidgets\QComboBox>
#include <QtWidgets\QLabel>
事实证明,和
QT += core gui改成
QT += core gui widgets的效果是一样的……
7、'QVariant(Qt::GlobalColor)' is private
又一个被移除了的可怜孩纸……
把Qt::white等颜色更改为QColor(Qt::white); 记得加上#include<QColor>//现在依然在QtGui内
8、undefined reference to _imp___ZN8QPrinterC1ENS_11PrinterModeE'
一怒之下直接删除QPrinter模块,终于可以构建运行了
后记:啊啊啊原来的代码在哪里T^T,我知道解决方法了:
使用到打印相关的类,Qt5单独放到了QtPrintSupport模块中,所以得加头文件#include <QtPrintSupport>,在.pro中要加QT += printsupport
Exec Success,now editing...
9、界面中插入Gif
#include "widget.h"#include "ui_widget.h"#include <QLabel>#include <QMovie>Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){ ui->setupUi(this); QMovie *movie = new QMovie("D:/Project/Qt/testclass/2.gif"); ui->label->setMovie(movie); movie->start();}Widget::~Widget(){ delete ui;}
#include <QtGui/QApplication>#include <QLabel>#include <QMovie>int main(int argc,char *argv[]){ QApplication app(argc,argv); QLabel *label = new QLabel(); QMovie *movie = new QMovie("D:/Project/Qt/firstQT/2.gif"); label->setMovie(movie); movie->start(); label->show(); return app.exec();}
- 【QT】 Paintpad 制作札记
- Qt札记
- Qt札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 札记
- 使用 Qt 制作 Skin
- Qt制作Aero特效
- Qt菜单栏的制作
- Qt 制作自定义界面
- QT 登录界面制作
- IOS关灯游戏 无限关卡
- Express API
- 服务器架构设计4------进程调度
- 静态内部类(嵌套类)
- go 初始配置
- 【QT】 Paintpad 制作札记
- java拆箱测验
- 英语笔记:写作:Recreational activities
- N-chat 教程及源码
- LeetCode Anagrams
- 随机快速排序
- [asp.net]易遗忘的东西
- PNaCl:Google通过LLVM增强对Chrome中原生应用的支持
- 使用SQLServer 2008的CDC功能实现数据变更捕获