我正在尝试使用rects建立网格,但是我认为我没有正确使用import { NativeModules } from 'react-native';
// wraps the app in a function to allow three finger dev menu access
const DevMenuTrigger = ({ children }) => {
const { DevMenu } = NativeModules;
const panResponder = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => {
if (gestureState.numberActiveTouches === 3) {
DevMenu.show();
}
},
});
return <View style={{ flex: 1 }} {...panResponder.panHandlers}>{children}</View>;
};
const DevApp = () => (<DevMenuTrigger><App /></DevMenuTrigger>);
// export default App;
export default DevApp;
。我现在的代码:
QGraphicsRectItem
for x in range(0,self.robot_world.get_width()):
for y in range(0, self.robot_world.get_height()):
item = QtWidgets.QGraphicsRectItem(x, y, self.square_size*(x+1), self.square_size*(y+1))
#item.setBrush(QtGui.QBrush(QtGui.QColor(211,211,211), QtCore.Qt.CrossPattern))
self.scene.addItem(item)
和get_width
分别是8和10,因此网格的大小必须为8x10。我的网格当前如下所示:
由于某种原因,上边缘和左边缘不正确。