Results 1 to 3 of 3

Thread: Alignment in QComboBox

  1. #1
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Post Alignment in QComboBox

    Hi;
    how can I set the QComboBox to be center aligned when I insert the value.

  2. #2
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Alignment in QComboBox

    Look into
    Qt Code:
    1. QComboBox::SizeAdjustPolicy
    To copy to clipboard, switch view to plain text mode 
    . You can use
    Qt Code:
    1. QComboBox::AdjustToContents
    To copy to clipboard, switch view to plain text mode 
    and can give spacing accordingly.

  3. #3
    Join Date
    May 2010
    Location
    Algeria
    Posts
    23
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Alignment in QComboBox

    Hi; thanks ;
    Qt Code:
    1. WindowSize=new QComboBox;// 2 4 16...
    2. WindowSize->setEnabled(false);
    3. for(int i=0, j=128; i<7; i++, j*=2)
    4. sl<<QString::number(j);
    5. WindowSize->addItems(sl);
    6. WindowSize->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    To copy to clipboard, switch view to plain text mode 
    this code isn't worked
    Last edited by Naami; 26th May 2010 at 14:56. Reason: changed [qtclass] to [code]

Similar Threads

  1. Set an Alignment in QGraphicsTextItem
    By avis_phoenix in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 17:39
  2. Qt Layout alignment
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2007, 19:15
  3. Help with alignment
    By IsleWitch in forum Newbie
    Replies: 1
    Last Post: 20th October 2007, 18:20
  4. QTextEdit Alignment
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 2nd May 2006, 07:44
  5. problem with alignment
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2006, 12:52

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.