QList<QPoint*> DrawingWidget::getCloseLinesById(int m_x, int m_y) {
QList<QPoint*> lines;
// HERE I APPEND ABOUT 5 ITEMS
return lines;
}
这里的附加工作。它只给了我几个警告,但它仍然编译。警告是。Qt创建者C++,void值不会被忽略,因为它应该是
taking address of temporary
但这
void DrawingWidget::mouseMoveEvent(QMouseEvent *event) {
if(m_mainWindow->getSelectedTool() == MainWindow::moveVertexTool) {
m_x = event->x();
m_y = event->y();
QList<QPoint*> points = getCloseLinesById(event->x(), event->y());
for(int i = 0; i < points.size(); i++) {
*points[i]->setX(event->x()); //error on this line
*points[i]->setY(event->y()); // error on this line
}
update();
}
}
}
导致这些错误:
void value not ignored as it ought to be
void value not ignored as it ought to be
所以它给出了两行相同的错误。
当我移动鼠标时,这段代码应该基本上移动我的行。
我该如何解决这个问题?