小编Tom*_*ica的帖子

使用QTranslator加载qm文件

我正在尝试使用翻译文件.我完成了所有程序:创建了ts文件,翻译了它,但是当我运行应用程序时,语言仍然和以前一样.

我在诺基亚的例子中工作,就像在说明中一样.

可能是我的问题?

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QTranslator* translator=new QTranslator(0);

    if(QFile::exists("hellotr_la.qm"))
        qWarning("failed-no file");

    if(! translator->load("hellotr_la.qm"))
        qWarning("failed loading"); //the warning appears ****

    app.installTranslator(translator);
}
Run Code Online (Sandbox Code Playgroud)

qt translation file

7
推荐指数
1
解决办法
2万
查看次数

CSS3不透明度的最大精度是多少?

所以我一直在为交互式淡化产生不透明度.

但是,我认为使用非基本值来表示不透明度并不是一个好主意.如果最大精度低于精度的最大javascript,则浏览器似乎对值进行舍入,但认为它已更改.

所以问题是,对CSS3有意义的最大精度是opacity多少?

javascript css3

7
推荐指数
1
解决办法
1508
查看次数

检测数字输入微调器点击

我有一个带有min="1"max="12"值集的简单数字输入,这用作小时选择器.我希望它可以在几小时内循环,所以当你到达12并按下"向上"箭头时,它会返回到1反之亦然.

现在我有这个主要工作:

var inputTimer = null;

function cycle(element) {
  if (element.attributes.max && element.attributes.min) {
    var prevVal = element.value;
    inputTimer = setTimeout(function() {
      if (prevVal === element.attributes.max.value) {
        element.value = element.attributes.min.value;
      } else if (prevVal === element.attributes.min.value) {
        element.value = element.attributes.max.value;
      }
    }, 50);
  }
}

$("input[type='number']")
  .on("mousedown", function(e) {
    //this event happens before the `input` event!
    cycle(this);
  }).on('keydown', function(e) {
    //up & down arrow keys
    //this event happens before the `input` event! …
Run Code Online (Sandbox Code Playgroud)

html javascript html5

7
推荐指数
1
解决办法
5441
查看次数

使用"KexAlgorithms diffie-hellman-group1-sha1"没有解决"找不到匹配的密钥交换方法"错误

关于以下错误有很多问题,但它们都有相同的解决方案,没有任何影响:

$ git push
Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

openssh.com上一篇文章没有帮助.特别建议:

...在〜/ .ssh/config文件中:

Host somehost.example.org
KexAlgorithms +diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)

我做到了那一点.我假设~解决了%userprofile%在Windows上.我的文件是C:\Users\MY_USERNAME\.ssh\config:

## use kex algorithm ##
Host 192.168.XXX.XXX
KexAlgorithms diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)

结果是没有任何改变.还有建议使用,ssh -o但我还没有找到一个难以描述你究竟是怎么做的答案.我试过这个:

$ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
Run Code Online (Sandbox Code Playgroud)

我需要连接到那个GIT存储库.我在窗户上.存储库使用Gerrit.我也使用SourceTree,它没有问题进入存储库 …

windows git ssh

7
推荐指数
1
解决办法
8100
查看次数

抛出了"Microsoft.DiagnosticsHub.Diagnostics.CollectionStartFailedHubException"类型的异常.

我想概述项目,但是这突然出现了:

MyProject无法启动. 抛出了

该计划确实启动了.每次我尝试运行CPU分析时都会发生这种情况.在分析之前我应该​​先设置一些东西吗?

visual-studio-2017

7
推荐指数
0
解决办法
931
查看次数

在Qt编辑器中手动编辑.ui文件

我最近手动调整了我的.ui文件,我很好奇,有没有人知道如何在Qt Creator中关闭.ui文件的只读模式?

如果没有立即清楚,我的意思是.ui文件(默认情况下)可以在Qt Creator中查看但不能写入......并且启动其他一些xml编辑器是一个小麻烦:/

谢谢!

qt qt-creator

6
推荐指数
1
解决办法
7561
查看次数

只有当物体进入范围时才会触发接近探测器,而不是当它在范围内移动

我正在为Minecraft制作一个基于文本的雷达.如果玩家距离你不到20个街区,它会在聊天中说出来.截至目前,它正在骚扰聊天.如何才能让它只写入关于该玩家ONCE的聊天?即使你不玩游戏,也应该很容易理解.

if (Camb.radar)
{
  for (Entity e: (List < Entity > ) mc.theWorld.loadedEntityList)
  {
    if (e instanceof EntityPlayer)
    {
      EntityPlayer player = (EntityPlayer) e;
      if (player == mc.thePlayer || mc.thePlayer.getDistanceToEntity(e) > 20.0)
        continue;
      mc.thePlayer.addChatMessage("\2479[CAMB] \247e" + player.getEntityName() + " has entered your 20 block radius!"); //Write to chat, only want this line done once for every player
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

java minecraft

6
推荐指数
1
解决办法
603
查看次数

如何在Webkit浏览器中访问粘贴的文件?(作为Google Chrome浏览器)

如果能够在Stack Exchange上将图像粘贴到此处而不是干预文件对话框,那将非常方便。此处已实现了类似功能,但仅适用于Webkit浏览器

我正在开发可以做到这一点的用户脚本。有趣的是,在Webkit浏览器中,我从未从剪贴板中获取文件(与原始图像数据不同),而在Firefox中却可以。

Firefox解决方案:

  div.addEventListener('paste', function(event){
    //I'm actually not sure what should event.originalEvent be. I copypasted this
    var items = (event.clipboardData || event.originalEvent.clipboardData);
    console.log("paste", items);
    //Try to get a file and handle it as Blob/File
    var files = items.items || items.files;
    if(files.length>0) {  
      //Being lazy I just pick first file
      var file = files[0];
      //handle the File object
      _this.processFile(file);

      event.preventDefault();
      event.cancelBubble = true;
      return false;
    }
  });
Run Code Online (Sandbox Code Playgroud)

在Chrome没有像Firefox一样好的文档(我的意思是MDN)之前,我试图检查正在发生的事情。我复制了一个文件,并将其粘贴到Google chrome(v39)中。这是我DataTransfer在控制台中获得的对象:

粘贴事件Google chrome

供参考,这是Firefox中的同一事件:

粘贴事件文件Firefox

另外两个阵列,items …

javascript google-chrome paste fileapi

6
推荐指数
1
解决办法
1686
查看次数

在Typescript中编写并运行node.js应用程序

我现在搜索了一天,希望你能帮助我.

我真的很喜欢在TypeScript中开发JS应用程序,我正在尝试用这种方式编写新的节点应用程序.不幸的是节点不理解TS.有没有办法(除了转换到ES5)直接从TS文件启动我的代码?

在悲惨的情况下,没有办法做到这一点,最佳做法是什么?编写应用程序src/ts/app.ts,将其转换为src/js/app.js并引用此文件package.json

node.js typescript

6
推荐指数
1
解决办法
518
查看次数

Sourcetree没有推出Beyond比较外部合并工具

突然,当我尝试从Sourcetree启动"外部合并工具"时,该工具不会出现.我突然说,因为我上次尝试时效果很好.对话框永远存在:

图片描述

最终我发现这个过程与视觉合并有关(不知道如何从windows任务管理器复制命令行):

图片描述

顺便说一句,当我按下中止时,这个过程并没有消失,所以有人可能没有完成他们的功课.实际上,如果这个命令行没有六个相同的进程,我可能不会注意到它.

这些是我的设置:

图片描述

我该如何解决?我需要合并项目,我不知道该怎么做......

git beyondcompare atlassian-sourcetree

6
推荐指数
1
解决办法
2539
查看次数