Results 1 to 2 of 2

Thread: Styling QComboBox like Find/Find&Replace selector in Mac OSX

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Styling QComboBox like Find/Find&Replace selector in Mac OSX

    Hello all.
    I'm trying to implement find panel like another mac os x software has.
    It should look like:
    Attachment 7748
    And active it looks like:
    Attachment 7749
    To do it i used following style sheet:
    Qt Code:
    1. font-size: 11px;
    2. border-image: url(:/Resources/findbuttonborderimage.png) 8px 8px 8px 8px stretch stretch;
    3. border-width: 8px 8px 8px 8px;
    4. padding-top: -5px;
    5. padding-bottom: -3px;
    6. }
    7. border-image: url(:/Resources/findbuttonborderimagepressed.png) 8px 8px 8px 8px stretch stretch;
    8. }
    9. QComboBox::drop-down {
    10. subcontrol-origin: padding;
    11. subcontrol-position: center right;
    12. width: 10px;
    13. height: 10px;
    14. border: none;
    15. background: none;
    16. }
    17. QComboBox::down-arrow {
    18. image: url(:/Resources/findselectoricon.png);
    19. }
    20. {
    21. background: none;
    22. }
    To copy to clipboard, switch view to plain text mode 
    Closed my combo looks fine:
    Attachment 7750
    But open is wrong:
    Attachment 7751

    Then i changed style sheet a little:
    Qt Code:
    1. {
    2. background: none;
    3. padding: 10px 10px 10px 10px;
    4. }
    To copy to clipboard, switch view to plain text mode 
    But it didn't help:
    Attachment 7752

    As you can to see on last image there is few problems:
    1. Extra background under items
    2. Rounding rects are hidden behind padding. Increasing padding draw correct rounding rects.
    3. Items being selected only in extra background area

    Could anybody help with it?

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Styling QComboBox like Find/Find&Replace selector in Mac OSX

    All your attachments are missing so it's difficult to tell what may be wrong.

Similar Threads

  1. Find Replace Implementation
    By bismitapadhy in forum Qt Programming
    Replies: 2
    Last Post: 13th April 2020, 16:40
  2. Replies: 3
    Last Post: 3rd May 2009, 08:58
  3. QString - find and replace text
    By graciano in forum Newbie
    Replies: 3
    Last Post: 24th January 2009, 20:35
  4. Language Selector QCombobox question
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 31st January 2008, 08:03
  5. Styling a QComboBox
    By Enygma in forum Qt Programming
    Replies: 6
    Last Post: 23rd August 2007, 10:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.