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. How is proper way to set qwidget visible inside other widget.
QtWS25 Last Chance

How is proper way to set qwidget visible inside other widget.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 885 Views
  • 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.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by Q139
    #1

    How is proper way to set qwidget from seperate ui designer file to inside main widget without creating window borders?
    Would it be needed to call show(); , set geomery and set window without borders or there are easyer ways to do same?

    How to trigger close of this widget if mouse hovers away from it?

    jsulmJ 1 Reply Last reply
    0
    • Q Q139

      How is proper way to set qwidget from seperate ui designer file to inside main widget without creating window borders?
      Would it be needed to call show(); , set geomery and set window without borders or there are easyer ways to do same?

      How to trigger close of this widget if mouse hovers away from it?

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

      @Q139 Window borders? Window borders are only shown for windows, not for widgets which are embedded in other widgets. Just create an instance of that widget, pass the parent widget as parent to the constructor and call show().

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

      1 Reply Last reply
      4
      • Q Offline
        Q Offline
        Q139
        wrote on last edited by
        #3

        Thanks , it worked via setParent(this);
        What classs to use to implement it to close it if mouse hovers away also?

        jsulmJ 1 Reply Last reply
        0
        • Q Q139

          Thanks , it worked via setParent(this);
          What classs to use to implement it to close it if mouse hovers away also?

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

          @Q139 If you just want to hide use http://doc.qt.io/qt-5/qwidget.html#hide
          See http://doc.qt.io/qt-5/qwidget.html#leaveEvent for closing when mouse leaves the widget.

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

          1 Reply Last reply
          2

          • Login

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