Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    GUI Rendering from Text

    General and Desktop
    4
    14
    3794
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vijaeendra 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....

      1 Reply Last reply Reply Quote 0
      • A
        andre 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"?

        1 Reply Last reply Reply Quote 0
        • V
          Vijaeendra 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?

          1 Reply Last reply Reply Quote 0
          • T
            tobias.hunger 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.

            1 Reply Last reply Reply Quote 0
            • V
              Vijaeendra last edited by

              It qlalr used for converting my format to xml!!?

              Also how good it is to use the classic yacc and lex?

              1 Reply Last reply Reply Quote 0
              • T
                tobias.hunger last edited by

                qlalr is a parser generator, thus is basically a tool like yacc.

                1 Reply Last reply Reply Quote 0
                • V
                  Vijaeendra 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...

                  1 Reply Last reply Reply Quote 0
                  • A
                    andre 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.

                    1 Reply Last reply Reply Quote 0
                    • V
                      Vijaeendra 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!!?

                      1 Reply Last reply Reply Quote 0
                      • V
                        Vijaeendra 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

                        1 Reply Last reply Reply Quote 0
                        • V
                          Vijaeendra 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!

                          1 Reply Last reply Reply Quote 0
                          • K
                            koahnig last edited by

                            Can you elaborate a bit, how this is related to Qt?
                            [Edit: Context was not clear prior to merge ]

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply Reply Quote 0
                            • V
                              Vijaeendra 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/

                              1 Reply Last reply Reply Quote 0
                              • A
                                andre last edited by

                                I have merged your topics on the same issue. Please use a single topic for a single issue.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post