- 博客(394)
- 资源 (66)
- 论坛 (1)
- 收藏
- 关注
原创 鸿蒙OS C++编程规范
https://gitee.com/openharmony/docs/blob/master/contribute/OpenHarmony-cpp-coding-style-guide.mdC++语言编程规范目的规则并不是完美的,通过禁止在特定情况下有用的特性,可能会对代码实现造成影响。但是我们制定规则的目的“为了大多数程序员可以得到更多的好处”, 如果在团队运作中认为某个规则无法遵循,希望可以共同改进该规则。 参考该规范之前,希望您具有相应的C++语言基础能力,而不是通过该文档来学习C+
2021-01-17 12:30:21
33
原创 QGridLayout交换两个QWidget
交换QGridLayout中的两个QWidget.github传送门:https://github.com/shaoguangwu/SwapGridLayoutWidget亲测有效。
2021-01-08 00:49:29
53
原创 QGridLayout重置行列比
Qt网格布局动态布局时,若行数或者列数减少时,需要重置比例,否则旧比例依旧存在: // 重置比例 for (int i = 0; i < gridLayout->rowCount(); ++i) { gridLayout->setRowStretch(i, 0); } for (int i = 0; i < gridLayout->columnCount(); ++i) { gridLayout->se.
2021-01-07 22:28:29
19
原创 Qt区分Debug和Release
Qt Release版本下,有宏定义 QT_NO_DEBUG#if defined(QT_NO_DEBUG)# define _RELEASE#else# define _DEBUG#endif
2021-01-05 13:15:07
32
原创 数据库数据模型
目 录1 基本概念2 数据模型的三要素3 E-R模型3.1 实体3.2 联系3.3 属性3.4 实体-联系方法3.5 扩展的E-R模型4 数据模型5 关系模型1 基本概念 模型就是对现实世界特征的模拟和抽象,数据模型是对现实世界数据特征的抽象。常用的数据模型分为概念数据模型和基本数据模型。 (1)概念数据模型。概念数据模型又称信息模型,是按用户的观点对数据和信息建模;是现实世界到信息世界的第一层抽象,强调其语义表...
2020-11-08 23:23:06
84
原创 Ubuntu18安装Realtek8125b网卡驱动
最近入手了一款带Realtek8125b网卡的主板,装Ubuntu18用于开发,由于缺少网卡驱动,导致连不了网,查阅相关资料,发现官网有驱动源码,此博客记录编译、安装驱动。此版本驱动源码转至下载频道:https://download.csdn.net/download/WU9797/12995768官网驱动源码下载地址:https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000
2020-10-21 13:25:18
885
7
原创 CURL查询公网IP
Ubuntu和Windows下都可使用CURL命令来获取公网IP:eric@ubuntu:~$ curl ip.sb111.112.x.x还有一些其它的网站可以查询:curl ip.sbcurl ipinfo.io (慢)curl ip.cncurl cip.cccurl myip.ipip.netcurl ifconfig.iocurl httpbin.org/ipcurl members.3322.org/dyndns/getipcurl icanhazip.comc
2020-09-11 11:23:02
111
原创 Qt获取本机网卡信息
//// netinfo.h//#include <QNetworkInterface>#include <QHostInfo>static QString interfaceTypeToString(QNetworkInterface::InterfaceType t){ switch (t) { case QNetworkInterface::Unknown: return "Unknown"; break;
2020-08-13 10:14:36
100
原创 VTK智能指针——vtkSmartPointer
VTK中的智能指针类为vtkSmartPointer,是一个模板类,继承自vtkSmartPointerSmart类。vtkSmartPointer类中定义一个vtkObjectBase类型的指针对象Object,用于存储智能指针中实际生成的对象。vtkSmartPointer<vtkLight> light1 = vtkSmartPointer<vtkLight>::New(); vtkSmartPointer中定义了静态函数New()来生成一个智能指针对象。该函数根据模板
2020-08-07 09:27:03
225
原创 Visual Studio(VS)启用更新的 __cplusplus 宏
/Zc:__cplusplus 编译器选项启用 __cplusplus 预处理器宏以针对最新的 C++ 语言标准支持报告更新的值。 默认情况下,Visual Studio 始终为 __cplusplus 预处理器宏返回值“199711L”。从 Visual Studio 2017 版本 15.7 开始便已提供 /Zc:__cplusplus 选项,该选项在默认情况下处于禁用状态。如果启用 /Zc:__cplusplus,则 __cplusplus == _MSVC_LANG。CMake中启用:if
2020-06-06 23:22:13
314
原创 CMake VS2019 编译VTK8.2.0启用C++17标准
CMakeList.txt中添加:(这里加在了project(VTK)之后)if (MSVC_VERSION GREATER_EQUAL "1900") include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("/std:c++17" _compiler_supports_cxx17) if (_compiler_supports_cxx17) add_compile_options("/std:c++17")
2020-05-19 21:48:17
389
原创 C++11特性:魔法静态变量 magic static
魔法静态变量是C++11的核心语言功能特性,提案:N2660 - Dynamic Initialization and Destruction with Concurrency, 最早在GCC2.3 / Clang2.9 / MSVC19.0等编译器得到支持。另外可以参考 cppreference:存储类说明符...
2020-05-02 15:48:57
617
原创 ubuntu磁盘挂载以及开机自动挂载
系统: Ubuntu 18.04磁盘: 240GB nvme ssd1. 磁盘挂载使用命令查看分区:sudo fdisk -lroot@ubuntu:~/workspace# fdisk -lDisk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectorsUnits: sectors of 1 * 512 = 512 bytes...
2020-04-28 14:22:25
164
原创 VTK 隐藏Actor
https://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/HideActorDisplay two spheres, then hide one, then hide both.#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vt...
2020-04-28 09:33:54
470
原创 QLineEdit后面放置一个按钮
QToolButton* btn = new QToolButton; btn->setText("..."); btn->setCursor(Qt::ArrowCursor); QWidgetAction* action = new QWidgetAction(ui.lineEdit); action->setDefaultWidget...
2020-04-27 23:21:14
168
原创 Qt5 TabWidget Tab栏 添加按钮
QPushButton* tabButton = new QPushButton(tr("+"), this); ui.tabWidget->setCornerWidget(tabButton);效果如下:
2020-04-27 21:53:40
269
原创 Ubuntu20.04 LTS 更换国内阿里源
启动终端,备份源文件:sudo cp /etc/apt/source.list /etc/apt/source.list.backup将源文件更换为阿里源:# deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted# See http://help....
2020-04-27 20:42:40
7850
原创 ubuntu20.04设置中文输入法
ubuntu 20.04 在2020年04月24日正式发布,博主在Win10系统下使用VMware 15安装体验了一下,目前暂不支持搜狗输入法,所以还是老老实实使用ibus实现中文输入法吧。关键点:1. 在 设置-区域与语言 里添加中文输入源2. 在语言支持里选择键盘输入法系统为 IBus。3. 重启系统,按shift键看看能否切换呢?OK...
2020-04-25 01:46:08
25783
原创 Qt5获取当前用户名
#include <QDir>#include <QStandardPaths>#include <QProcess>QString getCurrentUserName(){ QString userName; if (userName.isEmpty()) { QStringList envList = QPro...
2020-04-22 23:40:45
381
原创 Qt QTextEdit设置滑动条处于顶部或者底部
通过设置光标位置来改变滑动条位置void setTextCursorToTop(){ QTextCursor textCursor = ui->textEdit->textCursor(); textCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); ui->text...
2020-04-21 01:30:17
599
转载 arm-linux-gnueabihf、aarch64-linux-gnu等ARM交叉编译GCC的区别
https://blog.csdn.net/Namcodream521/article/details/88379307
2020-04-20 14:18:47
540
原创 WinSCP文件上传权限不足,错误3
切换到root用户root@:~# vi /etc/ssh/sshd_config按下方设置:# Authentication:LoginGraceTime 120#PermitRootLogin without-passwordPermitRootLogin yesStrictModes yes
2020-04-20 10:33:21
290
转载 Ubuntu18.04安装交叉编译工具链gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf
https://blog.csdn.net/liuenming123/article/details/88651608
2020-04-20 09:57:45
416
原创 DICOM Patient Position (0018,5100) - C++ enum
/** Patient Position (0018,5100) specifies the position of the patient relative to the imaging equipment space. This Attribute is intended for annotation purposes only. It does not provide an ex...
2020-04-03 00:07:42
208
原创 DICOM Modality (0008,0060) - C++ enum
/** Type of equipment that originally acquired the data used to create the images in this Series. Tag: (0008,0060). VR: Code String (CS) \note -# The XA modality incorporates the retire...
2020-04-02 23:44:13
257
原创 C++设计一个精度达纳秒的计时器
可计时 纳秒-小时/**************************************************************************************** Copyright (C) 2020, Shaoguang. All rights reserved.**** Date : 2020/04/01***************...
2020-04-01 17:04:09
211
原创 ITK深拷贝itk::Image
ITK版本:5.0.1template<typename TPixel, uint Dim>void deepCopyItkImageData(const itk::Image<TPixel, Dim>* src, itk::Image<TPixel, Dim>* dst){ if (!src || !dst) { retur...
2020-04-01 09:32:08
201
原创 Qt VTK显示单张DICOM图像并调节窗宽窗位
开发环境:Qt 5.12.7( & Visual Studio 2017) VTK 8.2.0源代码:#include <QtWidgets/QApplication>#include <vtkAutoInit.h>VTK_MODULE_INIT(vtkRenderingOpenGL2)VTK_MODULE_INIT(vtkInteractio...
2020-03-23 23:51:52
616
原创 Qt判断鼠标移动的同时鼠标左键被按下
// QMouseEvent* e;if (e->type() == QEvent::MouseMove && (e->buttons() & Qt::LeftButton )) { // TODO}
2020-03-22 23:28:13
1569
原创 vtk同一窗口中多个Renderer(渲染多个场景)示例
vtk版本: 8.2.0平台:Windows 10#include <vtkNew.h>#include <vtkConeSource.h>#include <vtkRenderWindow.h>#include <vtkCubeSource.h>#include <vtkCylinderSource.h>#inc...
2020-02-15 04:04:03
1096
原创 Qt设置鼠标样式
this->setMouseTracking(true); //设置为不按下鼠标键触发moveEventvoid mouseMoveEvent(QMouseEvent* event){ QPoint mousepos = event()->pos(); //在坐标(0 ~ width,0 ~ height)范围内改变鼠标形状 if(mousep...
2020-02-14 19:24:44
156
原创 QVTKOpenGLNativeWidget链接鼠标点击事件槽函数,获取鼠标点击处坐标
Qt UI可视化界面中放置一个QWidget,并将之提升为QVTKOpenGLNativeWidget,这里我将之命名为vtkWidget;构造函数中连接信号与槽: connect(ui.vtkWidget, SIGNAL(mouseEvent(QMouseEvent*)), this, SLOT(onVtkWidgetMouseEvent(QMouseEve...
2020-02-05 16:09:51
834
1
原创 Qt检测系统语言并安装翻译文件
#include "MainWindow.h"#include <QApplication>#include <QLocale>#include <QTranslator>int main(int argc, char *argv[]){ QApplication a(argc, argv); QTranslator trans...
2020-01-15 00:00:28
158
原创 Microsoft Edge官方下载地址
微软Edge换上Chromium 内核后确实不一样,快而简洁。正式版下载地址:https://www.microsoft.com/en-us/edge 正式版安装完成后,自带的旧版Edge会被覆盖,所以想保留旧版Edge的请谨慎下载安装。开发版下载地址:https://www.microsoftedgeinsider.com/zh-cn/download...
2019-12-17 14:27:10
5068
原创 CMake GUI 添加库d后缀
点击CMake界面Add EntryName: CMAKE_DEBUG_POSTFIXType: STRINGValue: d
2019-12-17 10:04:26
219
原创 Visual Studio 2017, 2019 官网下载地址
VS2017:社区版地址:https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&rel=15专业版地址:https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-v...
2019-12-16 15:00:15
488
原创 C++自定义编译期警告和错误信息
1 MSVC编译器:注意:C++标准并不支持 #pragma message,但是msvc支持/** Transform expression \a _exp_ to string format. */#define __AUX_STR_EXP(_exp_) #_exp_/** Transform \a _exp_ to string format. ...
2019-12-01 02:41:06
537
VS 2015专业版离线安装包(百度网盘)
2018-07-18
VS 2015企业版离线安装包(百度网盘)
2018-07-18
arm-linux-gnueabi-4.5.1.tar.bz2交叉编译工具
2017-09-29
cpp-p0267r10(图形库扩展).pdf
2021-01-08
r8125-9.004.01.tar.bz2
2020-10-21
VTK-9.0.1.tar.gz
2020-07-25
VTK-9.0.0.tar.gz
2020-05-15
VAssistX for vs2008-2010
2019-01-19
VS2013-Update5离线安装包(百度网盘、含激活码、番茄助手)
2018-12-30
windows10下解决sublimeText中文输入法无法跟随光标的问题
2018-10-18
网络调试助手C++源码(VS 2008开发)
2018-07-25
串口调试助手 Qt5版源码
2018-07-23
串口调试助手C++源码(VS 2008)
2018-07-22
Sublime Text 3(3176便携激活版,32位)
2018-07-17
基于Qt5.9的校园信息平台设计(工程实训项目)
2018-01-19
Meditating的留言板
发表于 2020-01-02 最后回复 2020-01-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人 TA的粉丝