Results 1 to 2 of 2

Thread: How to set Text Elide Mode for QComboBox

  1. #1
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to set Text Elide Mode for QComboBox

    Is there a way to set the text elide mode for the text shown in a QComboBox (not the popup list)?

    It is possible to set it for items in the popup list

    Qt Code:
    1. myCmb->view()->setTextElideMode()
    To copy to clipboard, switch view to plain text mode 

    but I did not find any way to set it for the text shown in the QComboBox.

    Thanks in advance for your help

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to set Text Elide Mode for QComboBox

    Reimplement QComboBox::paintEvent() and adjust the text after call to initStyleOption().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt Creator Help mode only shows text omitting styles
    By HeyYO in forum Qt Tools
    Replies: 2
    Last Post: 15th September 2011, 04:43
  2. Replies: 1
    Last Post: 26th November 2010, 12:06
  3. QListView Text Elide Like QListWidget
    By Kel Solaar in forum Qt Programming
    Replies: 6
    Last Post: 13th May 2010, 05:44
  4. QComboBox with fixed text?
    By squidge in forum Qt Programming
    Replies: 0
    Last Post: 14th November 2009, 21:39
  5. read input string --> text mode
    By eleanor in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2007, 18:08

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.