Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    General and Desktop
    2
    4
    680
    Loading More Posts
    • 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
      Q139 last edited by 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?

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Q139 last edited by

        @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 Reply Quote 4
        • Q
          Q139 last edited by

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

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Q139 last edited by

            @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 Reply Quote 2
            • First post
              Last post