From: <ai...@us...> - 2009-05-11 16:18:37
|
Revision: 9964 http://plplot.svn.sourceforge.net/plplot/?rev=9964&view=rev Author: airwin Date: 2009-05-11 16:18:11 +0000 (Mon, 11 May 2009) Log Message: ----------- AWI for Alban Rochel. Apply minor patch to remove some compiler warnings about casting arguments. Modified Paths: -------------- trunk/drivers/qt.cpp trunk/drivers/qt.h Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2009-05-11 14:08:05 UTC (rev 9963) +++ trunk/drivers/qt.cpp 2009-05-11 16:18:11 UTC (rev 9964) @@ -318,12 +318,12 @@ tempPainter.end(); - p->drawPicture(xOffset+bounding.width()/2., -yOffset, tempPic); + p->drawPicture((int)(xOffset+bounding.width()/2.), -yOffset, tempPic); xOffset+=bounding.width(); } -QPicture QtPLDriver::getTextPicture(PLUNICODE* text, int len, int chrht) +QPicture QtPLDriver::getTextPicture(PLUNICODE* text, int len, PLFLT chrht) { char plplotEsc; plgesc( &plplotEsc ); @@ -453,7 +453,7 @@ picDpi=picText.logicalDpiY(); m_painterP->setClipping(true); - m_painterP->setClipRect(QRect(pls->clpxmi*downscale, m_dHeight-pls->clpyma*downscale, (pls->clpxma-pls->clpxmi)*downscale, (pls->clpyma-pls->clpymi)*downscale), Qt::ReplaceClip); + m_painterP->setClipRect(QRect((int)(pls->clpxmi*downscale), (int)(m_dHeight-pls->clpyma*downscale), (int)((pls->clpxma-pls->clpxmi)*downscale), (int)((pls->clpyma-pls->clpymi)*downscale)), Qt::ReplaceClip); rotation -= pls->diorot * M_PI / 2.0; m_painterP->translate(txt->x*downscale, m_dHeight-txt->y*downscale); @@ -463,7 +463,7 @@ m_painterP->translate(-txt->just*xOffset*m_painterP->device()->logicalDpiY()/picDpi, 0.); - m_painterP->drawPicture(0., 0., picText); + m_painterP->drawPicture(0, 0, picText); m_painterP->setWorldMatrix(QMatrix()); m_painterP->setClipping(false); @@ -474,11 +474,11 @@ if(!m_painterP->isActive()) return; QPen p=m_painterP->pen(); - p.setColor(QColor(r, g, b, alpha*255)); + p.setColor(QColor(r, g, b, (int)(alpha*255))); m_painterP->setPen(p); QBrush B=m_painterP->brush(); - B.setColor(QColor(r, g, b, alpha*255)); + B.setColor(QColor(r, g, b, (int)(alpha*255))); B.setStyle(Qt::SolidPattern); m_painterP->setBrush(B); } @@ -773,8 +773,8 @@ if (pls->xlength <= 0 || pls->ylength <= 0) { pls->dev=new QtRasterDevice; - pls->xlength = ((QtRasterDevice*)(pls->dev))->m_dWidth; - pls->ylength = ((QtRasterDevice*)(pls->dev))->m_dHeight; + pls->xlength = (PLINT)(((QtRasterDevice*)(pls->dev))->m_dWidth); + pls->ylength = (PLINT)(((QtRasterDevice*)(pls->dev))->m_dHeight); } else { @@ -983,13 +983,13 @@ { setFileName(QString(fileName)); setResolution(POINTS_PER_INCH); - setSize(QSize(m_dWidth, m_dHeight)); + setSize(QSize((int)m_dWidth, (int)m_dHeight)); #if QT_VERSION >= 0x040500 setViewBox(QRect(0, 0, (int)m_dWidth, (int)m_dHeight)); #endif m_painterP=new QPainter(this); - m_painterP->fillRect(0, 0, m_dWidth, m_dHeight, QBrush(Qt::black)); + m_painterP->fillRect(0, 0, (int)m_dWidth, (int)m_dHeight, QBrush(Qt::black)); } void QtSVGDevice::savePlot() @@ -1038,8 +1038,8 @@ if (pls->xlength <= 0 || pls->ylength <= 0) { pls->dev=new QtSVGDevice; - pls->xlength = ((QtSVGDevice*)(pls->dev))->m_dWidth; - pls->ylength = ((QtSVGDevice*)(pls->dev))->m_dHeight; + pls->xlength = (int)(((QtSVGDevice*)(pls->dev))->m_dWidth); + pls->ylength = (int)(((QtSVGDevice*)(pls->dev))->m_dHeight); } else { @@ -1143,7 +1143,7 @@ } m_painterP=new QPainter(this); - m_painterP->fillRect(0, 0, m_dWidth, m_dHeight, QBrush(Qt::black)); + m_painterP->fillRect(0, 0, (int)m_dWidth, (int)m_dHeight, QBrush(Qt::black)); } void QtEPSDevice::savePlot() @@ -1215,8 +1215,8 @@ if (pls->xlength <= 0 || pls->ylength <= 0) { pls->dev=new QtEPSDevice; - pls->xlength = ((QtEPSDevice*)(pls->dev))->m_dWidth; - pls->ylength = ((QtEPSDevice*)(pls->dev))->m_dHeight; + pls->xlength = (int)(((QtEPSDevice*)(pls->dev))->m_dWidth); + pls->ylength = (int)(((QtEPSDevice*)(pls->dev))->m_dHeight); } else { @@ -1616,8 +1616,8 @@ p.setPen(QPen(Qt::white)); - p.drawLine(cursorParameters.cursor_x, 0., cursorParameters.cursor_x, height()); - p.drawLine(0., cursorParameters.cursor_y, width(), cursorParameters.cursor_y); + p.drawLine((int)cursorParameters.cursor_x, 0, (int)cursorParameters.cursor_x, height()); + p.drawLine(0, (int)cursorParameters.cursor_y, width(), (int)cursorParameters.cursor_y); p.end(); } Modified: trunk/drivers/qt.h =================================================================== --- trunk/drivers/qt.h 2009-05-11 14:08:05 UTC (rev 9963) +++ trunk/drivers/qt.h 2009-05-11 16:18:11 UTC (rev 9964) @@ -179,7 +179,7 @@ // Draws text in a QPicture using a sub-QPicture (!), updates the current xOffset void drawTextInPicture(QPainter*, const QString&); // Gets the QPicture displaying text, with the base chrht char height - QPicture getTextPicture(PLUNICODE* text, int len, int chrht); + QPicture getTextPicture(PLUNICODE* text, int len, PLFLT chrht); // Text-related variables bool underlined; @@ -210,8 +210,8 @@ virtual void setResolution(double dotsPerInch) { - setDotsPerMeterX((dotsPerInch/25.4)*1000.); - setDotsPerMeterY((dotsPerInch/25.4)*1000.); + setDotsPerMeterX((int)((dotsPerInch/25.4)*1000.)); + setDotsPerMeterY((int)((dotsPerInch/25.4)*1000.)); } protected: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |