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. Display problem
Forum Updated to NodeBB v4.3 + New Features

Display problem

Scheduled Pinned Locked Moved Game Development
6 Posts 2 Posters 3.4k Views 1 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.
  • X Offline
    X Offline
    x4rkz
    wrote on last edited by
    #1

    Hello,

    I'm developping a game with Qt + Sfml, and I encountered a problem conerning the display, the screen flashes when these attributs are not setted:
    @
    canvas->setAttribute(Qt::WA_PaintOnScreen);
    canvas->setAttribute(Qt::WA_OpaquePaintEvent);@

    But when I set them, there'se no problem conerning the blink.

    When I display a window in the middle of the sfml widget, there's no problem, but when I hide it and show an other, I see the new window opened with the old window in background, it's like these attributes dont clear the background when a window is hidden.

    I don't know how to solve this problem, could you help me ?

    Thanks for my english.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      baysmith
      wrote on last edited by
      #2

      Only top-level Qt widgets have an associated native window. Child widgets don't draw a background because they assume their top-level parent widget will do so. For those widgets to be shown over a sfml widget, try forcing them to have a native window using:

      @
      setAttribute(Qt::WA_NativeWindow);
      @

      Nokia Certified Qt Specialist.

      1 Reply Last reply
      0
      • X Offline
        X Offline
        x4rkz
        wrote on last edited by
        #3

        A variable menuGame contain the canvas (sfml screen) and others widgets that are displaying above the canvas, I set this attribute to the global widget menuGame and the child widget both before and after but it doesnt change nothing.

        By the way thanks for your fast answer.

        1 Reply Last reply
        0
        • X Offline
          X Offline
          x4rkz
          wrote on last edited by
          #4

          Does anyone has an idea about this subject ? Maybe why Bradley's solution doesnt work or have an other one ?

          1 Reply Last reply
          0
          • X Offline
            X Offline
            x4rkz
            wrote on last edited by
            #5

            nobody knows ?

            1 Reply Last reply
            0
            • X Offline
              X Offline
              x4rkz
              wrote on last edited by
              #6

              I doesn't know if anyone already had the same problem, or if the major part of you didn't get the point, or if it's because nobody had this problem and can't solve it.

              I feel quiet alone here x).

              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