小编Mar*_*inS的帖子

如何在Qt中从QListView选择项中获取QString?

我需要在QListView中将选定的项目名称作为QString.我试过谷歌,但我还没发现任何有用的东西.

qstring qt qlistview

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

为BigInteger分配大号时出错

试图BigInteger在C#中为a分配一个大号

 BigInteger number= 27419669081321110693270343633073797;
Run Code Online (Sandbox Code Playgroud)

但它显示错误:

积分常数太大

我认为这BigInteger和我的RAM一样大,所以如何将这个数字移动到BigInteger

c# biginteger

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

按下箭头键时跳转组合框

当我在每个将 tabstop 属性设置为 true 的控件上按向上/向下箭头时,就会选择 PREVOIUS/NEXT tabindex。它工作正常,但是当ComboBox聚焦时,它会改变它的值,因为它也捕获了箭头。

如何在不将击键发送到 ComboBox 的情况下实现 tabindex 跳转?

处理tabindex跳转的代码:

private void ParentForm_KeyDown(object sender, KeyEventArgs e)
    { 
    Control ctl;
    ctl = (Control)sender;
    if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Enter)
    {
        ctl.SelectNextControl(ActiveControl, true, true, true, true);

    }
    else if (e.KeyCode == Keys.Up)
    {
        ctl.SelectNextControl(ActiveControl, false, true, true, true);

    }



}
Run Code Online (Sandbox Code Playgroud)

c# combobox arrow-keys winforms

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

变量"cluster"来计算c#中的阶乘

试图计算一个大数的阶乘,例如1000!

static void Main(string[] args)
        {
            UInt64 fact = 1;

            for (UInt64 i = 1000; i > 0; i--)
            {
                fact = fact * i;
            }
            Console.WriteLine(fact); //returns 0, due to overflow UInt64, max fact is 56!

            Console.ReadKey();
        }
Run Code Online (Sandbox Code Playgroud)

所以我问,如果有一些方法可以将更多变量加入到集群中,那么我可以制作一个非常大的变量来存储"大"数字.

.net c# variables cluster-computing factorial

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

1/BigInteger in c#

我要实现

BigInteger.ModPow(1/BigInteger, 2,5);
Run Code Online (Sandbox Code Playgroud)

1/BigInteger总是返回0,导致结果也是0如此.我试着BigDecimal为c#寻找一些课程,但我什么都没发现.即使没有,有什么方法可以算这个BigDecimal吗?

c# biginteger inverse

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

用于C#的快速线程安全随机数发生器

我需要在多个正在运行的线程中快速生成随机浮点数.我尝试过使用System.Random,但它对我的需求来说太慢了,它在多个线程中返回相同的数字.(当我在一个线程中运行我的应用程序时,它工作正常.)另外,我需要确保生成的数字在0到100之间.

这是我现在正在尝试的内容:

number = random.NextDouble() * 100;
Run Code Online (Sandbox Code Playgroud)

我该怎么办呢?

c# random parallel-processing performance generator

0
推荐指数
1
解决办法
5512
查看次数