admin管理员组

文章数量:1021364

I'm using Qt Designer to create a GUI for my application (QGIS extension). In the application, certain areas are scrollable as intended. However, in Qt Designer, scrollbars are not visible, making it impossible to rearrange or access items that are out of view.

How can I scroll within these areas in Qt Designer to see and modify the hidden items?

This screenshot shows the problem with a red arrow that represents the missing scrollbar. An example ui file code can be found below.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>example</class>
 <widget class="QDockWidget" name="example">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>785</width>
    <height>839</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>Example</string>
  </property>
  <widget class="QWidget" name="dockWidgetContents">
   <property name="sizePolicy">
    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_34">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="OptionsTab">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="layoutDirection">
        <enum>Qt::LeftToRight</enum>
       </property>
       <attribute name="title">
        <string>Process</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_7">
        <property name="sizeConstraint">
         <enum>QLayout::SetDefaultConstraint</enum>
        </property>
        <property name="leftMargin">
         <number>0</number>
        </property>
        <property name="topMargin">
         <number>0</number>
        </property>
        <property name="rightMargin">
         <number>0</number>
        </property>
        <property name="bottomMargin">
         <number>0</number>
        </property>
        <item row="0" column="0">
         <widget class="QScrollArea" name="scrollArea_3">
          <property name="palette">
           <palette>
            <active>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </active>
            <inactive>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </inactive>
            <disabled>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </disabled>
           </palette>
          </property>
          <property name="frameShape">
           <enum>QFrame::NoFrame</enum>
          </property>
          <property name="frameShadow">
           <enum>QFrame::Plain</enum>
          </property>
          <property name="widgetResizable">
           <bool>true</bool>
          </property>
          <widget class="QWidget" name="scrollAreaWidgetContents_4">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>755</width>
             <height>770</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_3">
            <item>
             <widget class="QScrollArea" name="scrollArea">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="widgetResizable">
               <bool>true</bool>
              </property>
              <widget class="QWidget" name="scrollAreaWidgetContents">
               <property name="geometry">
                <rect>
                 <x>0</x>
                 <y>0</y>
                 <width>729</width>
                 <height>954</height>
                </rect>
               </property>
               <layout class="QGridLayout" name="gridLayout_4">
                <item row="0" column="0">
                 <widget class="QWidget" name="widget_2" native="true">
                  <property name="sizePolicy">
                   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                    <horstretch>0</horstretch>
                    <verstretch>0</verstretch>
                   </sizepolicy>
                  </property>
                  <layout class="QGridLayout" name="gridLayout_3">
                   <property name="leftMargin">
                    <number>6</number>
                   </property>
                   <property name="topMargin">
                    <number>6</number>
                   </property>
                   <property name="rightMargin">
                    <number>6</number>
                   </property>
                   <property name="bottomMargin">
                    <number>6</number>
                   </property>
                   <item row="8" column="0">
                    <widget class="QLabel" name="label_3">
                     <property name="text">
                      <string>-S, --selection </string>
                     </property>
                    </widget>
                   </item>
                   <item row="18" column="0">
                    <widget class="QLabel" name="proj_out_label">
                     <property name="text">
                      <string>--proj-out</string>
                     </property>
                    </widget>
                   </item>
                   <item row="6" column="0">
                    <widget class="QLabel" name="label">
                     <property name="text">
                      <string>-O, --orientation</string>
                     </property>
                    </widget>
                   </item>
                   <item row="5" column="0">
                    <widget class="QComboBox" name="topology_select">
                     <item>
                      <property name="text">
                       <string>full</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>none</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>basic</string>
                      </property>
                     </item>
                    </widget>
                   </item>
                   <item row="14" column="0">
                    <widget class="QLabel" name="label_10">
                     <property name="text">
                      <string>-D, --dangling</string>
                     </property>
                    </widget>
                   </item>
                   <item row="12" column="0">
                    <widget class="QLabel" name="label_6">
                     <property name="text">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="13" column="0">
                    <widget class="QLineEdit" name="decimal_places_input">
                     <property name="text">
                      <string>3</string>
                     </property>
                     <property name="placeholderText">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="17" column="0">
                    <widget class="QLineEdit" name="x_offset_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-x, --x-offset (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="10" column="0">
                    <widget class="QLabel" name="label_5">
                     <property name="text">
                      <string>-t, --tolerance</string>
                     </property>
                    </widget>
                   </item>
                   <item row="15" column="0">
                    <widget class="QLineEdit" name="dangling_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-D, --dangling (default: 0,0 = off)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="9" column="0">
                    <widget class="QLineEdit" name="selection_input">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                      </sizepolicy>
                     </property>
                     <property name="maximumSize">
                      <size>
                       <width>16777215</width>
                       <height>900</height>
                      </size>
                     </property>
                     <property name="placeholderText">
                      <string>-S, --selection (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="19" column="0">
                    <widget class="QWidget" name="proj_out_group" native="true">
                     <layout class="QVBoxLayout" name="verticalLayout_15">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QLineEdit" name="proj_out_input">
                        <property name="placeholderText">
                         <string>EPSG:3857</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_mode">
                        <property name="text">
                         <string>--label-mode-poly</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QComboBox" name="label_mode_poly_select">
                        <item>
                         <property name="text">
                          <string>center</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>first</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>last</string>
                         </property>
                        </item>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_2">
                        <property name="text">
                         <string>-L, --label</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="label_input">
                        <property name="placeholderText">
                         <string>-L, --label (see manual for details)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_4">
                        <property name="text">
                         <string>-z, --z-offset </string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="z_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-z, --z-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_12">
                        <property name="text">
                         <string>-y, --y-offset</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="y_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-y, --y-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_9">
                        <property name="text">
                         <string>decimal group input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_group_input">
                        <property name="text">
                         <string>,</string>
                        </property>
                        <property name="placeholderText">
                         <string>-g, --decimal-group (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_8">
                        <property name="text">
                         <string>decimal point input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_point_input">
                        <property name="text">
                         <string>.</string>
                        </property>
                        <property name="placeholderText">
                         <string>-i, --decimal-point (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_7">
                        <property name="text">
                         <string>-s, --snapping</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="snapping_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-s, --snapping (default: 0,0 = off)</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="4" column="0">
                    <widget class="QLabel" name="topology_label">
                     <property name="text">
                      <string>-T --topology</string>
                     </property>
                    </widget>
                   </item>
                   <item row="2" column="0">
                    <widget class="QLineEdit" name="proj_in_input">
                     <property name="placeholderText">
                      <string>EPSG:32632</string>
                     </property>
                    </widget>
                   </item>
                   <item row="16" column="0">
                    <widget class="QLabel" name="label_11">
                     <property name="text">
                      <string>-x, --x-offset</string>
                     </property>
                    </widget>
                   </item>
                   <item row="0" column="0">
                    <widget class="QWidget" name="checkGroup_1" native="true">
                     <layout class="QHBoxLayout" name="horizontalLayout">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QCheckBox" name="force_2d_checkbox">
                        <property name="text">
                         <string>-2, --force-2d</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="validate_checkbox">
                        <property name="text">
                         <string>-v, --validate</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="english_checkbox">
                        <property name="text">
                         <string>-e, --english</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="strict_checkbox">
                        <property name="text">
                         <string>-c, --strict</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="11" column="0">
                    <widget class="QLineEdit" name="tolerance_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-t, --tolerance (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="7" column="0">
                    <widget class="QLineEdit" name="orientation_input">
                     <property name="text">
                      <string/>
                     </property>
                     <property name="placeholderText">
                      <string>-O, --orientation (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="1" column="0">
                    <widget class="QLabel" name="label_13">
                     <property name="text">
                      <string>--proj-in</string>
                     </property>
                    </widget>
                   </item>
                  </layout>
                 </widget>
                </item>
               </layout>
              </widget>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_5">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="palette">
               <palette>
                <active>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </active>
                <inactive>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </inactive>
                <disabled>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </disabled>
               </palette>
              </property>
              <property name="title">
               <string>Commands</string>
              </property>
              <layout class="QFormLayout" name="formLayout_2"/>
             </widget>
            </item>
           </layout>
          </widget>
         </widget>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>

I'm using Qt Designer to create a GUI for my application (QGIS extension). In the application, certain areas are scrollable as intended. However, in Qt Designer, scrollbars are not visible, making it impossible to rearrange or access items that are out of view.

How can I scroll within these areas in Qt Designer to see and modify the hidden items?

This screenshot shows the problem with a red arrow that represents the missing scrollbar. An example ui file code can be found below.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>example</class>
 <widget class="QDockWidget" name="example">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>785</width>
    <height>839</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>Example</string>
  </property>
  <widget class="QWidget" name="dockWidgetContents">
   <property name="sizePolicy">
    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_34">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="OptionsTab">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="layoutDirection">
        <enum>Qt::LeftToRight</enum>
       </property>
       <attribute name="title">
        <string>Process</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_7">
        <property name="sizeConstraint">
         <enum>QLayout::SetDefaultConstraint</enum>
        </property>
        <property name="leftMargin">
         <number>0</number>
        </property>
        <property name="topMargin">
         <number>0</number>
        </property>
        <property name="rightMargin">
         <number>0</number>
        </property>
        <property name="bottomMargin">
         <number>0</number>
        </property>
        <item row="0" column="0">
         <widget class="QScrollArea" name="scrollArea_3">
          <property name="palette">
           <palette>
            <active>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </active>
            <inactive>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </inactive>
            <disabled>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </disabled>
           </palette>
          </property>
          <property name="frameShape">
           <enum>QFrame::NoFrame</enum>
          </property>
          <property name="frameShadow">
           <enum>QFrame::Plain</enum>
          </property>
          <property name="widgetResizable">
           <bool>true</bool>
          </property>
          <widget class="QWidget" name="scrollAreaWidgetContents_4">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>755</width>
             <height>770</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_3">
            <item>
             <widget class="QScrollArea" name="scrollArea">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="widgetResizable">
               <bool>true</bool>
              </property>
              <widget class="QWidget" name="scrollAreaWidgetContents">
               <property name="geometry">
                <rect>
                 <x>0</x>
                 <y>0</y>
                 <width>729</width>
                 <height>954</height>
                </rect>
               </property>
               <layout class="QGridLayout" name="gridLayout_4">
                <item row="0" column="0">
                 <widget class="QWidget" name="widget_2" native="true">
                  <property name="sizePolicy">
                   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                    <horstretch>0</horstretch>
                    <verstretch>0</verstretch>
                   </sizepolicy>
                  </property>
                  <layout class="QGridLayout" name="gridLayout_3">
                   <property name="leftMargin">
                    <number>6</number>
                   </property>
                   <property name="topMargin">
                    <number>6</number>
                   </property>
                   <property name="rightMargin">
                    <number>6</number>
                   </property>
                   <property name="bottomMargin">
                    <number>6</number>
                   </property>
                   <item row="8" column="0">
                    <widget class="QLabel" name="label_3">
                     <property name="text">
                      <string>-S, --selection </string>
                     </property>
                    </widget>
                   </item>
                   <item row="18" column="0">
                    <widget class="QLabel" name="proj_out_label">
                     <property name="text">
                      <string>--proj-out</string>
                     </property>
                    </widget>
                   </item>
                   <item row="6" column="0">
                    <widget class="QLabel" name="label">
                     <property name="text">
                      <string>-O, --orientation</string>
                     </property>
                    </widget>
                   </item>
                   <item row="5" column="0">
                    <widget class="QComboBox" name="topology_select">
                     <item>
                      <property name="text">
                       <string>full</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>none</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>basic</string>
                      </property>
                     </item>
                    </widget>
                   </item>
                   <item row="14" column="0">
                    <widget class="QLabel" name="label_10">
                     <property name="text">
                      <string>-D, --dangling</string>
                     </property>
                    </widget>
                   </item>
                   <item row="12" column="0">
                    <widget class="QLabel" name="label_6">
                     <property name="text">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="13" column="0">
                    <widget class="QLineEdit" name="decimal_places_input">
                     <property name="text">
                      <string>3</string>
                     </property>
                     <property name="placeholderText">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="17" column="0">
                    <widget class="QLineEdit" name="x_offset_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-x, --x-offset (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="10" column="0">
                    <widget class="QLabel" name="label_5">
                     <property name="text">
                      <string>-t, --tolerance</string>
                     </property>
                    </widget>
                   </item>
                   <item row="15" column="0">
                    <widget class="QLineEdit" name="dangling_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-D, --dangling (default: 0,0 = off)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="9" column="0">
                    <widget class="QLineEdit" name="selection_input">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                      </sizepolicy>
                     </property>
                     <property name="maximumSize">
                      <size>
                       <width>16777215</width>
                       <height>900</height>
                      </size>
                     </property>
                     <property name="placeholderText">
                      <string>-S, --selection (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="19" column="0">
                    <widget class="QWidget" name="proj_out_group" native="true">
                     <layout class="QVBoxLayout" name="verticalLayout_15">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QLineEdit" name="proj_out_input">
                        <property name="placeholderText">
                         <string>EPSG:3857</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_mode">
                        <property name="text">
                         <string>--label-mode-poly</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QComboBox" name="label_mode_poly_select">
                        <item>
                         <property name="text">
                          <string>center</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>first</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>last</string>
                         </property>
                        </item>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_2">
                        <property name="text">
                         <string>-L, --label</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="label_input">
                        <property name="placeholderText">
                         <string>-L, --label (see manual for details)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_4">
                        <property name="text">
                         <string>-z, --z-offset </string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="z_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-z, --z-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_12">
                        <property name="text">
                         <string>-y, --y-offset</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="y_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-y, --y-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_9">
                        <property name="text">
                         <string>decimal group input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_group_input">
                        <property name="text">
                         <string>,</string>
                        </property>
                        <property name="placeholderText">
                         <string>-g, --decimal-group (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_8">
                        <property name="text">
                         <string>decimal point input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_point_input">
                        <property name="text">
                         <string>.</string>
                        </property>
                        <property name="placeholderText">
                         <string>-i, --decimal-point (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_7">
                        <property name="text">
                         <string>-s, --snapping</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="snapping_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-s, --snapping (default: 0,0 = off)</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="4" column="0">
                    <widget class="QLabel" name="topology_label">
                     <property name="text">
                      <string>-T --topology</string>
                     </property>
                    </widget>
                   </item>
                   <item row="2" column="0">
                    <widget class="QLineEdit" name="proj_in_input">
                     <property name="placeholderText">
                      <string>EPSG:32632</string>
                     </property>
                    </widget>
                   </item>
                   <item row="16" column="0">
                    <widget class="QLabel" name="label_11">
                     <property name="text">
                      <string>-x, --x-offset</string>
                     </property>
                    </widget>
                   </item>
                   <item row="0" column="0">
                    <widget class="QWidget" name="checkGroup_1" native="true">
                     <layout class="QHBoxLayout" name="horizontalLayout">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QCheckBox" name="force_2d_checkbox">
                        <property name="text">
                         <string>-2, --force-2d</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="validate_checkbox">
                        <property name="text">
                         <string>-v, --validate</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="english_checkbox">
                        <property name="text">
                         <string>-e, --english</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="strict_checkbox">
                        <property name="text">
                         <string>-c, --strict</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="11" column="0">
                    <widget class="QLineEdit" name="tolerance_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-t, --tolerance (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="7" column="0">
                    <widget class="QLineEdit" name="orientation_input">
                     <property name="text">
                      <string/>
                     </property>
                     <property name="placeholderText">
                      <string>-O, --orientation (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="1" column="0">
                    <widget class="QLabel" name="label_13">
                     <property name="text">
                      <string>--proj-in</string>
                     </property>
                    </widget>
                   </item>
                  </layout>
                 </widget>
                </item>
               </layout>
              </widget>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_5">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="palette">
               <palette>
                <active>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </active>
                <inactive>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </inactive>
                <disabled>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </disabled>
               </palette>
              </property>
              <property name="title">
               <string>Commands</string>
              </property>
              <layout class="QFormLayout" name="formLayout_2"/>
             </widget>
            </item>
           </layout>
          </widget>
         </widget>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>
Share Improve this question edited Nov 21, 2024 at 18:08 musicamante 48.9k8 gold badges41 silver badges74 bronze badges asked Nov 19, 2024 at 14:02 tonitoni 4858 silver badges19 bronze badges 15
  • Please provide a MRE – eyllanesc Commented Nov 19, 2024 at 15:01
  • sorry to ask, but what is a MRE? – toni Commented Nov 19, 2024 at 15:40
  • MRE: minimal reproducible example, also read How to Ask – eyllanesc Commented Nov 19, 2024 at 15:41
  • Thank you. It do not know how I would provide a minimal working example for a QT designer file. Just sharing the ui file? – toni Commented Nov 19, 2024 at 15:43
  • in this case yes. – eyllanesc Commented Nov 19, 2024 at 15:44
 |  Show 10 more comments

1 Answer 1

Reset to default 0

Set the verticalScrollBarPolicy to ScrollBarAlwaysOn

I'm using Qt Designer to create a GUI for my application (QGIS extension). In the application, certain areas are scrollable as intended. However, in Qt Designer, scrollbars are not visible, making it impossible to rearrange or access items that are out of view.

How can I scroll within these areas in Qt Designer to see and modify the hidden items?

This screenshot shows the problem with a red arrow that represents the missing scrollbar. An example ui file code can be found below.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>example</class>
 <widget class="QDockWidget" name="example">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>785</width>
    <height>839</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>Example</string>
  </property>
  <widget class="QWidget" name="dockWidgetContents">
   <property name="sizePolicy">
    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_34">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="OptionsTab">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="layoutDirection">
        <enum>Qt::LeftToRight</enum>
       </property>
       <attribute name="title">
        <string>Process</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_7">
        <property name="sizeConstraint">
         <enum>QLayout::SetDefaultConstraint</enum>
        </property>
        <property name="leftMargin">
         <number>0</number>
        </property>
        <property name="topMargin">
         <number>0</number>
        </property>
        <property name="rightMargin">
         <number>0</number>
        </property>
        <property name="bottomMargin">
         <number>0</number>
        </property>
        <item row="0" column="0">
         <widget class="QScrollArea" name="scrollArea_3">
          <property name="palette">
           <palette>
            <active>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </active>
            <inactive>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </inactive>
            <disabled>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </disabled>
           </palette>
          </property>
          <property name="frameShape">
           <enum>QFrame::NoFrame</enum>
          </property>
          <property name="frameShadow">
           <enum>QFrame::Plain</enum>
          </property>
          <property name="widgetResizable">
           <bool>true</bool>
          </property>
          <widget class="QWidget" name="scrollAreaWidgetContents_4">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>755</width>
             <height>770</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_3">
            <item>
             <widget class="QScrollArea" name="scrollArea">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="widgetResizable">
               <bool>true</bool>
              </property>
              <widget class="QWidget" name="scrollAreaWidgetContents">
               <property name="geometry">
                <rect>
                 <x>0</x>
                 <y>0</y>
                 <width>729</width>
                 <height>954</height>
                </rect>
               </property>
               <layout class="QGridLayout" name="gridLayout_4">
                <item row="0" column="0">
                 <widget class="QWidget" name="widget_2" native="true">
                  <property name="sizePolicy">
                   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                    <horstretch>0</horstretch>
                    <verstretch>0</verstretch>
                   </sizepolicy>
                  </property>
                  <layout class="QGridLayout" name="gridLayout_3">
                   <property name="leftMargin">
                    <number>6</number>
                   </property>
                   <property name="topMargin">
                    <number>6</number>
                   </property>
                   <property name="rightMargin">
                    <number>6</number>
                   </property>
                   <property name="bottomMargin">
                    <number>6</number>
                   </property>
                   <item row="8" column="0">
                    <widget class="QLabel" name="label_3">
                     <property name="text">
                      <string>-S, --selection </string>
                     </property>
                    </widget>
                   </item>
                   <item row="18" column="0">
                    <widget class="QLabel" name="proj_out_label">
                     <property name="text">
                      <string>--proj-out</string>
                     </property>
                    </widget>
                   </item>
                   <item row="6" column="0">
                    <widget class="QLabel" name="label">
                     <property name="text">
                      <string>-O, --orientation</string>
                     </property>
                    </widget>
                   </item>
                   <item row="5" column="0">
                    <widget class="QComboBox" name="topology_select">
                     <item>
                      <property name="text">
                       <string>full</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>none</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>basic</string>
                      </property>
                     </item>
                    </widget>
                   </item>
                   <item row="14" column="0">
                    <widget class="QLabel" name="label_10">
                     <property name="text">
                      <string>-D, --dangling</string>
                     </property>
                    </widget>
                   </item>
                   <item row="12" column="0">
                    <widget class="QLabel" name="label_6">
                     <property name="text">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="13" column="0">
                    <widget class="QLineEdit" name="decimal_places_input">
                     <property name="text">
                      <string>3</string>
                     </property>
                     <property name="placeholderText">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="17" column="0">
                    <widget class="QLineEdit" name="x_offset_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-x, --x-offset (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="10" column="0">
                    <widget class="QLabel" name="label_5">
                     <property name="text">
                      <string>-t, --tolerance</string>
                     </property>
                    </widget>
                   </item>
                   <item row="15" column="0">
                    <widget class="QLineEdit" name="dangling_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-D, --dangling (default: 0,0 = off)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="9" column="0">
                    <widget class="QLineEdit" name="selection_input">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                      </sizepolicy>
                     </property>
                     <property name="maximumSize">
                      <size>
                       <width>16777215</width>
                       <height>900</height>
                      </size>
                     </property>
                     <property name="placeholderText">
                      <string>-S, --selection (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="19" column="0">
                    <widget class="QWidget" name="proj_out_group" native="true">
                     <layout class="QVBoxLayout" name="verticalLayout_15">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QLineEdit" name="proj_out_input">
                        <property name="placeholderText">
                         <string>EPSG:3857</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_mode">
                        <property name="text">
                         <string>--label-mode-poly</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QComboBox" name="label_mode_poly_select">
                        <item>
                         <property name="text">
                          <string>center</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>first</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>last</string>
                         </property>
                        </item>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_2">
                        <property name="text">
                         <string>-L, --label</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="label_input">
                        <property name="placeholderText">
                         <string>-L, --label (see manual for details)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_4">
                        <property name="text">
                         <string>-z, --z-offset </string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="z_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-z, --z-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_12">
                        <property name="text">
                         <string>-y, --y-offset</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="y_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-y, --y-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_9">
                        <property name="text">
                         <string>decimal group input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_group_input">
                        <property name="text">
                         <string>,</string>
                        </property>
                        <property name="placeholderText">
                         <string>-g, --decimal-group (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_8">
                        <property name="text">
                         <string>decimal point input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_point_input">
                        <property name="text">
                         <string>.</string>
                        </property>
                        <property name="placeholderText">
                         <string>-i, --decimal-point (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_7">
                        <property name="text">
                         <string>-s, --snapping</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="snapping_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-s, --snapping (default: 0,0 = off)</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="4" column="0">
                    <widget class="QLabel" name="topology_label">
                     <property name="text">
                      <string>-T --topology</string>
                     </property>
                    </widget>
                   </item>
                   <item row="2" column="0">
                    <widget class="QLineEdit" name="proj_in_input">
                     <property name="placeholderText">
                      <string>EPSG:32632</string>
                     </property>
                    </widget>
                   </item>
                   <item row="16" column="0">
                    <widget class="QLabel" name="label_11">
                     <property name="text">
                      <string>-x, --x-offset</string>
                     </property>
                    </widget>
                   </item>
                   <item row="0" column="0">
                    <widget class="QWidget" name="checkGroup_1" native="true">
                     <layout class="QHBoxLayout" name="horizontalLayout">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QCheckBox" name="force_2d_checkbox">
                        <property name="text">
                         <string>-2, --force-2d</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="validate_checkbox">
                        <property name="text">
                         <string>-v, --validate</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="english_checkbox">
                        <property name="text">
                         <string>-e, --english</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="strict_checkbox">
                        <property name="text">
                         <string>-c, --strict</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="11" column="0">
                    <widget class="QLineEdit" name="tolerance_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-t, --tolerance (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="7" column="0">
                    <widget class="QLineEdit" name="orientation_input">
                     <property name="text">
                      <string/>
                     </property>
                     <property name="placeholderText">
                      <string>-O, --orientation (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="1" column="0">
                    <widget class="QLabel" name="label_13">
                     <property name="text">
                      <string>--proj-in</string>
                     </property>
                    </widget>
                   </item>
                  </layout>
                 </widget>
                </item>
               </layout>
              </widget>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_5">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="palette">
               <palette>
                <active>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </active>
                <inactive>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </inactive>
                <disabled>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </disabled>
               </palette>
              </property>
              <property name="title">
               <string>Commands</string>
              </property>
              <layout class="QFormLayout" name="formLayout_2"/>
             </widget>
            </item>
           </layout>
          </widget>
         </widget>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>

I'm using Qt Designer to create a GUI for my application (QGIS extension). In the application, certain areas are scrollable as intended. However, in Qt Designer, scrollbars are not visible, making it impossible to rearrange or access items that are out of view.

How can I scroll within these areas in Qt Designer to see and modify the hidden items?

This screenshot shows the problem with a red arrow that represents the missing scrollbar. An example ui file code can be found below.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>example</class>
 <widget class="QDockWidget" name="example">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>785</width>
    <height>839</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>Example</string>
  </property>
  <widget class="QWidget" name="dockWidgetContents">
   <property name="sizePolicy">
    <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_34">
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="currentIndex">
       <number>0</number>
      </property>
      <widget class="QWidget" name="OptionsTab">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="layoutDirection">
        <enum>Qt::LeftToRight</enum>
       </property>
       <attribute name="title">
        <string>Process</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_7">
        <property name="sizeConstraint">
         <enum>QLayout::SetDefaultConstraint</enum>
        </property>
        <property name="leftMargin">
         <number>0</number>
        </property>
        <property name="topMargin">
         <number>0</number>
        </property>
        <property name="rightMargin">
         <number>0</number>
        </property>
        <property name="bottomMargin">
         <number>0</number>
        </property>
        <item row="0" column="0">
         <widget class="QScrollArea" name="scrollArea_3">
          <property name="palette">
           <palette>
            <active>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </active>
            <inactive>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </inactive>
            <disabled>
             <colorrole role="Base">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
             <colorrole role="Window">
              <brush brushstyle="SolidPattern">
               <color alpha="255">
                <red>255</red>
                <green>255</green>
                <blue>255</blue>
               </color>
              </brush>
             </colorrole>
            </disabled>
           </palette>
          </property>
          <property name="frameShape">
           <enum>QFrame::NoFrame</enum>
          </property>
          <property name="frameShadow">
           <enum>QFrame::Plain</enum>
          </property>
          <property name="widgetResizable">
           <bool>true</bool>
          </property>
          <widget class="QWidget" name="scrollAreaWidgetContents_4">
           <property name="geometry">
            <rect>
             <x>0</x>
             <y>0</y>
             <width>755</width>
             <height>770</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_3">
            <item>
             <widget class="QScrollArea" name="scrollArea">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="widgetResizable">
               <bool>true</bool>
              </property>
              <widget class="QWidget" name="scrollAreaWidgetContents">
               <property name="geometry">
                <rect>
                 <x>0</x>
                 <y>0</y>
                 <width>729</width>
                 <height>954</height>
                </rect>
               </property>
               <layout class="QGridLayout" name="gridLayout_4">
                <item row="0" column="0">
                 <widget class="QWidget" name="widget_2" native="true">
                  <property name="sizePolicy">
                   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                    <horstretch>0</horstretch>
                    <verstretch>0</verstretch>
                   </sizepolicy>
                  </property>
                  <layout class="QGridLayout" name="gridLayout_3">
                   <property name="leftMargin">
                    <number>6</number>
                   </property>
                   <property name="topMargin">
                    <number>6</number>
                   </property>
                   <property name="rightMargin">
                    <number>6</number>
                   </property>
                   <property name="bottomMargin">
                    <number>6</number>
                   </property>
                   <item row="8" column="0">
                    <widget class="QLabel" name="label_3">
                     <property name="text">
                      <string>-S, --selection </string>
                     </property>
                    </widget>
                   </item>
                   <item row="18" column="0">
                    <widget class="QLabel" name="proj_out_label">
                     <property name="text">
                      <string>--proj-out</string>
                     </property>
                    </widget>
                   </item>
                   <item row="6" column="0">
                    <widget class="QLabel" name="label">
                     <property name="text">
                      <string>-O, --orientation</string>
                     </property>
                    </widget>
                   </item>
                   <item row="5" column="0">
                    <widget class="QComboBox" name="topology_select">
                     <item>
                      <property name="text">
                       <string>full</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>none</string>
                      </property>
                     </item>
                     <item>
                      <property name="text">
                       <string>basic</string>
                      </property>
                     </item>
                    </widget>
                   </item>
                   <item row="14" column="0">
                    <widget class="QLabel" name="label_10">
                     <property name="text">
                      <string>-D, --dangling</string>
                     </property>
                    </widget>
                   </item>
                   <item row="12" column="0">
                    <widget class="QLabel" name="label_6">
                     <property name="text">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="13" column="0">
                    <widget class="QLineEdit" name="decimal_places_input">
                     <property name="text">
                      <string>3</string>
                     </property>
                     <property name="placeholderText">
                      <string>-d, --decimal-places</string>
                     </property>
                    </widget>
                   </item>
                   <item row="17" column="0">
                    <widget class="QLineEdit" name="x_offset_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-x, --x-offset (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="10" column="0">
                    <widget class="QLabel" name="label_5">
                     <property name="text">
                      <string>-t, --tolerance</string>
                     </property>
                    </widget>
                   </item>
                   <item row="15" column="0">
                    <widget class="QLineEdit" name="dangling_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-D, --dangling (default: 0,0 = off)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="9" column="0">
                    <widget class="QLineEdit" name="selection_input">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
                       <horstretch>0</horstretch>
                       <verstretch>0</verstretch>
                      </sizepolicy>
                     </property>
                     <property name="maximumSize">
                      <size>
                       <width>16777215</width>
                       <height>900</height>
                      </size>
                     </property>
                     <property name="placeholderText">
                      <string>-S, --selection (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="19" column="0">
                    <widget class="QWidget" name="proj_out_group" native="true">
                     <layout class="QVBoxLayout" name="verticalLayout_15">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QLineEdit" name="proj_out_input">
                        <property name="placeholderText">
                         <string>EPSG:3857</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_mode">
                        <property name="text">
                         <string>--label-mode-poly</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QComboBox" name="label_mode_poly_select">
                        <item>
                         <property name="text">
                          <string>center</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>first</string>
                         </property>
                        </item>
                        <item>
                         <property name="text">
                          <string>last</string>
                         </property>
                        </item>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_2">
                        <property name="text">
                         <string>-L, --label</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="label_input">
                        <property name="placeholderText">
                         <string>-L, --label (see manual for details)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_4">
                        <property name="text">
                         <string>-z, --z-offset </string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="z_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-z, --z-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_12">
                        <property name="text">
                         <string>-y, --y-offset</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="y_offset_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-y, --y-offset (default: 0,0)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_9">
                        <property name="text">
                         <string>decimal group input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_group_input">
                        <property name="text">
                         <string>,</string>
                        </property>
                        <property name="placeholderText">
                         <string>-g, --decimal-group (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_8">
                        <property name="text">
                         <string>decimal point input</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="decimal_point_input">
                        <property name="text">
                         <string>.</string>
                        </property>
                        <property name="placeholderText">
                         <string>-i, --decimal-point (default: auto)</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLabel" name="label_7">
                        <property name="text">
                         <string>-s, --snapping</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QLineEdit" name="snapping_input">
                        <property name="text">
                         <string>0,0</string>
                        </property>
                        <property name="placeholderText">
                         <string>-s, --snapping (default: 0,0 = off)</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="4" column="0">
                    <widget class="QLabel" name="topology_label">
                     <property name="text">
                      <string>-T --topology</string>
                     </property>
                    </widget>
                   </item>
                   <item row="2" column="0">
                    <widget class="QLineEdit" name="proj_in_input">
                     <property name="placeholderText">
                      <string>EPSG:32632</string>
                     </property>
                    </widget>
                   </item>
                   <item row="16" column="0">
                    <widget class="QLabel" name="label_11">
                     <property name="text">
                      <string>-x, --x-offset</string>
                     </property>
                    </widget>
                   </item>
                   <item row="0" column="0">
                    <widget class="QWidget" name="checkGroup_1" native="true">
                     <layout class="QHBoxLayout" name="horizontalLayout">
                      <property name="leftMargin">
                       <number>0</number>
                      </property>
                      <property name="topMargin">
                       <number>0</number>
                      </property>
                      <property name="rightMargin">
                       <number>0</number>
                      </property>
                      <property name="bottomMargin">
                       <number>6</number>
                      </property>
                      <item>
                       <widget class="QCheckBox" name="force_2d_checkbox">
                        <property name="text">
                         <string>-2, --force-2d</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="validate_checkbox">
                        <property name="text">
                         <string>-v, --validate</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="english_checkbox">
                        <property name="text">
                         <string>-e, --english</string>
                        </property>
                       </widget>
                      </item>
                      <item>
                       <widget class="QCheckBox" name="strict_checkbox">
                        <property name="text">
                         <string>-c, --strict</string>
                        </property>
                       </widget>
                      </item>
                     </layout>
                    </widget>
                   </item>
                   <item row="11" column="0">
                    <widget class="QLineEdit" name="tolerance_input">
                     <property name="text">
                      <string>0,0</string>
                     </property>
                     <property name="placeholderText">
                      <string>-t, --tolerance (default: 0,0)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="7" column="0">
                    <widget class="QLineEdit" name="orientation_input">
                     <property name="text">
                      <string/>
                     </property>
                     <property name="placeholderText">
                      <string>-O, --orientation (see manual for details)</string>
                     </property>
                    </widget>
                   </item>
                   <item row="1" column="0">
                    <widget class="QLabel" name="label_13">
                     <property name="text">
                      <string>--proj-in</string>
                     </property>
                    </widget>
                   </item>
                  </layout>
                 </widget>
                </item>
               </layout>
              </widget>
             </widget>
            </item>
            <item>
             <widget class="QGroupBox" name="groupBox_5">
              <property name="sizePolicy">
               <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
              <property name="palette">
               <palette>
                <active>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </active>
                <inactive>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </inactive>
                <disabled>
                 <colorrole role="Button">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>240</red>
                    <green>184</green>
                    <blue>179</blue>
                   </color>
                  </brush>
                 </colorrole>
                 <colorrole role="Light">
                  <brush brushstyle="SolidPattern">
                   <color alpha="255">
                    <red>255</red>
                    <green>192</green>
                    <blue>177</blue>
                   </color>
                  </brush>
                 </colorrole>
                </disabled>
               </palette>
              </property>
              <property name="title">
               <string>Commands</string>
              </property>
              <layout class="QFormLayout" name="formLayout_2"/>
             </widget>
            </item>
           </layout>
          </widget>
         </widget>
        </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>
Share Improve this question edited Nov 21, 2024 at 18:08 musicamante 48.9k8 gold badges41 silver badges74 bronze badges asked Nov 19, 2024 at 14:02 tonitoni 4858 silver badges19 bronze badges 15
  • Please provide a MRE – eyllanesc Commented Nov 19, 2024 at 15:01
  • sorry to ask, but what is a MRE? – toni Commented Nov 19, 2024 at 15:40
  • MRE: minimal reproducible example, also read How to Ask – eyllanesc Commented Nov 19, 2024 at 15:41
  • Thank you. It do not know how I would provide a minimal working example for a QT designer file. Just sharing the ui file? – toni Commented Nov 19, 2024 at 15:43
  • in this case yes. – eyllanesc Commented Nov 19, 2024 at 15:44
 |  Show 10 more comments

1 Answer 1

Reset to default 0

Set the verticalScrollBarPolicy to ScrollBarAlwaysOn

本文标签: Qt Designer Scrollbars not showing upStack Overflow