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. QWidget setGeometry / position has no effect
Forum Updated to NodeBB v4.3 + New Features

QWidget setGeometry / position has no effect

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 560 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.
  • H Offline
    H Offline
    Hardy
    wrote on last edited by
    #1

    Hi,
    i have as simple qt6 hello world programm on raspberry 4 / bookworm with desktop.
    I wanted to have a simple window in the upper left corner of the screen. But what ever i tried, the window is centered on the screen. Also when i use showFullScreen. When i draw a rectangel in paintEvent, the rechtangel is centered. A qDebug output delivered me geometry(0,0,-width-,-high-) what is obviously wrong.
    How can i set the upper left corner of to the window upper left corner of the screen?
    Thanks!
    Greetings,
    Hartwig

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you using Wayland or Xorg ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Are you using Wayland or Xorg ?

        H Offline
        H Offline
        Hardy
        wrote on last edited by
        #3

        @SGaist Honestly i specified nothing specific. A simple hello world from scratch on the (also fresh installed) bookwork plattform. Therefore i assume, that Xorg is used. (How can i be sure?).
        I installed wayland via packetmanager while installing qt but didn't instruct a chain to use it.
        I remote build with CLion from Win11 PC on the raspberry. I don't have qt on windows to verify. I haven't found a way to legally install qt on windows free of charge.

        JonBJ 1 Reply Last reply
        0
        • H Hardy

          @SGaist Honestly i specified nothing specific. A simple hello world from scratch on the (also fresh installed) bookwork plattform. Therefore i assume, that Xorg is used. (How can i be sure?).
          I installed wayland via packetmanager while installing qt but didn't instruct a chain to use it.
          I remote build with CLion from Win11 PC on the raspberry. I don't have qt on windows to verify. I haven't found a way to legally install qt on windows free of charge.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Hardy
          Whether you run Wayland vs Xorg is not a feature of your program, it is the desktop you are running under which is one or the other.

          There are many ways to discover which one you are under (Google how do you know if you are running wayland), open a shell and echo $XDG_SESSION_TYPE. Because the behaviour you describe would be expected from Wayland, it does not allow so much control over its windows as Xorg.

          I don't have qt on windows to verify. I haven't found a way to legally install qt on windows free of charge.

          Don't know what this means, everybody else is running Qt open source/free, Windows or otherwise.

          H 1 Reply Last reply
          1
          • JonBJ JonB

            @Hardy
            Whether you run Wayland vs Xorg is not a feature of your program, it is the desktop you are running under which is one or the other.

            There are many ways to discover which one you are under (Google how do you know if you are running wayland), open a shell and echo $XDG_SESSION_TYPE. Because the behaviour you describe would be expected from Wayland, it does not allow so much control over its windows as Xorg.

            I don't have qt on windows to verify. I haven't found a way to legally install qt on windows free of charge.

            Don't know what this means, everybody else is running Qt open source/free, Windows or otherwise.

            H Offline
            H Offline
            Hardy
            wrote on last edited by
            #5

            @JonB thanks, it was wayland.
            Via paketmanager i removed everything concerning wayland.
            As a result i have now an ugly desktop, but this is only a cosmetical issue. Most important is, that the application has now the expected behaviour.

            Further, with a little search and registration i found the installer for qt on windows. Sorry, but several years ago, round about trolltech times and later, when i remember right until qt4(?), this was much more easyer (to find)...

            1 Reply Last reply
            1

            • Login

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