How to make a SVG at tab Widget ?
- 
Hi 
 I assume you want to use the one you put in the tab ?QGraphicsView view(scene);
 view.show();ui->graphicsView->setScene(scene); 
- 
Hi 
 I assume you want to use the one you put in the tab ?QGraphicsView view(scene);
 view.show();ui->graphicsView->setScene(scene); @mrjj said in How to make a SVG at tab Widget ?: Hi 
 I assume you want to use the one you put in the tab ?QGraphicsView view(scene);
 view.show();ui->graphicsView->setScene(scene); Thank you for your reply. 
 It looks like have loading something.But as you say , I think it just only show one moment. 
 Where is wrong? 
- 
@mrjj said in How to make a SVG at tab Widget ?: Hi 
 I assume you want to use the one you put in the tab ?QGraphicsView view(scene);
 view.show();ui->graphicsView->setScene(scene); Thank you for your reply. 
 It looks like have loading something.But as you say , I think it just only show one moment. 
 Where is wrong? 
- 
@Devopia53 said in How to make a SVG at tab Widget ?: like this: graphicsView->scene()->addWidget(new QSvgWidget(":/your.svg"));Thank you for your reply. 
 I try to fix it.
 But it show following message.
  
- 
@Devopia53 said in How to make a SVG at tab Widget ?: like this: graphicsView->scene()->addWidget(new QSvgWidget(":/your.svg"));Thank you for your reply. 
 I try to fix it.
 But it show following message.
  
- 
@Devopia53 said in How to make a SVG at tab Widget ?: like this: graphicsView->scene()->addWidget(new QSvgWidget(":/your.svg"));Thank you for your reply. 
 I try to fix it.
 But it show following message.
  @RiceBall 
 AddQT += svgin .pro fileRefer Rendering SVG Files 
- 
@RiceBall 
 AddQT += svgin .pro fileRefer Rendering SVG Files @Devopia53 
 @Pradeep-P-N said in How to make a SVG at tab Widget ?:@RiceBall 
 AddQT += svgin .pro fileRefer Rendering SVG Files I try to fix it. 
 It almost pass all compile.
 But it show "The process was ended forcefully." 
- 
@Devopia53 
 @Pradeep-P-N said in How to make a SVG at tab Widget ?:@RiceBall 
 AddQT += svgin .pro fileRefer Rendering SVG Files I try to fix it. 
 It almost pass all compile.
 But it show "The process was ended forcefully." @RiceBall said in How to make a SVG at tab Widget ?: But it show "The process was ended forcefully." Please debug and tell us where exactly it crashes... 
- 
@RiceBall said in How to make a SVG at tab Widget ?: But it show "The process was ended forcefully." Please debug and tell us where exactly it crashes... @jsulm said in How to make a SVG at tab Widget ?: @RiceBall said in How to make a SVG at tab Widget ?: But it show "The process was ended forcefully." Please debug and tell us where exactly it crashes...  
- 
@jsulm said in How to make a SVG at tab Widget ?: @RiceBall said in How to make a SVG at tab Widget ?: But it show "The process was ended forcefully." Please debug and tell us where exactly it crashes...  @RiceBall Please show the whole content of your MainWindow constructor, especially line 31. 
 I guess it is the one you posted in a screen-shot before? It would be helpful if you would simply copy/paste the code instead of posting screen-shots.
 It looks like your scene was not yet initialised.
- 
@RiceBall Please show the whole content of your MainWindow constructor, especially line 31. 
 I guess it is the one you posted in a screen-shot before? It would be helpful if you would simply copy/paste the code instead of posting screen-shots.
 It looks like your scene was not yet initialised.@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Please show the whole content of your MainWindow constructor, especially line 31. 
 I guess it is the one you posted in a screen-shot before? It would be helpful if you would simply copy/paste the code instead of posting screen-shots.
 It looks like your scene was not yet initialised.I tried to simple it. 
 But the problem is the same.. 
 mainwindow.cpp#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtGlobal> #include <QMovie> #include <QSvgWidget> #include <QPixmap> #include <QGraphicsScene> #include <QGraphicsPixmapItem> #include <QGraphicsView> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->graphicsView->scene()->addWidget(new QSvgWidget("../untitled6/splash1.svg")); } MainWindow::~MainWindow() { delete ui; }
- 
@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Please show the whole content of your MainWindow constructor, especially line 31. 
 I guess it is the one you posted in a screen-shot before? It would be helpful if you would simply copy/paste the code instead of posting screen-shots.
 It looks like your scene was not yet initialised.I tried to simple it. 
 But the problem is the same.. 
 mainwindow.cpp#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtGlobal> #include <QMovie> #include <QSvgWidget> #include <QPixmap> #include <QGraphicsScene> #include <QGraphicsPixmapItem> #include <QGraphicsView> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->graphicsView->scene()->addWidget(new QSvgWidget("../untitled6/splash1.svg")); } MainWindow::~MainWindow() { delete ui; }@RiceBall Did you set the scene? 
 https://doc.qt.io/qt-5/qgraphicsview.html#setScene
- 
@RiceBall Did you set the scene? 
 https://doc.qt.io/qt-5/qgraphicsview.html#setScene@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Did you set the scene? 
 https://doc.qt.io/qt-5/qgraphicsview.html#setSceneNo.I don't set any scene. 
 Should I need to set it by " QGraphicsScene scene " at mainwindow.cpp ??? Or Not ?
- 
@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Did you set the scene? 
 https://doc.qt.io/qt-5/qgraphicsview.html#setSceneNo.I don't set any scene. 
 Should I need to set it by " QGraphicsScene scene " at mainwindow.cpp ??? Or Not ?@RiceBall Well https://doc.qt.io/qt-5/qgraphicsview.html#scene says 
 "Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned."
 I would say you have to set a scene as shown here https://doc.qt.io/qt-5/qgraphicsview.htmlQGraphicsScene scene; scene.addText("Hello, world!"); QGraphicsView view(&scene); // use setScene() instead view.show();
- 
@RiceBall Well https://doc.qt.io/qt-5/qgraphicsview.html#scene says 
 "Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned."
 I would say you have to set a scene as shown here https://doc.qt.io/qt-5/qgraphicsview.htmlQGraphicsScene scene; scene.addText("Hello, world!"); QGraphicsView view(&scene); // use setScene() instead view.show();@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Well https://doc.qt.io/qt-5/qgraphicsview.html#scene says 
 "Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned."
 I would say you have to set a scene as shown here https://doc.qt.io/qt-5/qgraphicsview.htmlQGraphicsScene scene; scene.addText("Hello, world!"); QGraphicsView view(&scene); // use setScene() instead view.show();I try to fix it as your recommend. 
 But it will shown "no viable conversion from 'QGraphicsScene' to ' QGraphicsScene *'"
 Where should I need to change ? 
- 
@RiceBall said in How to make a SVG at tab Widget ?: 'QGraphicsScene' to ' QGraphicsScene *'" Please try ui->graphicView->setScene(&scene);
- 
Hi 
 Please notice you are killing the scene very fast.
 Make it a member of the class.
 Should live in class so it dont go out of scope,
- 
@jsulm said in How to make a SVG at tab Widget ?: @RiceBall Well https://doc.qt.io/qt-5/qgraphicsview.html#scene says 
 "Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned."
 I would say you have to set a scene as shown here https://doc.qt.io/qt-5/qgraphicsview.htmlQGraphicsScene scene; scene.addText("Hello, world!"); QGraphicsView view(&scene); // use setScene() instead view.show();I try to fix it as your recommend. 
 But it will shown "no viable conversion from 'QGraphicsScene' to ' QGraphicsScene *'"
 Where should I need to change ? @RiceBall Please think about what you're doing instead of blindly copy/paste code snippets which meant to be simple examples. 
 First: don't create the scene on the stack!
 Second: pass pointer to setScene (the error message actually tells you what is wrong).
- 
@RiceBall said in How to make a SVG at tab Widget ?: 'QGraphicsScene' to ' QGraphicsScene *'" Please try ui->graphicView->setScene(&scene);@Pradeep-P-N said in How to make a SVG at tab Widget ?: @RiceBall said in How to make a SVG at tab Widget ?: 'QGraphicsScene' to ' QGraphicsScene *'" Please try ui->graphicView->setScene(&scene);I success to show it finally. 
 Thanks @jsulm @Pradeep-P-N @mrjj help.Key Point 
 .proQT += svgfinal code QGraphicsScene *scene = new QGraphicsScene; scene->addWidget(new QSvgWidget("../untitled6/splash1.svg")); scene->addWidget(new QSvgWidget("../untitled6/splash2.svg")); ui->graphicsView->setScene(scene); 
- 
@Pradeep-P-N said in How to make a SVG at tab Widget ?: @RiceBall said in How to make a SVG at tab Widget ?: 'QGraphicsScene' to ' QGraphicsScene *'" Please try ui->graphicView->setScene(&scene);I success to show it finally. 
 Thanks @jsulm @Pradeep-P-N @mrjj help.Key Point 
 .proQT += svgfinal code QGraphicsScene *scene = new QGraphicsScene; scene->addWidget(new QSvgWidget("../untitled6/splash1.svg")); scene->addWidget(new QSvgWidget("../untitled6/splash2.svg")); ui->graphicsView->setScene(scene); @RiceBall said in How to make a SVG at tab Widget ?: @Pradeep-P-N said in How to make a SVG at tab Widget ?: @RiceBall said in How to make a SVG at tab Widget ?: 'QGraphicsScene' to ' QGraphicsScene *'" Please try ui->graphicView->setScene(&scene);I success to show it finally. 
 Thanks @jsulm @Pradeep-P-N @mrjj help.Key Point 
 .proQT += svgfinal code QGraphicsScene *scene = new QGraphicsScene; scene->addWidget(new QSvgWidget("../untitled6/splash1.svg")); scene->addWidget(new QSvgWidget("../untitled6/splash2.svg")); ui->graphicsView->setScene(scene); Hello every one 
 I meet a new easy problem.
 How could I define the scene size & transparent....?
 
