October 7, 2011

M_31 M_31
Lab Rat
56 posts

problem in making Fixed size QtabWidget’s tab


Hi All,
I will be creating many tabs with with different tab text at runtime..
but the tab bar size is keep-on getting increased depending upon the Tab Text , which i provided at runtime..
So i used the following function to make it fixed width.

  1.   ui->tabWidget->setStyleSheet("QTabBar::tab{height:20px; width:160px; font: 8pt;alignment: left;}");

now i am able to see my QTabWidget Tab size is fixed..but the Tab text alignment is center by default( i assume )..
but i want to show my tab text as left alignment..

eg: Input text “test sample of tab Text”

My ouput is “ sample of tab Te”

but i want …my ouput should be “test sample of ta…”

Please let me know…whether i am doing anything wrong in my operation on achiving fixed tab size??

0 replies

  ‹‹ Get string value from modified key press      [SOLVED]Get mainwindows Widgets ››

You must log in to post a reply. Not a member yet? Register here!