Please nominate your Qt Champions for 2021!

Creating a border on QOpenGLWidget

  • Hello all,

    I am new to QT and I am currently learning the library.

    I have an openGL widget on my application and I was wondering if there is any way to place a boarder around my canvas?

    The background of the canvas is white, the same background as my main window. I just need something to go around the canvas to have it stand out from the main window.

  • Lifetime Qt Champion

    QFrame provides frames. Just set its property.
    Are you using UI files?
    If yes, place QFrame on form.
    Place OpenGl widget in side QFrame
    Right click QFrame (in free area), choose a layout.
    Then the openGL widget has a frame.

Log in to reply