void ImageDraw
::selectLine(QPoint pRelease
) {
int i=0;
Q3CanvasItemList item = m_pCanvas->collisions(pRelease);;
m_itemLine = item;
for (Q3CanvasItemList::Iterator it= m_itemLine.begin(); it!= m_itemLine.end(); ++it)
{
if ( (*it)->rtti() == 7 )
{
for(i=0;i<20;i++)
{
if((i<lineList.size())&&((*it)->collidesWith(lineList.at(i))))
{
QMessageBox::information(this, tr
("Mouse Event"),tr
("Line %1 Mouse Event Handled ").
arg(i
));
m_pCanvasLine
[i
]->setPen
(QPen(Qt
::red));
xPoint = m_pCanvasLine[i]->startPoint();
yPoint = m_pCanvasLine[i]->endPoint();
m_pCanvasLine[i]->setPoints(xPoint.x(),xPoint.y(),yPoint.x(),yPoint.y());
m_pCanvasLine[i]->show();
break;
}
else if((i<lineList2.size())&&((*it)->collidesWith(lineList2.at(i))))
{
QMessageBox::information(this, tr
("Mouse Event"),tr
("Line %1 Mouse Event Handled ").
arg(i
));
m_pCanvasLine2
[i
]->setPen
(QPen(Qt
::red));
xPoint = m_pCanvasLine2[i]->startPoint();
yPoint = m_pCanvasLine2[i]->endPoint();
m_pCanvasLine2[i]->setPoints(xPoint.x(),xPoint.y(),yPoint.x(),yPoint.y());
m_pCanvasLine2[i]->show();
break;
}
}
}
void ImageDraw::selectLine(QPoint pRelease)
{
int i=0;
QPoint xPoint,yPoint;
Q3CanvasItemList item = m_pCanvas->collisions(pRelease);;
m_itemLine = item;
for (Q3CanvasItemList::Iterator it= m_itemLine.begin(); it!= m_itemLine.end(); ++it)
{
if ( (*it)->rtti() == 7 )
{
for(i=0;i<20;i++)
{
if((i<lineList.size())&&((*it)->collidesWith(lineList.at(i))))
{
QMessageBox::information(this, tr("Mouse Event"),tr("Line %1 Mouse Event Handled ").arg(i));
m_pCanvasLine[i]->setPen(QPen(Qt::red));
xPoint = m_pCanvasLine[i]->startPoint();
yPoint = m_pCanvasLine[i]->endPoint();
m_pCanvasLine[i]->setPoints(xPoint.x(),xPoint.y(),yPoint.x(),yPoint.y());
m_pCanvasLine[i]->show();
break;
}
else if((i<lineList2.size())&&((*it)->collidesWith(lineList2.at(i))))
{
QMessageBox::information(this, tr("Mouse Event"),tr("Line %1 Mouse Event Handled ").arg(i));
m_pCanvasLine2[i]->setPen(QPen(Qt::red));
xPoint = m_pCanvasLine2[i]->startPoint();
yPoint = m_pCanvasLine2[i]->endPoint();
m_pCanvasLine2[i]->setPoints(xPoint.x(),xPoint.y(),yPoint.x(),yPoint.y());
m_pCanvasLine2[i]->show();
break;
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks