I'm trying to display some kind of branches with Qt. How do I go about this? Will I have to draw it myself? Is there some control/thing that will do this for me?
(source: hades.name)
You will have to do it yourself, use QGraphicsScene and QGraphicsView.
To layout the graph, you may want to look at GraphViz - a graph visualisation tool.
You could just use the GraphViz algorithms for layout (using plain output) and then draw using the Qt libraries (QGraphicsScene / QGraphicsView like #cbamber85 recommended), or you could render a PNG from GraphViz and then display it.
You may want to look at KCacheGrind, as this is a Qt application that uses GraphViz for laying out call graphs.
Related
before I used Qt and customized my own Widget which is inherits from QGLWidget
i used OpenGl in standard projects and free glut.
by doing this, I used glutBitmapChracter but now in Qt there is no need to manage windows because I created customize widget with gui.
so how can I draw text on the widget?
if I want to include the free glut and use glutBitmapCharacter I nedd also to init the glut and im getting confused?
is there any other way or do I have to use external library?
You are using a QGLWidget and want to draw 2D text on top of the 3D scene?
glutBitmapCharacter should still work in a QGLWidget, just like other GL library code. I do not think you need to call glutInit to use the GLUT character drawing functions.
Or you could use the Qt 2D text drawing methods (QPainter) to draw text on top of your QGLWidget. A Qt book or online documentation will explain how to do this. (I have the books on Qt programming by Blanchette and Summerfield, and can recommend them.)
Hope this helps.
I have tried to search on the internet and here as well, without success though. I am using Qt 4.8.2 and design my app in the Designer, then I write code in VS2010. I would like to show a chart on the application window, e.g. like http://www.infocaptor.com/user_help/help_img/dashboard_line_chart_screen.png , based on some data that are created by the app.
In the Widget Box of the Designer, I can't find any widget related to drawing. So I tried creating a QTextEdit and drawing on that using QPainter. However, this does not work. I can draw on the whole appwindow, but not just on the text edit. So the question is: what widget can be added onto the app window in the designer and that is going to allow me to draw on it using QPainter?
I'm eluded as the documentation says specifically that QPainter can draw on any QWidget which a QTextEdit is...
Any help is much appreciated,
Daniel
The function of "drawing" is tooo complex/unspecific to be included as a specialized widget. You'll have to create it yourself and implement the desired drawing functions.
Here is an example which you can learn from, the scribblearea class could be pretty much what you are looking for. In that case you can copy it to your project and use in in the Qt-Designer by promoting a widget to this class.
I can't find anything about how to embed plotting into Qt by using C++. Which component in Qt should be used for plotting?
I want to grasp the thing generated by these lib and display it using Qt.
I have a working example at this blogpost combining embedded R with Qt. I used both SVG and PNG graphs, though the current version only uses SVG.
The repository is here, if you rewind a commit or two you get the version that flips between SVG and PNG (depending on whether a particular can be loaded).
You should be able to use the logic to show plots from either plplot or matplotlib.
Is there any way drawing lines/curves in flex/fb4 -like pen tool?
Because it is not a practical method drawing with only <s:Line/>'s. Maybe an external tool which lets you draw and get the code for flex/fb4?
I want to draw something in IDE as a part of my application, my application is not going to be a drawing application.
Draw your interface in Illustrator. Run it through catalyst, and make a custom component. Or you can export flash components( swf's so no code ) from Illustrator directly IIRC.
hello im looking for Qt graph widgets that are free
something like qwt.sourceforge.net/
Outside of Qt, there's also MathGL, which is a powerful graphing library as well. It can create images (png, jpg, svg etc...) which can easily be displayd in a Qt widget. You'll of course have to sacrifice the interactivity that Qwt can offer.