I think there is a bug related to the error in the title. I found there is still unanswered post here
It happens when I compile my extension in Linux (windows users don’t have this problem). I found out that in the source file that caused this error there is this line:
and replacing it with this line solved the problem:
It would be nice to fix this error in slicer source as I don’t know how.
I couldn’t find this lower case include in the current Slicer code. If you’re using an old Slicer, please update to the latest (or at least 4.8.1 if you don’t want the nightly for some reason).
my Slicer-build is the stable one 4.8.1. Do you think maybe the extension template is old?
Sorry but I cannot any mention of the combobox in the template.
Can you please describe what you want to do in more detail?
It is strange that I found it in the extension source code and it was correct.
In my extension there is Resources/UI/ qSlicerBrhoomModuleWidget.ui
In this file there are these lines:
<layout class="QVBoxLayout" name="verticalLayout">
<widget class="ctkCollapsibleButton" name="CTKCollapsibleButton" native="true">
<widget class="qMRMLNodeComboBox" name="MRMLNodeComboBox_Model">
This is the only place I found it and it is correct. I think is related to the use of qt wrapping and cmake in slicer as the file ui_qSlicerBrhoomModuleWidget.h is generated after the build in the build folder and generates the mentioned error in my case.
Yes it seems to be correct. If you do a clean build (delete binary folder, CMake, build), does the same error occur?
Yes, the error happens with clean build as well. I also tested it in different Linux machines with different Slicer-build versions.
Have you added the combobox using Qt designer or by manually editing the file in a text editor? If you use custom widgets then you have to add special declarations for them in the .ui file (Qt designer adds those automatically).
It was added manually.
What are these declaration?
I tried to use the designer but I am not sure how to add the ctk and mrml libs to qt designer. I tried this
In order to have the CTK and MRML widgets in Qt Designer, Qt Designer offers 2 options:
- the first (not detailed here) is to copy (or symlink) the CTK and MRML plugin libraries into %QT_DIR%/plugins/designer,
- the second is to set the environment variable QT_PLUGIN_PATH to the directory Slicer-build/bin containing the subdirectory designer with the plugin libraries. Note: Qt requires that the directory containing the designer plugins is named “designer”.
Which files I need to copy? I run
~/SlicerDev-4.8.1/build/Slicer -- designer
but still I can't see the ctk or mrml widgets
I don’t think you need to export any environment variables. Just running
./Slicer --designer (note there is no space before --) should work. What operating system do you use?
I am using Ubuntu, with no space I get an error bash: ./Slicer–designer: No such file or directory
with space, the designer is opened but I don’t see the widgets. I checked in designer:
there are paths to my SlicerDev4.8.1/build/CTK-build/bin/designer/lib …
I’m not sure why --designer is not available on Ubuntu, but it is just a convenience function and it is equivalent to
./Slicer --launch full/path/to/designer
I had multiple Qt in my system so I think this is was the problem. I removed all the current Qt installed. Then:
sudo apt install qt4-dev-tools
sudo apt install qt4-qtconfig
sudo apt install libqtwebkit-dev
After that I rebuilt Slicer, redesigned the ui using ./Slicer --designer then rebuilt the extension. No more errors.
So this is still alive in some extensions in 2021.
/home/zolal/Slicerbuild/SlicerDRRGenerator-build/DRRGeneratorModule/ui_qSlicerDRRGeneratorModuleModuleWidget.h:22:10: fatal error: qmrmlnodecombobox.h: No such file or directory
22 | #include <qmrmlnodecombobox.h>
Solved by replacing with qMRMLNodeComboBox.h