Skip to content

Make OBS UI Elements Accessible for KITE Tests

ludocosmo edited this page Feb 23, 2021 · 13 revisions

Main Window Buttons

OBS Main Window Buttons

Buttons "Start Streaming" and "Start Recording" are not accessible to KITE because they are checkable. To make them accessible to KITE, just remove the "checkable" property from file UI/forms/OBSBasic.ui

Diff UI/forms/OBSBasic.ui

Settings Buttons

Settings Buttons

Original widgets shown on the left are not buttons but a list of widgets in a QListWidget object which are not accessible to KITE. This QLisWidget object will be replaced by a QButtonGroup container which will contain QPushButtons, those push buttons are accessible to KITE.

File UI/forms/OBSBasicSettings.ui

Old version (to be removed)

      <widget class="QListWidget" name="listWidget">
       <property name="sizePolicy">
        <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
         <horstretch>0</horstretch>
         <verstretch>0</verstretch>
        </sizepolicy>
       </property>
       <property name="maximumSize">
        <size>
         <width>135</width>
         <height>16777215</height>
        </size>
       </property>
       <property name="iconSize">
        <size>
         <width>32</width>
         <height>32</height>
        </size>
       </property>
       <property name="currentRow">
        <number>0</number>
       </property>
       <item>
        <property name="text">
         <string>Basic.Settings.General</string>
        </property>
        <property name="icon">
         <iconset resource="obs.qrc">
          <normaloff>:/settings/images/settings/general.svg</normaloff>:/settings/images/settings/general.svg</iconset>
        </property>
       </item>
       <item>
        <property name="text">
         <string>Basic.Settings.Stream</string>
        </property>
        [...]
       </item>
       [...]
      </widget>

New version for KITE (to de added)

Note that each new QPushButton is added to a QButtonGroup through the attribute "buttongroup" having the name "basicSettingsButtonGroup".

       <item>
        <widget class="QPushButton" name="SettingsGeneralButton">
         <property name="text">
          <string>Basic.Settings.General</string>
         </property>
         <property name="icon">
          <iconset resource="obs.qrc">
           <normaloff>:/settings/images/settings/general.svg</normaloff>:/settings/images/settings/general.svg</iconset>
         </property>
         <attribute name="buttonGroup">
          <string notr="true">basicSettingsButtonGroup</string>
         </attribute>
        </widget>
       </item>
       <item>
        <widget class="QPushButton" name="SettingsStreamButton">
         <property name="text">
          <string>Basic.Settings.Stream</string>
         </property>
         <property name="icon">
          <iconset resource="obs.qrc">
           <normaloff>:/settings/images/settings/stream.svg</normaloff>:/settings/images/settings/stream.svg</iconset>
         </property>
         <attribute name="buttonGroup">
          <string notr="true">basicSettingsButtonGroup</string>
         </attribute>
        </widget>
       </item>
       <item>
        [...]
       </item>

At the end of file UI/forms/OBSBasicSettings.ui add a new entry in the <connections> section for the "basicSettingsButtonGroup".

 <connections>
  [...]
  <connection>
   <sender>basicSettingsButtonGroup</sender>
   <signal>buttonClicked(int)</signal>
   <receiver>settingsPages</receiver>
   <slot>setCurrentIndex(int)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>-1</x>
     <y>-1</y>
    </hint>
    <hint type="destinationlabel">
     <x>20</x>
     <y>20</y>
    </hint>
   </hints>
  </connection>
 </connections> 

Finally do not forget to add the new "basicSettingsButtonGroup" to the <buttongroups> section at the very end of file UI/forms/OBSBasicSettings.ui (if section <buttongroups> does not exist yet, create it after the end of section <connections>).

 </connections> 
 <buttongroups>
  [...]
  <buttongroup name="basicSettingsButtonGroup"/>
 </buttongroups>
</ui>
Clone this wiki locally