Qt Forum

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

    Problem with renderText function in QGLWidget class

    General and Desktop
    3
    4
    5234
    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.
    • D
      durgeshK last edited by

      I have sub classed QGLWidget in my application and have to annotate my 3D drawing with dimensions. For this i am trying to use renderText() in my application, but the problem i am facing here is that i am unable to render more than one text.

      For example:
      @QString text1 = "Tom n Jerry";
      QString text2 = "Harry Potter";
      renderText(1,1,1,text1);
      renderText(1,0.5,1,text2);@

      When i run it, it just displays "Tom n Jerry", i.e., only the first text. Any solutions?

      1 Reply Last reply Reply Quote 0
      • F
        Franzk last edited by

        QGLWidget::renderText is buggy and considered obsolete. Use overpainting as its documentation suggests.

        "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • B
          baysmith last edited by

          Another way is using a QPainter to draw to a texture which is displayed with quads. This is the approach I use in MIFit. You can see the code here:

          http://gitorious.org/mifit/mifit/blobs/master/libs/opengl/Text.h
          http://gitorious.org/mifit/mifit/blobs/master/libs/opengl/Text.cpp

          Nokia Certified Qt Specialist.

          1 Reply Last reply Reply Quote 0
          • D
            durgeshK last edited by

            Thanks Guys, i think i will better use bitmap procedure. renderText is too hard to handle and its rotation is another headache.

            Anyways do you guys have any idea about implementing Drag and Drop feature in openGL application.

            Thanks & Regards
            durgeshK

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