
滚轮闪退D:\Anaconda\envs\你安装labelimg的虚拟环境名称\Lib\site-packages\labelImg根据自己的文件存储路径修改找到 labelImg.py修改def scroll_request()函数def scroll_request(self, delta, orientation): units - delta / (8 * 15) bar self.scroll_bars[orientation] # bar.setValue(bar.value() bar.singleStep() * units) bar.setValue(int(bar.value() bar.singleStep() * units))Create RectBox 闪退D:\Anaconda\envs\你安装labelimg的虚拟环境名称\Lib\site-packages\libs根据自己的文件存储路径修改找到 canvas.py修改 # Paint rect 部分代码if self.current is not None and len(self.line) 2: left_top self.line[0] right_bottom self.line[1] rect_width right_bottom.x() - left_top.x() rect_height right_bottom.y() - left_top.y() p.setPen(self.drawing_rect_color) brush QBrush(Qt.BDiagPattern) p.setBrush(brush) lx int(round(left_top.x())) ly int(round(left_top.y())) rw int(round(rect_width)) rh int(round(rect_height)) p.drawRect(lx, ly, rw, rh) # p.drawRect(left_top.x(), left_top.y(), rect_width, rect_height) if self.drawing() and not self.prev_point.isNull() and not self.out_of_pixmap(self.prev_point): p.setPen(QColor(0, 0, 0)) x int(round(self.prev_point.x())) p.drawLine(x, 0, x, int(self.pixmap.height())) # p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) y int(round(self.prev_point.y())) p.drawLine(0, y, int(self.pixmap.width()), y) # p.drawLine(0, self.prev_point.y(), self.pixmap.width(), self.prev_point.y())