Load Resources in AuboCaps Guide
1. Plugin-Load-Resource via qrc
Open a plugin project in Qt Creator and navigate to -> New File or Project
in the top left corner
In the wizard that appears, select Qt
-> Qt Resource File
Specify the name and location for the [resource] file, then click [Next]
Choose the items to add and click [Finish]
Select [Add Prefix] and set your desired prefix (e.g., /)
Then select [Add File] and add the necessary images. Save with [Ctrl+S].
In the CMakeLists.txt
file, add the [qrc] resource file
add_library(loadqrc SHARED ${_srcs} ${program_src} ${install_src} src/activator.cpp src/resource.qrc)
Re-run CMake and rebuild the project to see the added resource images
Adding a Label Control to the installation node UI to display images on the installation node interface
Add a Label control in install_node_view.cpp
within the red box as per the plugin user manual
QPixmap px;
px.load(":/resources/red.png");
ui->lbl_test->setPixmap(px);
Package the current project according to the plugin manual aubo_plus / template · GitLab (aubo-robotics.cn) load it into the scope , and view the displayed images
Managing resource files
./src
|
+--installation(installation node source code)
|
+--program(program node source code)
|
+--resources(resource folder for storing images, with image names)
|
+-activator.cpp
|
+-resource.qrc(qrc resource file)
2.Modifying the Program Node's LOGO
To change the logo of the program node as shown below, add the plugin using the default logo icon in the program node
1.Select the resource management file resource.qrc
, right-click to add existing files , and load the logo icon into resource.qrc
2.Modify the path location of the logo in program_node_service.cpp
3.Change the logo path in theresource.qrc
file within the program
4.Package the current project with ./deploy
load it into aubo_scope, and view the program node's logo
3.Displaying User Company LOGO on Installation Node
The process of operation and modifying the program node's LOGO is similar except for the second step (modifying the logo icon's path in installation_node_service.cpp ), with the rest being essentially the same.