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
所以它給出了兩行相同的錯誤。
當我移動鼠標時,這段代碼應該基本上移動我的行。
我該如何解決這個問題?