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. Moving a widget automatically out of the way of main window?
Forum Updated to NodeBB v4.3 + New Features

Moving a widget automatically out of the way of main window?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 599 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.
  • B Offline
    B Offline
    buon43
    wrote on last edited by
    #1

    I have a Qt Widget created with a class. In my program, I have two windows: a main window and a widget that shows information about the main window in real time. Showing the widget is pretty straightforward:

    otherWindow = new otherWindow //otherWindow is the class of the widget
    otherWindow.show();

    The problem is that the widget appears on top of the main window. This isn't really a problem per se, as the user can just move it out of the way, but is there a way to make the other window appear, say next to the main window rather than on top of it?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      Shouldn't be too hard. You can simply move() the secondary window, e.g. in its showEvent() function. All you need to know is the position and the size of the primary window, of course. But I assume the primary window is the parent of the secondary window, so you can simply use parent() to get a pointer.

      My OpenSource software at: http://muldersoft.com/

      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

      Go visit the coop: http://youtu.be/Jay...

      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