avatar
文章
87
标签
24
分类
15

主页
归档
标签
分类
列表
  • 音乐
  • 电影
链接
关于
Vinda's Blog
搜索
主页
归档
标签
分类
列表
  • 音乐
  • 电影
链接
关于
Qt实战-获取文本宽高画框
发表于2022-04-21|更新于2022-08-28|QtExamples|Qt•QtExamples
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354void Label::paintEvent(QPaintEvent *e){ QPainter painter(this); painter.save(); QFont font = painter.font(); font.setPixelSize(24); painter.setFont(font); painter.drawText(QPoint(0, 20), tr("HelloHello")); const QRect rectangle = QRect(0, 30, 100, 50); QRect boundingRect; painter.drawText(rectangle, 0, tr("HelloHello"), &boundingRect); QPen ...
Qt实战-数字提示
发表于2022-04-21|更新于2022-08-28|QtExamples|Qt•QtExamples
数字提示(圆角矩形) 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051void Label::paintEvent(QPaintEvent *e){ QPainter painter(this); const qreal radius = 10; QRectF rect = QRect(10, 200, 20, 20); QPainterPath path; path.moveTo(rect.bottomRight() - QPointF(0, radius)); path.lineTo(rect.topRight() + QPointF(0, radius)); path.arcTo(QRectF(QPointF(rect.topRight() - QPointF(radius * 2, 0)), QSize(radius * 2, radius *2)), 0, 90); path.lin ...
QMenu
发表于2022-04-19|更新于2022-08-28|Qt|Qt
函数介绍 1.void setContextMenuPolicy(Qt::ContextMenuPolicy policy) This enum type defines the various policies a widget can have with respect to showing a context menu. Constant Value Description Qt::NoContextMenu 0 the widget does not feature a context menu, context menu handling is deferred to the widget’s parent. Qt::PreventContextMenu 4 the widget does not feature a context menu, and in contrast to NoContextMenu, the handling is not deferred to the widget’s parent. This means that all r ...
修改 Qt Creator 界面样式
发表于2022-04-18|更新于2023-02-04|QtCreator|QtCreator
先上效果图 修改 Qt Creator 界面字体 注意:是修改 Qt Creator 界面字体样式,并不是编辑器里代码的字体样式。 0.安装 JetBrains Mono 字体(下载解压后打开 font/ttf 文件夹,全选右键安装) 1.新建一个 .css 文件并填写如下内容,然后保存(例如放在:C:\Qt\qtcreator-custom-style\qtcreator-custom-style.css) 123QWidget { font: 10pt "JetBrains Mono";} 2.找到 Qt Creator 的快捷方式,鼠标右键,选择’快捷方式’页,在’目标’编辑框加上 ’ --stylesheet=刚才新建的 css 文件路径’。 例如:C:\Qt\qtcreator-5.0.2\bin\qtcreator.exe --stylesheet=C:\Qt\qtcreator-custom-style\qtcreator-custom-style.css 修改 Qt Creator 成 OneDark 样式 把 o ...
QFileInfo
发表于2022-04-15|更新于2022-08-28|Qt|Qt
QFileInfo 成员函数介绍 1.QString QFileInfo::fileName() const Returns the name of the file, excluding the path. 12QFileInfo fi("/tmp/archive.tar.gz");QString name = fi.fileName(); // name = "archive.tar.gz" Note that, if this QFileInfo object is given a path ending in a slash, the name of the file is considered empty. 2.QString QFileInfo::completeBaseName() const Returns the complete base name of the file without the path. The complete base name consists of all characters in ...
写博客要注意的一些问题
发表于2022-04-15|更新于2022-08-29|Blog
标题 hexo 新建文章后自动生成的 123---title: xxxxx--- 其实就是一级标题 source/_posts 文件夹 hexo 新建的文章自动生成在 source/_posts 文件夹下 可以通过手工把同一类文章放到同一个文件夹下(比如:Qt 相关的文章都移动到 Qt 文件夹内),而且通过 hexo 生成、部署后的网页并没有影响 资源文件 在文章中引用的图片资源 可以统一放到资源文件夹 source/images,避免资源重复浪费空间、流量 在文章中通过 ![xxx](/assets/images/xxx.png) 引用即可 关于文章的一些约定 1.文章分类 2.文章标签 3.文章命名 4.文章配图命名 5.文章名称和标题不用一样 文章加载问题 1.文章列表加载问题 网页加载慢,可以禁用文章列表图片 12-cover: /assets/images/logo/QtCreator.pngcover: false 2.文章内容加载问题 文章内容加载慢,可以减少文章配图,或者不用配图(有时候配图可以更加直观易懂)
QRegExp
发表于2022-04-15|更新于2022-08-28|Qt|Qt
QRegExp 成员函数介绍 1.QString QRegExp::cap(int nth = 0) const Returns the text captured by the nth subexpression. The entire match has index 0 and the parenthesized subexpressions have indexes starting from 1 (excluding non-capturing parentheses). 返回第 n 个子表达式捕获的文本。整个匹配的索引为 0,带括号的子表达式的索引从 1 开始(不包括非捕获括号)。 1234567QRegExp rxlen("(\\d+)(?:\\s*)(cm|inch)");int pos = rxlen.indexIn("Length: 189cm");if (pos > -1) { QString value = rxlen.cap(1); // "189" QString un ...
Python 给图片添加水印
发表于2022-04-08|更新于2022-08-28|Python|Python
示例 1234567891011121314151617181920212223242526272829303132333435363738394041# -*- coding:utf-8 -*-from PIL import Image, ImageDraw, ImageFontimport osdef add_text(img_path, text='svinda.github.io', show_result_image=False): img = Image.open(img_path) draw = ImageDraw.Draw(img) font = ImageFont.truetype('C:/windows/fonts/Arial.ttf', size=20) # color = (255, 222, 111) width, height = img.size draw.text((width - 150, height - 55), text, (14, 222, 111)) # 添加透 ...
Qt Creator 源码分析:入口函数分析
发表于2022-04-06|更新于2022-10-07|Qt Creator 源码分析|Qt•QtCreator•源码分析
0.程序 main() 函数执行流程图 1.Restarter restarter(argc, argv) 123456int main(int argc, char **argv){ Restarter restarter(argc, argv); ...... return restarter.restartOrExit(app.exec());} 程序重启器,用于某些配置修改后,需要重启程序才能够使配置生效。 12345678910111213141516171819202122232425262728293031323334class Restarter{public: Restarter(int argc, char *argv[]) { Q_UNUSED(argc) m_executable = QString::fromLocal8Bit(argv[0]); m_workingPath = QDir::currentPath(); } v ...
Qt Creator 源码分析:程序入口
发表于2022-04-06|更新于2022-10-07|Qt Creator 源码分析|Qt•QtCreator•源码分析
分析程序入口 在键盘上按下 F10 键,Qt Creator 便会启动调试并且自动定位到 main() 函数处,在不知道程序入口的情况下,这种方法是最好用的。 如果是知道程序入口,那么可以在入口处打上断点,然后启动调试,也会定位到断点处。
1…6789
avatar
Vinda
开到荼蘼
文章
87
标签
24
分类
15
My GitHub
公告
欢迎大家收藏我的博客!
联系方式
QQ: 210968619
Email: hwnd1024@163.com
最新文章
QtGlobal 常用函数2022-10-08
qUtf8Printable2022-10-08
NotePadNext:简介和源码编译2022-10-07
NotePadNext:序2022-10-07
Qt问题-QtCreator调试程序问题2022-10-07
分类
  • C++42
  • CI/CD5
  • Firefox1
  • GitHub1
  • NotePadNext2
  • Python1
  • Qt8
  • Qt Creator 源码分析5
标签
Blog C++ C++ 11 C++ 14 C++ 17 C++ 20 C++ Design Pattern C++ Feature CI/CD Firefox GitHub GitLab Jenkins NotePadNext Python Qt QtCreator QtExamples QtProblems Tiled tdesktop vlc 杂记 源码分析
归档
  • 十月 20225
  • 九月 202214
  • 八月 202231
  • 七月 20224
  • 六月 20221
  • 五月 20222
  • 四月 202216
  • 三月 20228
网站资讯
文章数目 :
87
已运行时间 :
本站访客数 :
本站总访问量 :
最后更新时间 :
©2022 - 2023 By Vinda
框架 Hexo|主题 Butterfly
Hi, welcome to my GitHub!
本地搜索
数据库加载中