加快QWebview中执行Javascript的速度
The issue is that Qt is evaluating the return value of the last statement in Javascript and converting it to a QVariant. It became time consuming because jQuery was returning the jQuery object, which was being evaluated in its entirety by Qt - and recursively at that. This also consumed RAM too. It wasn’t console.log that was fixing the issue, it was the “null” value it returned. I tested, and stapling “null” at the end of the script also worked.
Below is the updated code.
1 | myWebElement->evaluateJavaScript( myScript + "; null" ); |
如果发现执行速度超级慢,按上面的方法处理。
QWizard不能显示完成与取消按钮的问题
我使用的是Qt5.4.2, 遇到这个问题。对话框显示出来后,用鼠标改变一下大小就能显示出来。看起来像Qt的bug。 经反复尝试,发现修改QWizard的属性styleSheet为ClassicStyle就可以解决这个问题。 具体原因不清楚。
Windows远程桌面连接Linux
Windows连接Linux 在Linux装下xrdp软件
1 | 1、安装xrdp sudo apt-get install xrdp |
Redmine 联接 https 地址的svn服务器
https://blog.csdn.net/taonull/article/details/39249729 1.打开redmine控制台; 2.运行svn list –xml https://svn地址; 3.提示证书时选择p(永久保存ssl凭证); 4.运行成功后,找到subversion_adapter.rb(redmine文件夹\apps\redmine\htdocs\lib\redmine\scm\adapters),找到 def credentials_string str << " --username #{shell_quote(@login)}" unless @login.blank? str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank? str << " --no-auth-cache --non-interactive"
修改为: str << " --username #{shell_quote(@login)}" unless @login.blank? str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank? str << " --trust-server-cert --no-auth-cache --non-interactive --config-dir \"c:/Users/Administrator/AppData/Roaming/Subversion\""
Thinkpad P50 更新后不能唤醒的问题
显卡驱动问题:在Bios里面把集显禁用,就不会有这个问题。 但是按下面的这个链接处理,也能解决问题。 https://jingyan.baidu.com/article/c275f6ba308652e33d7567f8.html
Android 编译问题:Could not find com.android.tools.lint:lint-gradle:26.1.2.
编译时报如下的错误:
1 | FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:lintVitalRelease'. > Could not resolve all files for configuration ':app:lintClassPath'. > Could not find com.android.tools.lint:lint-gradle:26.1.2. Searched in the following locations: file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom file:/C:/Users/wwq/AppData/Local/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.pom https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.2/lint-gradle-26.1.2.jar Required by: project :app |
解决方法: 检查根 build.gradle 文件。
1 | allprojects { repositories { jcenter() // mavenCentral() google() //**要加这行** // maven { url 'https://jitpack.io' } } } |
Java中的移位操作符
java中有三种移位运算符
- << : 左移运算符,num << 1,相当于num乘以2
> : 右移运算符,num >> 1,相当于num除以2
> : 无符号右移,忽略符号位,空位都以0补齐
下面是测试代码`public static void main(String[] args) {
int number = 10;
//原始数二进制
printInfo(number);
number = number << 1;
//左移一位
printInfo(number);
number = number >> 1;
//右移一位
printInfo(number);
}
/**
* 输出一个int的二进制数
* @param num
*/
private static void printInfo(int num){
System.out.println(Integer.toBinaryString(num));
}` 输出结果: 1010 10100 1010
UIAlertController 项添加图标
下面是示例代码
1 |
|
IOS设置固定大小的图片
下面是实现这部分功能的代码:
1 | UIImage * img = [UIImage imageNamed:@"doorlogo"]; |