Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4340128
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:18:28+00:00 2026-05-21T11:18:28+00:00

QList<QPoint*> DrawingWidget::getCloseLinesById(int m_x, int m_y) { QList<QPoint*> lines; // HERE I APPEND ABOUT 5

  • 0
QList<QPoint*> DrawingWidget::getCloseLinesById(int m_x, int m_y) {
    QList<QPoint*> lines;
    // HERE I APPEND ABOUT 5 ITEMS 

    return lines;
}

The appending works here. It only gives me a few warnings, but it still compiles. The warning is.

taking address of temporary

But this

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();
        }
    }
}

result in these errors:

void value not ignored as it ought to be
void value not ignored as it ought to be

So it gives the same error for both lines.

This code should basically move my lines when I move my mouse.

How can I fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:18:28+00:00Added an answer on May 21, 2026 at 11:18 am

    You didn’t state what exactly is your question. But you are using extra * in your errored lines:

    points[i]->setX(event->x());
    

    Also, you didn’t show how you append to the list. My guess is the warning is from you assigning addresses of some computed QPoints. It will crash even if you get it compiled. Just use QList<QPoint>. It’s not that heavy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to append items to a QList at runtime, but I'm running on
I want to save a QList<int> to my QSettings without looping through it. I
I find some code sample with these oddl lines QList<TDataXml *> *newXMLData = input->getValue<QList<TDataXml
Qt's QList class provides several methods for getting the number of items in the
I've got a QList of QLineEdit*'s QList<QLineEdit*> example; Example will hold 100 items of
Here's the demo code: QList<Custom> L; QVariant v(QVariant::fromValue(l)); QDataStream d; d << v; The
I have a class, Car, that inherits a QList< int >. I am wondering
I created this 2D Qlist. Code works but when I consider a bit deeper
Given the declarations class DBuffer { //... }; typedef QList<DBuffer*> DBuffers; QList<int> fds; QMap<int,
I want to know, How QVariant can internally stores, int, QMap, QList,... I mean

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.