
void Cell::setData(int role, QVariant &value)
{
Cell::setData(role,value);
}
程序段应该调用父类的setData成员函数,你让setData调用自己显然有问题
interface Ishpe
{
decimal Area();
decimal SetData();
}
class CTriangle : Ishpe
{
public CTriangle(decimal height, decimal bottom)
{
thisHeight = height;
thisBottom = bottom;
}
public decimal Height { get; set; }
public decimal Bottom { get; set; }
public decimal Area()
{
return (Height Bottom) / 2;
}
public decimal SetData()
{
return 0;
}
}
class CRect : Ishpe
{
public CRect(decimal height, decimal width)
{
thisHeight = height;
thisWidth = width;
}
public decimal Height { get; set; }
public decimal Width { get; set; }
public decimal Area()
{
return Height Width;
}
public decimal SetData()
{
return 0;
}
}
class CCircle : Ishpe
{
public CCircle(decimal radius)
{
thisRadius = radius;
}
public decimal Radius { get; set; }
public decimal Area()
{
decimal temp = (decimal)MathPI;
return temp Radius Radius;
}
public decimal SetData()
{
return 0;
}
}
class CArea
{
public CArea(decimal circleArea, decimal rectArea, decimal triangleArea)
{
thisRectArea = rectArea;
thisTriangleArea = triangleArea;
thisCircleArea = circleArea;
}
public decimal CircleArea { get; set; }
public decimal RectArea { get; set; }
public decimal TriangleArea { get; set; }
public decimal SumArea()
{
return CircleArea + RectArea + TriangleArea;
}
}
你这个重设大小我实在不明白什么意思。我数学也不是特别好!
一般来说,小程序下拉加载数据,用合并数组的方式(concat)然后再setData新的数组,这种方式只是试用数据量小的时候,为什么这么说,因为小程序的setData有一个限制,每次setData数据不能超过1024kb,大家可以想象一下,如果用concat合并产生新数组,并保存新数组为下一次加载的原数组,那么数量大的时候肯定会出现数据的大小超过1024KB的限制,那么这种问题该怎么解决呢,说解决方法的时候先了解下小程序渲染的过程
这可以这样理解小程序已经把数据和视图绑定了起来,众所周知vue是数据双向绑定的,数据改变,视图也会相应的改变,而上面的那段话是不是可以理解为小程序也是双向绑定的,
在vue里修改数据可以写 thisa = b
小程序里修改数据需要 thissetData({"key":value})
那我们是不是可以这样理解在小程序修改数据的时候只是调用setData方法修改了定义中的变量,
跟vue中thisa = b 是一样的性质而只是写法不一样
明白了,这一点,说解决方法。。。
上面说了数据量大的时候不能用concat的原因,那我们这时候该怎么解决,只是我们可以想,既然数据和视图绑定在一起了,我们是不是可以用一个二维数组解决这个问题
大概思路是这样的
1,在data里定义一个空数组,
2,获取下拉数据
3,把获取的数组,thissetData上面定义的数组
例如thissetData({
[`arr[${b}]`]:resdata
})
这样就避免了setData数据过大而不报错的问题。
这时候数组发生了改变视图也会相应的改变,不过这样可能会出现一个问题,如果加载数据过多的时候视图会出现渲染层失败,
Private Sub Command1_Click()
ClipboardSetData MePicture
MsgBox "已经将复制到剪贴板", , "断涯软件提示"
End Sub
Private Sub Form_Load()
If MsgBox("在打开软件时需要将剪贴板内容清楚 , 是否确定清除内容?", vbOKCancel, "断涯软件提示") = vbOK Then ClipboardClear
MePicture = LoadPicture(AppPath & "\123jpg")
End Sub
以上就是关于在windows下的Qt程序我感觉没错的可是他老是报这个错全部的内容,包括:在windows下的Qt程序我感觉没错的可是他老是报这个错、求C#程序。。定义一个接口IShape , 包括方法Area()(用来计算面积)和SetData()(用来重设形状大小)。、小程序 下拉加载数据量大解决方法等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)