render a gvc (graohviz) from c++ console application / or qt gui application -


i writing programme can generate dot desctiption file directly on screen.

i got following code graphviz.org on how use library , works

int main(int argc, char *argv[]) {     agraph_t* g;     gvc_t* gvc;     gvc = gvcontext(); /* library function */      file* fl;     file* ot;      ot = fopen("/home/test.png", "w");     fl = fopen("/home/my.gv", "r");     g = agread(fl,0);     gvlayout (gvc, g, "dot"); /* library function */     gvrender(gvc, g,"png", ot);     gvfreelayout(gvc, g); /* library function */     agclose (g); /* library function */         return (gvfreecontext(gvc)); } 

when run qt console application project, gives

press <return> close window... 

i can see generate test.png file. thinking there must way can show gvc directly without opening png file, right?

because writing gui application scratch seems awesomely bad idea, how using external program achieve this?

you can launch within generating program if insist:

    system("feh -dr1 test.png"); 

Comments

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -