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. QComboBox::showpopup stealing focus completely
Forum Updated to NodeBB v4.3 + New Features

QComboBox::showpopup stealing focus completely

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 425 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.
  • T Offline
    T Offline
    tataeress
    wrote on last edited by tataeress
    #1

    Hi,
    I've been trying to reimplement showPopup in order for me to force it not to steal the mouseEvents completely from the other widgets, whenever the popup is open
    (cause I need some of the widgets to receive the events even when the popup is still open)

    However I don't know if I should be going this route

    For info, I tried overriding QListView / QComboBox mouse press/release/move events but without success

    I hope someone could provide me with some guidance, cause I don't think its really doable to just reimplement the private stuff with the PIMPL idiom and whatnot

    JonBJ 1 Reply Last reply
    0
    • T tataeress

      Hi,
      I've been trying to reimplement showPopup in order for me to force it not to steal the mouseEvents completely from the other widgets, whenever the popup is open
      (cause I need some of the widgets to receive the events even when the popup is still open)

      However I don't know if I should be going this route

      For info, I tried overriding QListView / QComboBox mouse press/release/move events but without success

      I hope someone could provide me with some guidance, cause I don't think its really doable to just reimplement the private stuff with the PIMPL idiom and whatnot

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

      @tataeress
      What "other widget (mouse?) events" do you need to receive when showing the popup of a combobox? I would rather work with how it functions, which seems standard for the windowing system.

      T 1 Reply Last reply
      0
      • JonBJ JonB

        @tataeress
        What "other widget (mouse?) events" do you need to receive when showing the popup of a combobox? I would rather work with how it functions, which seems standard for the windowing system.

        T Offline
        T Offline
        tataeress
        wrote on last edited by tataeress
        #3

        @JonB well, hovering (so MouseMove) and mousePress are the only ones I care about.
        But wait, actually being able to move the listview/popup a bit upper than it is originially without having part of it clipped could solve my issue, if that's a possibility

        JonBJ 1 Reply Last reply
        0
        • T tataeress

          @JonB well, hovering (so MouseMove) and mousePress are the only ones I care about.
          But wait, actually being able to move the listview/popup a bit upper than it is originially without having part of it clipped could solve my issue, if that's a possibility

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

          @tataeress
          Maybe start by explaining what you are trying to achieve and why you want to do this at all? A QComboBox shows its popup, makes user interact and behaves fine in the first place. What are trying to alter from default behaviour?

          T 1 Reply Last reply
          0
          • JonBJ JonB

            @tataeress
            Maybe start by explaining what you are trying to achieve and why you want to do this at all? A QComboBox shows its popup, makes user interact and behaves fine in the first place. What are trying to alter from default behaviour?

            T Offline
            T Offline
            tataeress
            wrote on last edited by tataeress
            #5

            @JonB
            My objective was having a custom dropdown that has a starting position from the center of the QComboBox
            I thought originally there is no way to move the dropdown anywhere (I was trying that by moving the QListView since I didn't know there was a frame I could move)
            So my workaround was : instanciating 2 custom dropdowns and positionning em to look like one dropdown and just connecting the slots etc..

            However, it seems that overriding the showPopup to let both popups the original one and the copy which is placed on top of the combobox receive events was somehow impossible because I don't understand how that method blocks/let the mouse events pass here or there.

            However, now since I was able to move the original dropdown by finding the frame on the QComboBox and moving it, there is no need anymore for this workaround and I reached my objective

            Thank you for triggering my brain to rethink about a thread I passed by in stackoverflow which showed the trick to move the dropdown simply without getting it clipped.
            link for anyone who needs it : https://stackoverflow.com/questions/10057140/how-to-make-qcombobox-popup-upwards

            1 Reply Last reply
            0
            • T tataeress has marked this topic as solved on

            • Login

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