QT笔记 -- (1) .ui文件

刚开始写QT,designer用的不习惯,打开.ui文件看了一下,很容易读的xml文件,记录一下。

大体框架如下

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>HelloQTClass</class>
 <widget class="QMainWindow" name="HelloQTClass">
  <!--一些属性-->
  <property name="geometry"> ... </property>
  <property name="windowTitle"> ... </property>

  <!--主要控件,包括布局管理器-->
  <widget class="QWidget" name="centralWidget">...</widget>

  <!--菜单栏-->
  <widget class="QMenuBar" name="menuBar">...</widget>

  <!--工具栏-->
  <widget class="QToolBar" name="mainToolBar">...</widget>

  <!--状态栏-->
  <widget class="QStatusBar" name="statusBar"/>

  <!--action-->
  <action name="actionOpen">
   <property name="text">
    <string>open</string>
   </property>
  </action>
 </widget>
 
 <layoutdefault spacing="6" margin="11"/>
 
 <resources>
  <include location="HelloQT.qrc"/>
 </resources>
 
 <!--事件以及响应-->
 <connections>
  <connection>
   <sender>actionOpen</sender>
   <signal>triggered()</signal>
   <receiver>HelloQTClass</receiver>
   <slot>open()</slot>
   <hints>...</hints>
  </connection>
 </connections>
 
 <!--槽的定义-->
 <slots>
  <slot>open()</slot>
 </slots>

</ui>

 

转载于:https://www.cnblogs.com/redips-l/p/6993496.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值