Results 1 to 9 of 9

Thread: Imitating a ComboBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Platforms
    MacOS X Unix/X11
    Thanks
    1
    Thanked 52 Times in 52 Posts

    Default Re: Imitating a ComboBox

    No no, don't do that.

    Only because "it looks more like a real combobox" on some operating system, the approach is doomed to fail on other operating systems/skins.

    You will also be able to have text UNDER your button. Thats not good also. Make both lineedit and button next to each other, disable the frame of the lineedit and maybe make a frame around all. That is basically how the real combo is implemented.

    See also http://labs.trolltech.com/blogs/2007...-clear-button/
    It's nice to be important but it's more important to be nice.

  2. #2
    Join Date
    Aug 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Imitating a ComboBox

    Quote Originally Posted by axeljaeger View Post
    No no, don't do that.

    Only because "it looks more like a real combobox" on some operating system, the approach is doomed to fail on other operating systems/skins.

    You will also be able to have text UNDER your button. Thats not good also. Make both lineedit and button next to each other, disable the frame of the lineedit and maybe make a frame around all. That is basically how the real combo is implemented.

    See also http://labs.trolltech.com/blogs/2007...-clear-button/
    For text under the button I used setTextMargins to avoid it. Also I doubt that my application will ever be used on other operating system than widows, but even difference between the way XP and Vista look could pose a problem, so your argument is completely in place. I will try the approach you mentioned and if I get stuck I’ll be back with more questions

Similar Threads

  1. Combobox with checkable items
    By qtneuling in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2008, 15:42
  2. Replies: 2
    Last Post: 18th March 2008, 16:38
  3. ComboBox of bmp:s
    By SailinShoes in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2008, 16:22
  4. [Qt 4.3.1]A problem with combobox style
    By Tamara in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2007, 11:49
  5. Filling combobox from database
    By Philip_Anselmo in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2006, 18:53

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
  •  
Qt is a trademark of The Qt Company.