自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(88)
  • 收藏
  • 关注

转载 QPushButton样式

QPushButton:hover:!pressed { border: 1px solid #434E7A;}转载于:https://www.cnblogs.com/tianmochou/p/11532545.html

2019-09-17 11:21:00 282

转载 log4j.xml配置

log4j.xml ExampleBy mkyong | June 5, 2014 | Updated : July 5, 2014 | Viewed : 396,105 | +843 pv/wHere’s an XML version of log4j properties file, just for sharing.1. Output to Conso...

2019-09-09 16:23:00 226

转载 直接插入排序

int[] a = { 9, 3, 6, 2, 7, 4, 8, 5, 4,1,10,27,35,49,20,19 }; void DirIinsertSort(int[] b) { int temp1; for(int i =1; i < b.Length;i++) { ...

2019-09-03 17:41:00 184

转载 wpf 模板绑定父对象

有两种方式可以实现在模板中元素绑定到父对象1、<ContentPresenter Margin=”{TemplateBinding Padding}”/>2、Color=”{Binding RelativeSource={RelativeSource TemplatedParent},Path=Background.Color}”/>转载于:https://...

2019-08-26 14:30:00 522

转载 wpf menuitem 简约显示的 template样式

<ControlTemplate x:Key="MenuItemControlTemplate1" TargetType="{x:Type MenuItem}"> <Grid SnapsToDevicePixels="True"> <Border x:Name="OuterBorder" B...

2019-08-22 10:12:00 1230

转载 wpf之二进制资源

一、当需要添加图片、音频、视屏的资源到wpf项目里是,可以直接把文件添加到项目里右击add->existing item.1、如果想将外部文件编异常目标成为二进制资源,在文件的属性窗口 Build ACtion 设置为Resource。把 Copy to output directory属性设置为 Do not copy2,如果不想把资源嵌入到外部程序里Build...

2019-08-21 14:24:00 201

转载 wpf GeometryDrawing 绘制文字

<GeometryDrawing x:Key="GeometryDrawingText"> <GeometryDrawing.Geometry> <RectangleGeometry Rect="0,0,5,3"></RectangleGeometry> </G...

2019-07-25 11:32:00 1314

转载 wpf DrawingImage 奇葩问题

使用wpf drawingImage绘图是,会出现很奇怪的坐标问题,这个问题困扰很久当在DrawingGroup中绘图的时候,坐标始终会从(0,0)开始无论设置多少值,奇怪一比解决方法:首先在DrawingGroup里面添加一个透明的图形,然后再绘制实际图形 RectangleGeometry rectTest = new RectangleGeometry(); ...

2019-07-25 09:27:00 568

转载 qt tableview使用

Qt::CheckState checkSibling(QStandardItem * item); void treeItem_checkAllChild(QStandardItem * item,bool check = true); void treeItem_checkAllChild_recursion(QStandardItem * item,bo...

2019-06-21 10:49:00 275

转载 qt treaview项checkbox样式

QTreeView::indicator:enabled:checked { /** 指示器 - 选中 **/ image: url(yzfx/checkbox_checked.png);}QTreeView::indicator:enabled:unchecked { /** 指示器 - 选中 **/ image: url(yzfx/checkbox_unc...

2019-06-20 16:54:00 423

转载 wpf ActualWidth为0解决方法

LocalNewsControl(){ var descriptor = DependencyPropertyDescriptor.FromProperty(ActualWidthProperty, typeof(TextBlock)); if (descriptor != null) descriptor.AddValueChanged(myT...

2019-04-16 13:22:00 1883

转载 wpf GridSplitter左右托不了或者拖拽异常

对于水平分割线,需要将verticalAlignment属性设置为Center对于垂直分割线,需要将horizontalAlignment属性设置为center切记切记,不然很苦逼。。。。转载于:https://www.cnblogs.com/tianmochou/p/10697180.html...

2019-04-12 17:06:00 1186

转载 Communication between C++ and Javascript in Qt WebEngine(转载)

Communication between C++ and Javascript in Qt WebEngineadminJanuary 31, 20180As Qt WebKit is replaced by Qt WebEngine(you can refer to thispostabout porting issues), accessing html elem...

2019-01-28 16:27:00 313

转载 qt webengineview 设置背景颜色

当使用qwebengineview加载网页的使用,可以通过网页端的css设置网页的显示效果但是当窗口大小改变的时候,你会发现网页的resize速度赶不上窗口的resize速度,这是会出现白色空白,而这个白色空白控件就是webengineview ->page()即QWebEnginePage可以通过ui->QwebEngineView->page()-&gt...

2019-01-28 09:51:00 1207

转载 qt webengineview 加载本地资源方式

一、如果把资源添加到本地资源qrc库里了,请使用ui->preview->setUrl(QUrl("qrc:/HelloWorld2.html"));二、如果没有现在使用绝对路径ui->QwebEngineView->setUrl(QUrl("file:///E:/work/index.html"));使用这种形式转载于:https:/...

2019-01-24 17:40:00 1242

转载 GitLab: Deploy keys are not allowed to push code.

被这个问题坑了,大半天。写此博文,愿入坑的童鞋能及时托坑一、当你第一次pull或者push gitlab远程项目的时候提示你一个该建立一个sshkey,此时你在客户端生成sshkey二、切记要把这个Key考到你的个人信息里面,而不是具体项目的deploykey是这个里面而不是转载于:https://www....

2019-01-17 17:26:00 326

转载 Tomcat error: failed to start connector [connector[HTTP/1.1-8080]]

出现这个问题多半是因为8080端口被占用了。换一个端口试试转载于:https://www.cnblogs.com/tianmochou/p/10265618.html

2019-01-14 10:42:00 734

转载 QT多线程同步之QWaitcondition

使用到多线程,无可避免的会遇到同步问题,qt提供几种同步线程的方法,在这里讲一下QWaitcondition的简单使用。一、QWaitcondition,是通过一个线程达到某种条件来唤起另一个线程来实现同步的mutex.lock();waitcondition.wait(&mutex);需要用到一个互斥量作为参数,而这个互斥量的状态必须是locked的。当调用...

2018-11-20 16:51:00 835

转载 Qt表格导出图片

概述:qt中把某个控件导出保存为图片导出并不复杂,网上也有一堆方法。但是对于tableview中数据很多的情况下势必会出现滚动条,用传统的截屏抓图势会有滚动条,图片数据展示不全。在这我使用了一种折中方法即:永远不让tableview出现滚动条,而是把tableview放在一个scrollarea里面,当表各种数据过多时,tableview的高度会一直增加,而此时的scrollarea...

2018-11-13 15:49:00 567

转载 QItemDelegate edit某个控件后把数据写回model

QWidget *TrackDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &in...

2018-08-31 10:51:00 237

转载 qt json操作

json文件结构形式{ "xiao1": [ { "000100": { "industryCode": "000100", "industryName": "test" } }, { "000101": {...

2018-07-04 17:35:00 88

转载 qt在tableview中绘制图片

void ItemModelDeletage::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const{ QStyleOptionViewIt...

2018-07-03 15:53:00 750

转载 qt tableview里面添加控件

在QStyledItemDelegate的paint方法里面void MyItemModelDeletage::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const{ HtItemModelDeletage::paint...

2018-07-03 10:08:00 1012

转载 qt QAbstractItemModel一些方法介绍

一。virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);该方法是个虚方法,可用于继承实现当子类实现的时候,会在什么时候调用呢?1、比如当tableview可以编辑的时候,当编辑完之后setData虚方法会被调用,这个时候...

2018-06-19 15:08:00 725

转载 ecahrt表格内容自适应

window.onresize = myChart.resize;转载于:https://www.cnblogs.com/tianmochou/p/9063885.html

2018-05-20 17:07:00 314

转载 qt tableview列头背景颜色设置

设置表列头背景颜色QHeaderView::section { background: rgb(255, 255, 127);}转载于:https://www.cnblogs.com/tianmochou/p/9025336.html

2018-05-11 16:25:00 2711

转载 qt对plot柱状图颜色设置

当使用qwtplotbarchart来使用柱状图时。可以通过下面代码来设置柱状图的颜色 QwtPlotBarChart *barChart = new QwtPlotBarChart("Bar Chart" ); QwtColumnSymbol *symbol = new QwtColumnSymbol( QwtColumnSymbol::Box );...

2018-03-05 15:59:00 1758

转载 qtdebug和release加载不同的文件配置

win32:CONFIG(release, debug|release): {LIBS +=$$PWD/../../../thirdparty\qwt\lib\qwt.libLIBS +=$$PWD/../../../thirdparty\xlsx\lib\Qt5Xlsx.lib}else:win32:CONFIG(debug, debug|release): {LI...

2018-02-02 10:37:00 924

转载 c#EntityFrameworkcodeFirst模式

一、首先定义数据类[DataContract(Namespace="http://www.cninnovation.com/Services/2012")] public class RoomReservation : INotifyPropertyChanged { private int id; [DataMember] public int Id...

2018-01-23 15:14:00 206

转载 qt使用QWT注意事项

当继承某个QWT类时,有是使用O_OBJECT弘会出现问题切记在工程文件里别忘了添加这一句DEFINES+=QWT_DLL转载于:https://www.cnblogs.com/tianmochou/p/8251964.html

2018-01-09 16:13:00 160

转载 qt 获取两个日期之间的天数

datetime1->daysTo(datetime2)转载于:https://www.cnblogs.com/tianmochou/p/8058329.html

2017-12-18 16:34:00 1177

转载 使用QtXlsx来读写excel文件

概述:QtXlsx是功能非常强大和使用非常方便的操作excel类库。包括对excel数据读写、excel数据格式设置及在excel里面根据数据生成各种图表。下面重点介绍如何安装和使用QtXlsx。一、获取QtXlsx。1、通过下面地址获取:https://github.com/dbzhang800/QtXlsxWriter2、得到的是包括源码、各种实例的文件包。3、解...

2017-12-18 10:18:00 1284

转载 qt table中字体倾斜

在itemdelegate,的paint事件中添加 QStyleOptionViewItem newOption(option); QTransform transform(QTransform::fromTranslate(-option.rect.center().x(),...

2017-12-13 15:50:00 476

转载 利用bing图片搜索接口开发图片搜索应用程序

概述:通过bing的图片搜索引擎,开发自己的图片搜索应用程序。bing的图片搜索接口是收费的,但是初次注册使用,key可以免费试用30天程序运行效果如下一,代码如下static SearchResult BingImageSearch(string searchQuery) { // Construct the URI of the s...

2017-11-10 15:01:00 288

转载 .net几种timer区别

概述:.net框架不同名称控件都包含了各种timer,但每个timer有什么具体区别呢?一、System.Threading private static void ThreadingTimer() { Console.WriteLine("System.Threading.Timer call thread id {0}",Th...

2017-10-30 13:53:00 113

转载 qt treeview过滤

一,不多说直接上代码QSortFilterProxyModel可实现过滤排序。但是如果直接使用只能对于父项进行过滤这里需要继承头文件#include <QSortFilterProxyModel>class TreeProxyFilter:public QSortFilterProxyModel{public: TreeProxyFi...

2017-09-28 17:28:00 547

转载 qt嵌入式html和本地c++通信方式

前沿:我们在做qt项目的时候,通常会把某个html网页直接显示到应用程序中。比如绘图。直接把html形式的图标嵌入到应用程序中但是我们需要把数据从后台c++端传到html端,实现显示。qt实现了相关的方法程序运行截图一。先看客户端js代码 <script type="text/javascript" src="./qwebchannel.js"...

2017-09-13 17:31:00 199

转载 wpf prism加载独立模块实例

一、首先看看文件的组织架构module1 module2生成dll某块。Shell来显示管理模块二,看看关键bootstrapper类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namesp...

2017-09-05 15:05:00 97

转载 插入排序算法代码实现

//插入排序算法 private static void sort(int []a) { int j; int temp; for(int i = 1;i <a.Length;i++) { j = i - 1;...

2017-09-04 16:21:00 116

转载 qt连接oracle数据库

由与qt开源版本没有提供oracle数据库驱动,需要自己根据源代码来手动编译oracle驱动。经过近三天的折腾,终于成功编译oracle驱动,连接到数据库ps:期间经过各种失败疼苦迷茫。现在终于完成,心情也开阔些。程序员强迫症的疼苦。闲言少叙。接下来将一步一步,描述我的实现过程一、工具准备1、qt-opensource-windows-x86-msvc2015_64-5....

2017-04-14 15:04:00 629

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除