Qt Forum

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

    Non-editable QComboBox text alignment

    General and Desktop
    qcombobox align
    2
    2
    2513
    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.
    • F
      FrankE last edited by FrankE

      As well as align text on a editable one is pretty straightfoward in code:
      mycb->lineEdit()->setAlignment(Qt::AlignRight);

      it doesn't work on non-editable (there is no lineEdit), I could make lineEdit read-only, also disable it but you cannot click there to change the item (that's a pitty)

      Anyone knows a tip to make this change on a non-editable QComboBox?

      Regards!

      1 Reply Last reply Reply Quote 0
      • M
        mcosta last edited by

        HI and welcome to devnet,

        I think you should try to write your own QStyle

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

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