Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is it ok to move QWidget outside screen?

Is it ok to move QWidget outside screen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 643 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.
  • T Offline
    T Offline
    TomNow99
    wrote on last edited by
    #1

    Hi,

    Sometimes I would like to move my QWidget outside the screen for example widget->move(-500,-500). Is is safe and my app will not be crashed? The same question about QPainter and drawText begin at position (-300,-300).

    jsulmJ 1 Reply Last reply
    0
    • T TomNow99

      Hi,

      Sometimes I would like to move my QWidget outside the screen for example widget->move(-500,-500). Is is safe and my app will not be crashed? The same question about QPainter and drawText begin at position (-300,-300).

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @TomNow99 said in Is it ok to move QWidget outside screen?:

      Is is safe and my app will not be crashed?

      You can simply try. But it should not crash because of this. drawText() should also be fine, but I never tested what happens if drawing with negative x/y values.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ollarch
        wrote on last edited by
        #3

        If you want to hide your widget you could simply call hide on that widget.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TomNow99
          wrote on last edited by
          #4

          @jsulm I tried it and my app will not crash. But maybe I don't know about something important.

          @ollarch Sometimes I would like to have a part o QWidget on the screen and the rest outside screen.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            Consider that some graphics drivers may just shove the widget back into visible space.

            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