qt - Simple ribbon: autosizing toolbars and tabs -


i'm trying implement simple tabbed interface qt5. use qtabwidget qtoolbars placed inside tabs , add qactions qtoolbars:

link

the toolbar , widget below within vertical layout. i'd toolbars autosize height enough high hold qtoolbuttons inside (the last ones can display icon, text or both of them (text under icon or on right side of it), affects height) , autosize width display many toolbuttons, fits parent tab width. i'd parent tabs automaticaly stretch or shrink height able display toolbars within. possible in qt? if yes, how?

update1: horizontal autostretching has been done using toolbars tab widgets of qtabwidget. vertical 1 still missing. significant code (for qdesigner):

<widget class="qwidget" name="central_widget">  <layout class="qvboxlayout" name="verticallayout">   <item>    <widget class="qtabwidget" name="tabbed_tool_bar">     <property name="sizepolicy">      <sizepolicy hsizetype="expanding" vsizetype="fixed">       <horstretch>0</horstretch>       <verstretch>0</verstretch>      </sizepolicy>     </property>     <widget class="qtoolbar" name="tool_tab_game">      <property name="windowtitle">       <string>game tooltab</string>      </property>      <attribute name="title">       <string>&amp;game</string>      </attribute>      …     </widget>     <widget class="qtoolbar" name="tool_tab_movement">      <property name="windowtitle">       <string>movement tooltab</string>      </property>      <attribute name="title">       <string>&amp;movement</string>      </attribute>      …     </widget>    </widget>   </item>   <item>    <widget class="qscrollarea" name="scroll_area">     <property name="sizepolicy">      <sizepolicy hsizetype="expanding" vsizetype="expanding">       <horstretch>0</horstretch>       <verstretch>0</verstretch>      </sizepolicy>     </property>     <property name="widgetresizable">      <bool>true</bool>     </property>     …    </widget>   </item>  </layout> </widget> 

currently when window resized vertically, tab widget resized vertically. want resize depending on contained toolbars' height, , keep height when parent window resized.

update2: expected vertical autoresizing done via setting qtabwidget vertical sizepolicy fixed , qscrollarea below vertical size policy expanding. ui xml listed above modified accordingly now.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -