Reputation: 1783
I have a script that I'm using to compile a Qt based graphics library, called tulip. Just FYI, you can also download a tulip distribution from their sourceforge here. You can then look around insidefor /Applications/Tulip 4.5/Contents/lib and /Applications/Tulip 4.5/lib/python, which each of DYLD_LIBRARY_PATH and PYTHONPATH respectively should be set to. If you did that you could then skip to running the minimal code example
You can easily download it and run it to compile tulip against arbitrary versions of qt, (the script fails only on Qt5.1.0 and probably earlier, I think it's a -std=c++11 kind of thing). Just make sure you have Qt installed. You'll probably need to change the prefix to what you need it to be, and you need python3.4, but other than that it's easy to make it work (if you get any errors, I will figure out what's wrong, so don't hesitate to report).
The following minimal set of actions exactly reproduces the problem that I'm having (once you get tulip itself compiled):
>>> from tulip import *
>>> from tulipgui import *
loadPlugins info: /Users/kennethadammiller/Library/Application Support/Python/plugins//lib/tulip/ - No such file or directory
>>> g = tlp.newGraph()
>>> n = g.addNode()
>>> view = tlpgui.createNodeLinkDiagramView(g)
When you view the result, you should get something like below:
.
The problem is, why will it only use the lower left quadrant of the Gl view? How do I get it to use all of it? As you can see in the photo, the node (which in this case is supposed to be a circle, is being cut off at exactly half the width and height of the containing window; I really want the whole window. In contrast, I've built this exact same setup on my linux vm, and it simply doesn't give me any of this trouble.
Edit 1: I just confirmed that this isn't caused by the Debug cmake flag. I recompiled and it still is occurring.
Edit 2: I just singled out that compiling using qt 4.8.5 eliminates this error completely. So it's a difference between Qt 4.8.5 and qt version > 5 that is causing this.
Upvotes: 1
Views: 102
Reputation: 1783
Actually I found out that it was due to the different screen resolution that the new mac provide with retina. Between 4.8 and 5.2, qt added support for that resolution in their library, which means that code that mentions pixels has to be rethought; certain arguments now only interpret pixels to be half a large, so the lower left half was the qt system rendering 1/2 by 1/2.
I submitted a patch for that one view that tulip provides that fixes the Node Link Diagram view.
Upvotes: 1