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. Disabled but selectable Qlistwidgetitem

Disabled but selectable Qlistwidgetitem

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 9.0k 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.
  • B Offline
    B Offline
    bluekrait
    wrote on last edited by
    #1

    Is there any way that a particular item in qlistwidget can be shown as disabled, but can be highlighted on mouse click.

    I notice that if the flag Qt::ItemIsEnabled is not set for a particular qlistwidgetitem, then it gets disabled. But when it is disabled, nothing else can be done as well meaning that it is not selectable with mouse click either.

    Is there a workaround solution for this ?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      What would be the usecase of having an item appear to be disabled, only to act as enabled? Sounds like you are trying to confuse your users?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bluekrait
        wrote on last edited by
        #3

        What I m trying is something bit more. Following is exactly what I want..... When I click an item in the list, a popup corresponding to that particular item should appear. If the item in the list is disabled and there is a click on it, then there should be a warning message to the user saying that "y this is disabled and what measures to take so as to enable it".

        This is my shot at the problem:
        When I click an item in the list, i print the name of the item clicked to the screen(so that, based on this name, i can create my popup)
        But when i click on a disabled item, it actually prints the previously selected item in the list(Which means, popup corresponding to the previously selected item appears and not the warning message)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Auch... that sounds horrible to use... Are you sure you need popups for that?

          Wouldn't it be much more friendly to use the tooltip to inform the user of what the problem is? And pop-ups on single clicks on list items really don't sound like a good idea to me. Clicking is supposed to mean "make current; select" for such widgets. Throwing a popup in the users face is unfriendly at best.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bluekrait
            wrote on last edited by
            #5

            The thing is that, on invoking each of those items, a new window should popup, which is supposed to take several inputs from the user for that particuar item ... so I cant avoid those popup window.

            1. Thats true.... poppups for single click might be annoying to the user. How about popup window on double click ? would it be a good idea?

            2. You mean to say tooltip(having warning information) for the disabled item? Yes... that seems nice...

            Will try out all of these tomorrow and see how things look. Thanks a lot for your suggestion, Andre.

            Just curious to know if there is an alternate look and feel: Now that you know my requirement, instead of using qlistwidget for doing all these, would u suggest me an alternate idea ?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Why not go for a two-pane approach: the left pane would be the list of items, the right pane would show an editor for the currently selected item. No popups needed. Also, instead of disabling items, you could considder distinguishing them in another way, such as using a different icon for them. That way, you can select them, and the right hand pane could simply show a message with explains what to do to make the item editable.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                If there is only one way to make an item active, a tool tip should be sufficient. The user already see the item being different when disabled.

                Using a two pane display as Andre suggested, seems much more user friendly to me.

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bluekrait
                  wrote on last edited by
                  #8

                  I did try both of them ... 1) Double click & 2) Two-Pane display ...

                  I just felt that popups are bit unique & different than the 2-pane display in terms of its look and feel... meaning that, user can click anywhere outside the popup window to close it automatically. (not required to click on close button). These kind of UI is something which user might not see very often.

                  Thanks a lot for ur ideas Andre and Volker ... anyways, now that I have both of these UI, let me wait and see which one of these to use & go ahead ;)

                  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