0%

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" ); 

如果发现执行速度超级慢,按上面的方法处理。

我使用的是Qt5.4.2, 遇到这个问题。对话框显示出来后,用鼠标改变一下大小就能显示出来。看起来像Qt的bug。 经反复尝试,发现修改QWizard的属性styleSheet为ClassicStyle就可以解决这个问题。 具体原因不清楚。

Windows连接Linux 在Linux装下xrdp软件

1
2
3
4
5
6
1、安装xrdp sudo apt-get install xrdp 
2、配置xrdp /etc/xrdp/xrdp.ini 复制一个配置将其中的port 配置成5900及名称改下, service xrdp restart
3、安装vino sudo apt-get install vino
4、vino-preference 将第1 个开启
5、gsettings set org.gnome.Vino require-encryption false 6、/usr/lib/vino/vino-server/

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\""

编译时报如下的错误:

1
2
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中有三种移位运算符

  • << : 左移运算符,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

下面是示例代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

(void)savePreset
{

UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"Preset to Remoter buttons" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction * preset1 = [UIAlertAction actionWithTitle:@"Preset1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"send preset 1");
}];

UIAlertAction * preset2 = [UIAlertAction actionWithTitle:@"Preset2" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"send preset 2");
}];

UIAlertAction * preset3 = [UIAlertAction actionWithTitle:@"Preset3" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"send preset 3");
}];

UIAlertAction * preset4 = [UIAlertAction actionWithTitle:@"Preset4" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"send preset 4");
}];

UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {}];

[alertController addAction:defaultAction];

[preset1 setValue:[[UIImage imageNamed:@"fire"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[preset2 setValue:[[UIImage imageNamed:@"left"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[preset3 setValue:[[UIImage imageNamed:@"right"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[preset4 setValue:[[UIImage imageNamed:@"down"] imageWithRenderingMode:UIImageRenderingModeAutomatic] forKey:@"image"];
[alertController addAction:preset1];
[alertController addAction:preset2];
[alertController addAction:preset3];
[alertController addAction:preset4];
[self presentViewController:alertController animated:YES completion:nil];
}

下面是实现这部分功能的代码:

1
2
3
4
5
6
7
8
UIImage * img = [UIImage imageNamed:@"doorlogo"];

CGSize itemSize = CGSizeMake(60, 60);
UIGraphicsBeginImageContext(itemSize);
CGRect imageRect = CGRectMake(0, 0, itemSize.width, itemSize.height);
[img drawInRect:imageRect];
cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();