Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12242

there is a warning at application output

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.6.3
    • SVG Support
    • None

    Description

      I created a little svg image with inkscape version 0.47. So every time if this image is added into QgraphicsScene object I get this warning:

      Starting C:\debug\sdf.exe...
      couldn't create image from  "" 
      
      

      After it the image is displayed how it should like you can see at the attached image.

      mainwindow.h:

      #include <QMainWindow>
      #include <QGraphicsScene>
      #include <QGraphicsTextItem>
      #include <QGraphicsRectItem>
      #include <QGraphicsSvgItem>
      
      namespace Ui {
          class MainWindow;
      }
      
      class MainWindow : public QMainWindow {
          Q_OBJECT
      public:
          MainWindow(QWidget *parent = 0);
          ~MainWindow();
      
      protected:
          void changeEvent(QEvent *e);
      		QGraphicsScene *scene;
      		QGraphicsSvgItem *svg_item;
      
      private:
          Ui::MainWindow *ui;
      
      	private slots:
      		void click123();
      };
      
      

      mainwindow.cpp:

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      
      #include <QGraphicsSvgItem>
      #include <QGraphicsRectItem>
      
      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent),
          ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      
      		scene = new QGraphicsScene();
      
      		ui->graphicsView->setScene(scene);
      
      		connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(click123()));
      
      		svg_item = new QGraphicsSvgItem("C:/tux_camera.svg");
      		svg_item->setPos(20, 20);
      
      		scene->addItem(svg_item);
      
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      void MainWindow::changeEvent(QEvent *e)
      {
          QMainWindow::changeEvent(e);
          switch (e->type()) {
          case QEvent::LanguageChange:
              ui->retranslateUi(this);
              break;
          default:
              break;
          }
      }
      
      void MainWindow::click123() {
      
      	//ui->graphicsView->scale(4.0, 4.0);
      
      }
      

      Attachments

        1. graphicsview_tux.png
          graphicsview_tux.png
          40 kB
        2. project.zip
          403 kB
        3. tux_camera.svg
          71 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            anno Hans Müller
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes