Quote Originally Posted by munna
Please Explain the following lines.

Qt Code:
  1. m_pCanvasLine = new Q3CanvasLine*[lineNum];
  2. for(i=0;i<lineNum;i++) {
  3. xyPoint = (i+1)*4;
  4. yyPoint = xyPoint;
  5. m_pCanvasLine[i] = new Q3CanvasLine(m_pCanvas);
  6. m_pCanvasLine[i]->setPoints(xxPoint,xyPoint,yxPoint,yyPoint);
  7. m_pCanvasLine[i]->show();
  8. }
  9. m_pLineItem = new Q3CanvasLine(m_pCanvas);
  10. lineList.append(m_pLineItem);
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. m_pCanvasRectangle = new Q3CanvasRectangle*[recNum];
  2. for(i=0;i<recNum;i++){
  3. m_pCanvasRectangle[i] = new Q3CanvasRectangle(xPoint, yPoint, width, height, _pCanvas);
  4. m_pCanvasRectangle[i]->show();
  5. yPoint += 75;
  6. }
To copy to clipboard, switch view to plain text mode 

As i said earlier you dont need to maintain two lists. One list should be more than enough to achieve your task. Please try to find out what exactly you need to achieve and what you are doing in your code.

Hi.. yaa i understood it.. i was doing this mistake.. i after that removed the array and just maintained the QList as you had told me too.. also i was able to view the line number as i told in the reply just above ur last reply...

Thanks a lot for ur help..

Please tell me that is there any setColour sort of function for chaging the line or rectangle colour on click.. or i have to set a pen and recreate the line or rect over the created line...

Thanks again...

Kapil