GUI Rendering from Text
-
wrote on 12 Sept 2011, 05:39 last edited by
I have a text file which specifies all the GUI components, along with its title and names.
I need to parse the text file and render it using Qt.
Presently, I have only parsed it using 'yacc and lex' ...
Is there any other modules in Qt which offers the same functionality!!?
How can I do it best and efficiently!!?
Please Help...
Thank you....
-
wrote on 12 Sept 2011, 07:40 last edited by
Three things come to mind: QUiLoader and QML, and of course HTML. All work on text-like formats, but all have their own format. What is your ultimate goal? Do you have control over the format of the files that you need to "parse"?
-
wrote on 12 Sept 2011, 07:58 last edited by
No, I cant change the format. Can I convert the 'text format' that I have to the XML format required by Qt..?? How can I do that?
-
wrote on 12 Sept 2011, 08:29 last edited by
qlalr is used for parsing in a lot of places inside Qt and related tools. That is hardly documented though and require a lot of understanding of parser theory.
The sources are part of Qt itself IIRC.
-
wrote on 12 Sept 2011, 08:43 last edited by
It qlalr used for converting my format to xml!!?
Also how good it is to use the classic yacc and lex?
-
wrote on 12 Sept 2011, 09:27 last edited by
qlalr is a parser generator, thus is basically a tool like yacc.
-
wrote on 13 Sept 2011, 11:20 last edited by
What do I have to do if I have to convert the text file ( the present format) to the required XML(.ui format)
Awaiting your reply...
-
wrote on 13 Sept 2011, 11:27 last edited by
Well... you could start by creating a form in designer that contains the types of widgets you are going to have to support, and study its structure. Or... you could just parse the file yourself and create the requried widgets from code directly. I have no idea what would be easier in your case, as you did not tell us anything about your file format and requirements.
-
wrote on 13 Sept 2011, 11:46 last edited by
Thanks for the Reply
Well., the format is simple... There is a hierarchy... Parent Widgets and child widgets... Each widget is described by the basic characteristics like label,rect coordinates, font(for texts) etc...!!
And also.., How feasible it is to use the generated yyparse() in my source code!!?
-
wrote on 14 Sept 2011, 06:17 last edited by
To parse the file myself, what tools does Qt offer.., I can use regular expressions for labels.., but what about the yacc equivalent!!? :-o
-
wrote on 14 Sept 2011, 08:46 last edited by
Hi..,
I have a parser written using both lex and yacc.. I m happy to see these 'tags' available... But I m not sure how to use it..
Can someone please explain how i can go about using it!!?Thanks!
-
wrote on 14 Sept 2011, 09:06 last edited by
Can you elaborate a bit, how this is related to Qt?
[Edit: Context was not clear prior to merge ] -
wrote on 14 Sept 2011, 09:41 last edited by
Well., I wanted to render a GUI which described in a text file. For which I had to write a parser and link the structure with my UI toolkit(Qt)
At present, I have the parser files(yacc and lex) but I m not sure how I ll make it work...
I came across a useful link, but culd really make much out of what was written
http://www.qtcentre.org/archive/index.php/t-3557.html
http://www.freehackers.org/thomas/2009/11/22/how-to-use-flex-and-bison-with-qmake-my-own-way/
-
wrote on 14 Sept 2011, 09:47 last edited by
I have merged your topics on the same issue. Please use a single topic for a single issue.
1/14