Qt Forum

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

    [Solved] Preventing keyboard focus going to QWidget::createWindowContainer widgets

    General and Desktop
    2
    3
    2516
    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.
    • S
      Sushisource last edited by

      I realize this is 5.1+ so if there's a better place to ask this, please let me know.

      I've tried
      @container->setFocusPolicy(Qt::NoFocus);@

      I've tried (where parent has the keyboard behavior I want)
      @container->installEventFilter(parent);@

      And even (where view is the QQuickView being embedded by createWindowContainer)
      @view->setKeyboardGrabEnabled(false);@

      But it still hogs focus. Any ideas?

      1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators last edited by

        you could try to reimplement "QWidget::focusNextPrevChild()":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#focusNextPrevChild and simply return true.
        But i'm not sure if it will help you in this case.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 0
        • S
          Sushisource last edited by

          Postmortem:
          I fixed this by installing an eventfilter

          1 Reply Last reply Reply Quote 0
          • First post
            Last post