Trouble getting my widget to display an ENC

1023
5
Jump to solution
03-13-2019 08:39 AM
StephenBrinson
New Contributor II

I followed the example found in this thread and compared it with every other example of ENCs in ArcGIS I could find, which wasn't very many, but my widget doesn't ever display the charts.  At this point I've simplified it down to exactly the code from that example with one exception, which is that I'm not displaying it in the centralWidget.  It's one of two display widgets on the main window, the other being a QOpenGLWidget.  I have the S-57 format ENCs in the right place, I have the hydrography folder from the site, a SENC file gets generated and I get the output line that says "Loaded all maps".  I suspect there's another setup step along the way I'm not aware of.  Is there any reason that code wouldn't work for a QWidget promoted to my class on the main window?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

This should work. I modified a BuildLegend sample that uses multiple widgets to display the ENC Layer in one of them, and it works there. 

As for the Visual Studio vs Qt Creator concern, we design our samples to use qmake and Qt Creator. However, we have customers using our API with cmake and Visual Studio as well. It's just that we set things up out of the box to work with qmake and Qt Creator - if you wish to use another workflow, you have that option and everything should work.

View solution in original post

0 Kudos
5 Replies
LucasDanzinger
Esri Frequent Contributor

Here's a simple widgets example (attached). What you describe should work. Maybe the example can help you identify differences in the code/project?

0 Kudos
StephenBrinson
New Contributor II

Thanks for your reply.  That example works, but it's not what I'm looking for.  That code, like the sample code I used, assumes you want your chart to be the central widget on the main window.  I need it to exist in a smaller widget alongside other things on the central widget.  I think that's the part I'm having trouble with.  Another concern I have is that all these samples are built in Qt Creator and our project is in Visual Studio, so there may be some generated code that I'm not getting.  For example I see a .pri file that isn't explained anywhere.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

This should work. I modified a BuildLegend sample that uses multiple widgets to display the ENC Layer in one of them, and it works there. 

As for the Visual Studio vs Qt Creator concern, we design our samples to use qmake and Qt Creator. However, we have customers using our API with cmake and Visual Studio as well. It's just that we set things up out of the box to work with qmake and Qt Creator - if you wish to use another workflow, you have that option and everything should work.

0 Kudos
StephenBrinson
New Contributor II

Also not exactly what I needed, but your examples did clue me in to a couple of things I had missed.  In the end I got it to work the way I wanted.  Thanks a lot for your help!

0 Kudos
AyushiKamboj
New Contributor II

I want this in QT Quick QML 

0 Kudos