Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Non-editable QComboBox text alignment
Forum Updated to NodeBB v4.3 + New Features

Non-editable QComboBox text alignment

Scheduled Pinned Locked Moved General and Desktop
qcomboboxalign
2 Posts 2 Posters 2.8k Views 2 Watching
  • 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 Offline
    F Offline
    FrankE
    wrote on 17 Sept 2015, 11:00 last edited by FrankE
    #1

    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
    0
    • M Offline
      M Offline
      mcosta
      wrote on 17 Sept 2015, 19:06 last edited by
      #2

      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
      0

      1/2

      17 Sept 2015, 11:00

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved