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. Ignore pushbutton when using focusWidget()
Forum Updated to NodeBB v4.3 + New Features

Ignore pushbutton when using focusWidget()

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k 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.
  • S Offline
    S Offline
    S0nnen
    wrote on last edited by
    #1

    I have several listwidgets filled with items. And everytime you select an item, that item will then be copied to another listwidget.
    Now I can easily do this with a doubleclick. But I would really like to use a button for it. But everytime I then use that button, that button will then become the focussed widget instead of a listwidget. And I need to use focuswidget in order to manage what listwidget the user is currently controlling (or else you can first click on an item in one listwidget then an item in another and then when you click add it will add from both listwidgets (or chrash))
    Any suggestions on how to avoid this is greatly appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      S0nnen
      wrote on last edited by
      #2

      I guess I am doomed then.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mlong
        wrote on last edited by
        #3

        Well, you're only doomed if you are impatient. You posted your question on a Saturday, when a lot of people are not online checking the forums, and it's only Monday now. I'd say it should be reasonable to give people a little more time before jumping in with the doom and gloom. We are all volunteers here who answer questions on our own time.

        In regards to your question, what about if when either of your list widgets obtain focus, they could set a member variable to a specific value to indicate which list has been focused last. Then upon your button press you could query that member variable to determine which listwidget to query.

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          S0nnen
          wrote on last edited by
          #4

          Exactly what I did to overcome my issue. It just seems like such a hassle, since I have a loooot af listWidgets. I believe QT need a previousWidget() function just as it has a previousItem(). But that is just me.
          And yes I will try to be more patient. I just hate it when I get stuck in one of my projects. xD

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mlong
            wrote on last edited by
            #5

            You might also look into maybe some magic with setFocusProxy(). Haven't really thought it through, but there might be something that could be made to work.

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            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