How to add .exp file in QT project? - c++

I am beginner in QT. I want to know is there is any way to add .exp file in QT project, or is there any work around to achieve this.

I'm not shure what is the .exp file but The Qt Resource System allow you storing files with any extension in the application's executable.
I hope it help.

Related

How to create library that uses some other libraries?

I'm trying to create a graphic library (nothing serious, just to learn stuff). In Visual Studio I have one solution and two projects in it - dll and exe. For window management I use GLFW library. In my own window class I want to have a private memeber of GLFW Window structure. The problem is that my exe project doesn't know what GLFW is - it doesn't know where to find #include <glfw/glfw3>.
My question is - what's the proper way to create such library that uses other libraries? Setting the exe project to include all those libraries doesn't sound like a good idea to me.
Since you are using visual studio, then Microsofts documentation is a great place to get information. https://learn.microsoft.com/en-us/cpp/build/dlls-in-visual-cpp?view=vs-2019 they have a description on DLL’s and how to create them and also how to link DLL’s to projects.
Thanks to #Manuel I figured out how to do it: both - dll and exe projects, have to include libraries' header files.
My solution: in dll I use precompiled headers so all libraries' header files are included in that file with a relative path. In dll project settings I put proper paths so any libraries files will know how to find their headers. What's important is that my exe project includes one header file from my dll and that file include precompiled header so exe project 'knows' everything it needs about libraries.
Thanks again #Manuel for your help!

How can I use Linguist in Qt without .pro file?

I'm trying to translate my language to another arbitary language.
but in my case, i generated project by using vs2013->Qt5 project->Qt Application.
so i don't have ".pro" file or qmake.exe file.
but when i search about the method to use linguist tool, all of them says i have to use .pro file.
Is there any ways to use qt linguist tool without .pro file?
(I tried to make it by using exe file in QT 5.7.0, but it has failed to complie. )
if it is impossible, how can i create ".pro" file in current project?
please share your ideas!
A Qt project file is not necessary. You can load your .ts files into Linguist, either from the File/Open menu item or as command-line arguments.
You'll want to run lupdate first, to generate initial TS files. It's normally sufficient to pass your source directory as argument:
lupdate -recursive '.' -ts MyApp_en_US.ts
That will generate an empty translations file for US English which can now be edited in Linguist.
You can generate the QM compiled translations interactively from Linguist's menu; I prefer to produce it as part of my projects' build with a simple Make rule that invokes qrelease.

seticon is not working

I have develop a file browser in Qt/C++. I'm displaying the files and folders but I want to add an icons if it's a files or a folders.
I have used :
item->setIcon(0,*(new QIcon(":images/file.jpg")));
But nothing is displayed. I have add the file into the project, it appears in the "Other Files"/"images" folder of the project.
Do I need to declare the file in other location and how ?
Thanks
Are you developing with Qt Creator?
I think there are 2 approachs to solve this problem:
1) Try to load the file as new QIcon("qrc:/images/file.jpg"); Maybe there is a problem loading from the resources.
2) Try to change the jpg to a png file as vahancho said (jpeg library must be attached to the project to support jpeg in qt) - Jpeg qt plugin
Regards.

Qt - How to build a standalone app with OpenCV and Qt

I was able to connect Qtwith OpenCV and the my application is working properly. But now would like that my .exe file does not have any dependencies with .dll files. I would like be able to use my application in another computer without concerns.
I tried to search in several forums but i didn´t find any solution to my problem.
Adding CONFIG += static to my .pro file is enough??
You need to add the CONFIG += static indeed, besides that you need to create a static build of OpenCV, Qt, and statically link it all into an exe.
I shared my setup here.
Just clone the repo and follow the instructions :)
check out bin2h. it can convert your dll file to a header file that you import into your project. you can then write out to file the generated header and then dynamically link it to your executable

Opening Qt c++ project

I got a c++ gui project, but I only have .exe and .dll files. Is it possible to use Qt to modify this project? I suppose I'll need to get the .cpp and .h files in order to modify the project. Am I right? Thank you.
You need source files, i.e., .cpp and .h files to modify the project. You cannot directly modify executables or DLLs using Qt.
Is it possible to use Qt to modify this project?
Qt is a GUI framework, or C++ GUI library, not an IDE or editor. You can't use Qt to modify something.
You can do the following things with any IDE or editor:
modify the project configuration file .pro to change project
settings.
modify the use interface file .ui(with Qt designer for
convenience) to change UI.
modify the source file .cpp .h to change the logic of your
program.
with only .exe and .dll, you can add source file with code
directly accessing .dll with Windows API.