Qt Forum

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

    Solved QComboBox: shadow effect of drop-down/popup removable?

    General and Desktop
    2
    3
    2337
    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.
    • P
      PatrickS last edited by

      Hi guys,

      I would like to remove the shadow effect of a QComboBox' drop-down / popup, but nothing worked yet.

      Setting the combo box a different style via

      myComboBox->setStyle(QStyleFactory::create("Windows"));
      

      was not successful. The available styles on my MS Windows 7 machine are "Windows", "WindowsXP", "WindowsVista" and "Fusion" - I tried them all.

      I am using Qt 5.5.1.

      Any ideas?
      A CSS solution would be superior, but I am grateful for any suggestion.
      Thanks in advance!

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

        @PatrickS
        this a platform feature. Windows (or at least Qt under Windows) adds it for popup windows.
        Try this pls (before showing the popup):

        comboBox->view()->window()->setWindowFlags( Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint );
        

        --- 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 5
        • raven-worx
          raven-worx Moderators @PatrickS last edited by

          @PatrickS
          this a platform feature. Windows (or at least Qt under Windows) adds it for popup windows.
          Try this pls (before showing the popup):

          comboBox->view()->window()->setWindowFlags( Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint );
          

          --- 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 5
          • P
            PatrickS last edited by

            Great, that worked! Thank you very much!

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