Solved

QPainterPath

Posted on 2010-08-27
1
924 Views
Last Modified: 2013-11-23
Hi there,
I wrote this code and I get this error, how can I solve it ?

I initialized paint_path like that :
 QPainterPath *paint_path;

this is the error message (no matching function for call to 'QGraphicsPathItem::setPath(QPainterPath*&)')

Thank you
void MainWindow::render_electrodes(double (*array)[3])
{
    paint_path = new QPainterPath();
    for(int i=2;i<2000;i++)
    {
        paint_path->lineTo(-(array[i][0]-21831),i);
    }
    path = new QGraphicsPathItem(0,scene);
    path->setPos(140,0);
    path->scale(0.3,1.0);
    path->rotate(-90);
    path->setPen(QPen(Qt::black));
    path->setPath(paint_path);
}

Open in new window

0
Comment
Question by:obad62
1 Comment
 
LVL 32

Accepted Solution

by:
phoffric earned 500 total points
Comment Utility
I see the api for setPath is:
   void QGraphicsPathItem::setPath ( const QPainterPath & path );
        http://doc.qt.nokia.com/4.6/qgraphicspathitem.html#setPath

But your argument is paint_path, which is (QPainterPath*), I presume, since your code is:
       paint_path = new QPainterPath();

So, dereference paint_path.
Maybe this will work:
     path->setPath( *paint_path);
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now