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 item in QComboBox is still interactive
Forum Updated to NodeBB v4.3 + New Features

Disabled item in QComboBox is still interactive

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

    Hello

    I used an item model to make one of the entries in my drop-down list disabled (grayed out).

    So now the entry can not be selected, but it can still be clicked, and there is still a highlight when hovering over the item with the mouse. The only difference is an adjacent item will be selected when clicked.

    How could I make sure the disabled item is not interactive and does not respond to clicks or to mouse move events ?

    Should I have my own QListView, with overriden mouse events, and set it as the view to the combo box ? Will the combo box still look and behave properly if I pass it a QListView instance ? How do i allocate it so the QComboBox can delete it properly ?

    Thank you,
    Adrian Vasile Constantin

    Christian EhrlicherC 1 Reply Last reply
    0
    • T Toughy

      Hello

      I used an item model to make one of the entries in my drop-down list disabled (grayed out).

      So now the entry can not be selected, but it can still be clicked, and there is still a highlight when hovering over the item with the mouse. The only difference is an adjacent item will be selected when clicked.

      How could I make sure the disabled item is not interactive and does not respond to clicks or to mouse move events ?

      Should I have my own QListView, with overriden mouse events, and set it as the view to the combo box ? Will the combo box still look and behave properly if I pass it a QListView instance ? How do i allocate it so the QComboBox can delete it properly ?

      Thank you,
      Adrian Vasile Constantin

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Can you please at least tell what exact Qt version you're using and how you disabled it? Best would be a small codepiece so we can see what you're really doing and can reproduce it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2

      • Login

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