QGraphicsPixmapItem not showed in QGraphicsScene in deployed mode - qt

With the following code, on my workstation (QtCreator an "manually" running) all works fine. But on an other pc with no Qt installation my application don't show the QGraphicsPixmapItem.
image = new QGraphicsPixmapItem(QPixmap(urlFile));
image->setZValue(-5000.0);
scene->setSceneRect(QRectF(0, 0, image->pixmap().width() + 200, image->pixmap().height() + 200));
scene->addItem(image);
view->setMaximumWidth(image->pixmap().width() + 200);
view->setMaximumHeight(image->pixmap().height() + 200);
qreal centerX = (scene->width() / 2.0) - (image->pixmap().width() /2.0);
qreal centerY = (scene->height() / 2.0) - (image->pixmap().height() /2.0);;
image->setOffset(QPointF(centerX, centerY));
Do you know why ?

I Know why :)
The folowing dll are needed to use jpg and gif : qgif4.dll, qjpeg4.dll.
In fact, a deployed application support by default, only the following formats : bmp, pbm, png, ppm, xbm, xpm.
The previously dll could be find in QTDIR/qt/plugins/imageformats/
To add the support of other image formats to your deployed application, create a imageformats/ directory on the same level of your executable and put your wanted dll in.

Related

GlyphVector.getoutline() never returning

I am trying to create a PostScript file using the Apache xml-graphics library. When I run under Java, it works fine.
But when I build for .NET using IKVM, then on a call to GlyphVector.getoutline(x, y), the code never returns.
This is happening when I:
AttributedString as = new AttributedString(buf.toString());
// call as.addAttribute() setting various TextAttribute for various ranges
FontRenderContext frc = graphics.getFontRenderContext();
LineBreakMeasurer lineMeasurer = new LineBreakMeasurer(as.getIterator(), frc);
TextLayout layout = lineMeasurer.nextLayout(Integer.MAX_VALUE);
layout.draw (graphics, left, line.getBaseline());
Any idea what can be going wrong?
thanks - dave

Qt OpenCV write video from capture frame, not saving

I can succesfully save video which I captured from c++ opencv there is no problem.
Bu similar code not capturing the video. Just opening out.avi . and only 6 kb.
I put the code in showframe func. there is no resizing fyi.
Anybody has experience with the opencv videowriter on the Qt?
void Widget::show_frame(Mat &image)
{
Mat resized_image = image.clone();
video.write(image);
int width_of_label = ui->label_camera->width();
int height_of_label = ui->label_camera->height();
Size size(width_of_label, height_of_label);
// cv::resize(image, resized_image, size);
cvtColor(image,image,CV_BGR2RGB);
cvtColor(resized_image, resized_image, CV_BGR2RGB);
ps : Platform MacOSX
I encountered the same problem with you, and I have tried many solutions, I think you can make the fifth parameter of videowriter() be false. That is, VideoWriter out = VideoWriter(video_name, CV_FOURCC('D', 'I', 'V', 'X'),frame_fps,Size(frame_width,frame_height),false). This works for me!
make sure that your application has access to the opencv_ffmpeg*.dll. For example place it in the working directory or the PATH variable.
Try different codecs, too. Afaik, MJPG did work on all tested machines/systems so far.

JavaCV VideoWriter does not open

I want to record a video using JavaCV in JOGL (Java Binding for OpenGL).
This is the code to open the video file:
VideoWriter wv;
wv.open("video.avi", CV_FOURCC_DEFAULT, 30 , new Size(width, height), true);
The problem is that wv.isOpened() always returns false and no video file is created.
Things I've tried:
Change "video.avi" to "video.mp4"
Change CV_FOURCC_DEFAULT to -1
Change width, height, fps values
Anyone have achieved this?
My machine is running an Ubuntu 14.04 LTS with JavaCV v1.3.2 and JOGL v2.3.2.
When using OpenCV with C++ I had to define this constant:
const int VIDEO_CODEC_FOURCC = CV_FOURCC('M','J','P','G');
Try doing using the CV_FOURCC function and the use the .avi file extension as you had originally. Also try to make sure that the camera's frame dimensions are the same as the Size that you passed in your width and height.

Qt5.4.1 + QtMultimedia + Raspbian

I have a problem with showing video using QtMultimedia on Raspberry Pi (Raspbian):
When I'm using QMediaPlayer + QVideoWidget it gives me an error: "this plugin doesn't support setParent"
When I'm trying to show video with QtQuick it gives me errors:
pi#raspberrypi ~/Desktop/QtApp $ ./JM
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and
QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
GStreamer; Unable to pause - ""
Error: "No URI set"
Here is QtQuick project: https://gist.github.com/anonymous/e41fa0721bc895d7fe00
Video is placed here: /home/pi/Desktop/QtApp/video/adv.mov
How can I solve this problems?
Your program does not find your video.
Replace:
source: "./video/adv.mov"
with:
source: "file:///home/pi/Desktop/QtApp/video/adv.mov"
in your video.qml
You added your video.qml into the Qt resources:
app.load(QUrl("qrc:/qml/video.qml"));
This is practically a different file system, so your root folder is probably not what you expected... and your relative path points nowhere.

Cocos3d: Texture not displaying

I have created a Cocos3d iOS project and facing issue on texture display. My project has been kept under this link-> https://www.yousendit.com/download/UVJpWmdzTkwzMW40WjhUQw
If we run this project, we can see a sample house model output, where roof shows in plain white color in the house. But, actually i have added a roof texture in blender, and converted in pod. I don't know why the roof texture display not displaying when running the code in simulator. Could please download my sample project https://www.yousendit.com/download/UVJpWmdzTkwzMW40WjhUQw and suggest me. This project source also contains the .blend, .dae, .pod files which its using.
CC3PODResourceNode* podRezNode = [CC3PODResourceNode nodeWithName: #"RobotPODRez"];
podRezNode.resource = [IntroducingPODResource resourceFromFile: #"DieCube.pod"];
// If you want to stop the robot arm from being animated, uncomment the following line.
// [podRezNode disableAllAnimation];
podRezNode.shouldCullBackFaces = NO;
podRezNode.location = cc3v(0.0, 0.0, 0.0);
podRezNode.isTouchEnabled = YES;
[self addChild: podRezNode];
Your DAE files do not reference any textures:
TestHouse.dae:
<library_images/>
So, you must have not exported them from Blender.

Resources