Can not deploy my qt app on Linux - c++

I created app for building graphics. Just press button, choose file and look to the canvas for visualisation.
I used QGraphicsView for drawing. App works perfectly in debug mode. But when I'm deploying it with AppImage it doesn't work. I press button, choose file and nothing happens. I have no any message or warning.
I didn't use qml. My app is very simple.
List of headers, that I've include:
#include <QApplication>
#include <QMainWindow>
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QHBoxLayout>
#include <QMetaType>
#include <QThread>
look of my release dir:enter image description here
Any help will be appreciated

Related

Syntax highlighting for llvm c++ api in clion

Right now I'm quite extensively using the C++-Api for LLVM IR. I'm using CLion as my IDE and im building and linking the project via a Makefile.
The includes look like the following
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
The problem now is that I don't have any syntax highlighting for the things coming from the llvm headers. How do I enable that.

Q_OBJECT macro issue during build

I'm working on a project using QT. To link it with premake, I cloned the addon which generate a QT solution premake-qt. It works fine when it comes to use qt in general.
But I need to create custom signals so to do that, I had to add Q_OBJECT in my header file.
Here is the file:
#pragma once
#ifndef _WINDOW_H_
#define _WINDOW_H_
#include <QApplication>
#include <QWidget>
#include <QPushButton>
#include <QProgressBar>
#include <QSlider>
#include <QFileDialog>
#include <QtDebug>
#include <QFile>
#include <QTextStream>
#include <QMenu>
class WindowUI : public QWidget
{
Q_OBJECT
enum class State {
Save = 0,
Export = 1,
};
... // rest of header
So without the Q_OBJECT everything works fine, but when I build with it, I have an error.
>Moc'ing Window.h
>the specified path cannot be found.
And something I found is that it generates a moc_Window.args and a moc_Window.cpp in the vscode tree but the .cpp is not in my work directory.
If needed I can provide my premake.lua config file where I link QT if something is missing.
Do I have to run qmake on my project when I add Q_OBJECT ?
Try removing the class from VS project and adding it back. I've had similar issues when changing a normal class to QObject based (including Q_OBJECT macro). I think the issue is related to how the Qt VS add-in does the moc'cing.

Visual Studio doesn't find GL/glut.h

I'm using Microsoft Visual Studio Community 2017 on Windows 10 and I've been trying to install GLUT using this online guide that I found on this StackOverflow question. However, when I try to compile my code this error still shows up: fatal error C1083: Cannot open include file: 'GL\glut.h': No such file or directory. I've followed every single step line by line, but nothing seems to work. What could be causing this error?
This is how I'm importing the dependencies:
#include <iostream>
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <GL/glut.h>
#include <cstring>
#include "math.h"
#include <conio.h>
For this, I like to use the Nuget package manager. If you go to
Tools>NuGet Package Manager>Package Manager Console
Then, in the console type:
Install-Package nupengl.core
Your problem should be fixed.

What to include for cv::meanShift function?

I've included the following and it doesn't work :
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
What to include for cv::meanShift function ?
it's in the video module, so:
#include <opencv2/video/video.hpp>
2 hours later I found the answer :)
For some reason #include can't be included directly so the following code will include the video module indirectly.
#include "opencv2/video/tracking.hpp"
#include "opencv2/video/background_segm.hpp"
Answer here : http://fossies.org/dox/opencv-2.4.9/video_8hpp.html

Qt Creator build project - No such file or directory

Sorry to being a noob, but I just moved from Window, Eclipse and Java to OpenSUSE, C++ and Qt Creator, and I met a problem. I am working to create a QGIS application, I have the *.h files in /usr/include/gqis, and *.so files in /usr/lib. I added this line
INCLUDEPATH += /usr/local/include/qgis
at the end of .pro file of project so I can include QGIS library. So far as I coded, everything went smoothly, but when I built the project, Qt Creator threw an error:
qgis.h: No such file or directory
/usr/include/qgis/qgsapplication.h
and it mapped to line 4:
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <qgis/qgsvectorlayer.h>
#include <qgis/qgsapplication.h>
#include <qgis/qgsproviderregistry.h>
#include <qgis/qgssinglesymbolrenderer.h>
#include <qgis/qgsmaplayerregistry.h>
#include <qgis/qgsvectorlayer.h>
#include <qgis/qgsmapcanvas.h>
As far as I searched, I am still unable to solve this problem. Please can anyone help me?
You should do:
INCLUDEPATH += /usr/local/include/qgis
and
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <qgsvectorlayer.h>
#include <qgsapplication.h>
#include <qgsproviderregistry.h>
#include <qgssinglesymbolrenderer.h>
#include <qgsmaplayerregistry.h>
#include <qgsvectorlayer.h>
#include <qgsmapcanvas.h>
Try just:
INCLUDEPATH += /usr/local/include/
Afterall, the qgis is already listed in the #include <qgis/...> path.
I'm using a windows Machine. I'm not sure why this is the case but if you put your project in a shallow directory, the problem might go away. Instead of something like C:\Projects\C++\IntroToDesignPatterns2012\Chapter13\objectBrowser02\objectBrowser02
Try something simple like C:\Projects\objectBrowser02