Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Using Qt widgets in OpenGL application

Using Qt widgets in OpenGL application

Scheduled Pinned Locked Moved Unsolved Game Development
4 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • K Offline
    K Offline
    kagami_kuro
    wrote on last edited by
    #1

    Is there a way to use QTextEdit, QPushButton and other widgets and layouts in OpenGL application? For example, if I want styled text field with editable text, selection, copy&paste and a button to process this text in my game. Or should I use low-level features? If so, then from which features should I start? I can render text using QOpenGLTexture, QFontMetrics and QPainter, but instead I'd like to use QLabel.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! If all you need is an overlay with controls over the scene, then you can simply place widgets on top of a QOpenGLWidget. If you somehow want to embed widgets in a 3D scene: no, that's not supported. In this case better use a game engine.

      K 1 Reply Last reply
      1
      • ? A Former User

        Hi! If all you need is an overlay with controls over the scene, then you can simply place widgets on top of a QOpenGLWidget. If you somehow want to embed widgets in a 3D scene: no, that's not supported. In this case better use a game engine.

        K Offline
        K Offline
        kagami_kuro
        wrote on last edited by kagami_kuro
        #3

        @Wieland My hobby for this month is own game engine :) And I think I've found a solution: rich text related classes QTextDocument, QTextLayout, QTextCursor etc. Rich text can be edited programmatically and rendered into texture using QPainter. I can create own text widgets.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jagh
          wrote on last edited by Jagh
          #4

          There are also libraries that you can use in your OpenGL side to implement various UI features,

          CeGUI comes to my mind, but there are others.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved