User interface compiler Qt - c++

i have created a UI with the Qt Designer, i want to integrate it into my cpp program now.
I have to convert the main_window.ui to a header file?
Supposedly it should be a possibility via the Designer Form->View Code to give a cpp code to this class which I can copy directly into a header file?
Unfortunately I get the error message : Unable to launch C:/Program Files(x86)/Qt Designer/bin/uic.
Under my path exesterit no folder structure /bin ?
I can't find a download for the user interface compiler either ?
Is there a simple solution? Or where is my mistake?

Most of the time you don't need to call uic manually: just add the .ui files to your .pro files as "FORMS", and qmake will take care of the rest. See for example: https://doc.qt.io/qt-5/qmake-variable-reference.html#forms and https://doc.qt.io/qt-5/designer-using-a-ui-file.html

Related

How to replace the source file with my own source file (from download or edit) in Xcode?

I'm using Xcode as an IDLE editor of C language. I downloaded an SDK package from a algorithm competition website and compiled it successfully on the terminal, but now I have a need to compile and run the source .cpp file(that inside the SDK packadge) directly by Xcode, so:
Is there a way to replace the CPP source file of command-line-tools project with the CPP source file that I specify the path of it?
Or is there a way to creat a new command-line-tools project from the specified path CPP source file?
I've now Solved this problem through the method one whitch says "Is there a way to replace the CPP source file of command-line-tools project with the CPP source file that I specify the path of it?", but still have no idea about method two.
Just creat a symbolink of CPP source file and right-click the project, add the alias to project. Because the "add" is copy in fact, instead of "import" or "open". Only by copying the alias can the purpose of modifying the source file be achieved.

How do I #include plugin source files in my custom Unreal Engine module?

I'm working with a C++ Unreal Engine project and made my own custom module called MyActor, Unreal Engine automatically created the .cpp and .h files for me. That much appears to be working.
So now I want to include classes or methods from the AppleARKit plugin then override and call them from my custom MyActor module.
First I tried using #include AppleARKitLiveLinkSourceFactory.h because it has theIARKitBlendShapePublisher::PublishBlendshapes method which I want to modify and use.
It didn't work at first with this error: E1696 Cannot open source file AppleARKitLiveLinkSourceFactory.h but I found out I could include them in Visual Studio using the "Include Directories" under Properties like this:
The AppleARKitLiveLinkSourceFactory.h lives in the Public folder but I included the Private folder as well, I don't know if I need to do that. This appeared to work at first but then I got the same error as before for every dependency inside the AppleARKitLiveLinkSourceFactory.h file.
Do I have to include the individual directories for every dependency down the entire chain? Is there an easier way?
When I ran into the issue of including files from a plugin, in my case LidarPointCloud, the following steps worked for me:
1) In my <project-name>.Build.cs file, I added the module name I wished to use (LidarPointCloudRuntime) to the public dependency list
PublicDependencyModuleNames.AddRange(new string[] { "LidarPointCloudRuntime", "Core", "CoreUObject", "Engine", "InputCore" });
I determined the module name by opening the .uplugin file in the plugin's folder, and looked at the Modules section. If multiple module names are listed, you should pick the one that contains the source for the classes you care about.
2) I then rebuilt the project, closed my editor, then right clicked my <project-name>.uproject file and regenerated project files.
After that, I was able to access the .h files in my code.
-Update-
It seems that AppleARKitFaceSupport has dependencies on other plugins that may need to be included. For example, ARSystems.h lives in AugmentedReality. When I add that to PublicDependencyModuleNames and perform the same steps, it can find ARSystem.h.

How to place header and ui file in different folders using autouic in cmake

According to the documentation, regarding autouic:
If a preprocessor #include directive is found which matches ui_.h, and a .ui file exists, then uic will be executed to generate the appropriate file.
But what if the .ui file is in another folder? I currently get the following error when trying to build:
AUTOUIC : error : process for ui_module.h failed:
File 'C:/app/source/headers/module.ui' is not valid
The ui file is actually located here:
C:/app/source/forms/module.ui
I've tried to add the C:/app/source/forms/ to the include_directories()-macro without success. Any ideas?
Issue mentioned in this answer is now resolved.
This worked in CMake v3.9.0-rc6:
set(CMAKE_AUTOUIC_SEARCH_PATHS your/folder/here)
See documentation of AUTOUIC_SEARCH_PATHS.
Update
A search path, CMAKE_AUTOUIC_SEARCH_PATHS, has been added to CMake
version 3.9.
After further investigation, it seems like it's not possible to do. There is an open issue in their tracking system, but it is so far not implemented:
Add Search path for AUTOUIC

How do I create multipul Forms / .ui in qt?

I'm new to qt so this may be a basic question. I want to create multipul ui pages but I don't really know how to do it. I've gone Add New -> C++ Class -> include QWidget. Although this creates new source and header files, it does not create and additional .ui file. I've tried building and running QMake but that hasn't helped. I've also tried adding temperature.ui to the forms section of the .pro files but that just gives me the
":-1: error: No rule to make target 'temperature.ui', needed by 'ui_temperature.h'. Stop." error. Any suggestions? Many thanks
One thing is a C++ Class and another thing is a Qt class. The first one has a *.cpp and a *.h and the second one has, in addition, a *.ui file which contains the ui made with Qt designer.
So that, you need to Add a Designer Form Class instead of a C++ class

Errors while porting cocos2d-x project to android

I have successfully run the "Step by Step Coos2dxSimpleGame Series" (http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials) in windows using visual c++. Now I want to port this project to an android device, Hence I copied the classes namely HelloWorld,AppDelegate and GameOverScene and their header files to Classes folder and the resources to /Resources folder. Then I have modified the android.mk file to include a new class called GameOverScene.cpp which is not present before .
Then I run ./build_native.sh . The error message is here (http://www.cocos2d-x.org/attachments/1152/native_error.PNG) .
Is the process I am following correct?
In HelloWorldScene.h, change:
HelloWorld::~HelloWorld();
HelloWorld::HelloWorld();
to:
~HelloWorld();
HelloWorld();`
You must not add the class name in your declarations in header files (but you have to do it in your cpp file).
One thing that I can suggest You is to follow step by step this tutorial
http://magicscrollsofcode.blogspot.com/2011/09/quick-and-dirty-guide-to-getting.html
and also don't forget about this:
http://www.cocos2d-x.org/boards/6/topics/8572?r=8577#message-8577 afterwards
these two things helped me a lot one time :)