C++ (Qt)QGraphicsPixmapItem* pPixmapItem1 = new QGraphicsPixmapItem("./misc/onSwitch.svg");
main@krchome:/tmp/sample$ makeg++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cppmain.cpp: In function ‘int main(int, char**)’:main.cpp:5: error: no matching function for call to ‘QGraphicsPixmapItem::QGraphicsPixmapItem(const char [13])’/usr/include/qt4/QtGui/qgraphicsitem.h:924: note: candidates are: QGraphicsPixmapItem::QGraphicsPixmapItem(const QGraphicsPixmapItem&)/usr/include/qt4/QtGui/qgraphicsitem.h:885: note: QGraphicsPixmapItem::QGraphicsPixmapItem(const QPixmap&, QGraphicsItem*, QGraphicsScene*)/usr/include/qt4/QtGui/qgraphicsitem.h:879: note: QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem*, QGraphicsScene*)make: *** [main.o] Error 1main@krchome:/tmp/sample$ g++ --versiong++ (Ubuntu 4.4.3-2ubuntu1) 4.4.3
C++ (Qt)#include <QGraphicsPixmapItem> int main(int, char**){ QGraphicsPixmapItem *item = new QGraphicsPixmapItem("./sample.svg"); Q_UNUSED(item);}
C++ (Qt)label->setPixmap(QPixmap(QString::fromUtf8("../../usr/share/icons/hicolor/scalable/actions/jockey-certified.svg")));
C++ (Qt)QSvgImage svg("./misc/onSwitch.svg");svg.resize(100, 100, Qt::KeepAspectRatio);label->setPixmap(svg.pixmap());QGraphicsPixmapItem *item = new QGraphicsPixmapItem(svg.pixmap());
C++ (Qt)item->setCacheMode(QGraphicsItem::NoCache);