
源码
文章平均质量分 69
C++老师机
13年c++开发
展开
-
解决浏览器或CEF 加载本地文件或ajax 跨域问题 Access to XMLHttpRequest from origin * has been block
作为开发,当我们有需求的时候,我们需要和后端合作开发,但是后端只定义好了接口,不能直接用本地的json文件,我们应该用ajax或者别的请求来获得数据,因为浏览器本身的同源策略的影响,会有跨域的问题,以下是本地开发解决跨域问题的方法1、浏览器处理跨域问题首先我们找到电脑上的谷歌浏览器快捷方式点击右键->属性->目标 在已有的字段 后面加入以下的文字–user-data-dir=“D:\ChromeDebug” --test-type --disable-web-security–前面一定原创 2020-07-01 13:22:18 · 3584 阅读 · 0 评论 -
c++ 正则表达式-基础操作
regex_match(s, re) 目标字符串s和正则表达式re是否完全匹配regex_search(s, match_result, re) 目标字符串s是否存在某个子串与正则表达式re匹配regex_replace(s, re, s1) 用s1替换目标字符串s中与正则表达式re匹配的子串#include <iostream>#include <s...原创 2020-04-02 18:41:24 · 232 阅读 · 0 评论 -
c++ 正则表达式-基础操作
#include <iostream>#include <string>#include <regex>using namespace std;void regex_match_test(){ /* std::regex_match: 判断一个正则表达式(参数re)是否匹配整个字符序列str,它主要用于验证文本 ...原创 2020-04-02 18:38:48 · 259 阅读 · 0 评论 -
通过指针访问虚函数表,并且调用里面的方法
/** @file test.c* @note* @brief 字符串解析* @author* @date* @note 没有任何具体价值,单纯的字符串解析、转换的编程练习* @note 历史记录:* @warning*/#include <stdio.h>#include <stdlib.h>#include <string.h>#in...原创 2020-04-02 15:54:04 · 625 阅读 · 3 评论 -
Qt KDGantt实现滚动表头缩放功能,平滑切换表头年月/月年日
1.实现表头滚动鼠标缩放甘特图重写HeaderWidget的wheelEvent事件处理void HeaderWidget ::wheelEvent( QWheelEvent* e ){DateTimeGrid* const grid = qobject_cast< DateTimeGrid* >(view()->grid());if (grid) {qreal de...原创 2019-03-26 17:09:03 · 1356 阅读 · 0 评论