通过PyQt5编写天气预报界面程序

阅读: 评论:0

通过PyQt5编写天⽓预报界⾯程序1:通过Qt Designer设计WeatherWin.ui界⾯
a:到Library/bin下的Qt设计器,点击designer,启动Qt设计器
b:启动之后是这样的
标题
c:新建窗体中选第⼀个,然后创建好后如下。
d:上图界⾯的所有控件详细清单如下:
e:weatherComboBox中的详细信息如下:
f:定义好两个按钮的信号与槽函数如下
g:两个槽函数要⾃⼰定义好,如下
h:WeatherWin.ui界⾯代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>581</width>
<height>358</height>桂林漓江游船怎么坐最合适
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>桂林旅游详细攻略
<widget class="QPushButton" name="QueryBtn">  <property name="geometry">
<rect>
<x>100</x>
<y>310</y>
<width>75</width>
<height>23</height>
</rect>
御温泉度假村攻略
</property>
<property name="text">
<string>查询</string>
</property>
</widget>
<widget class="QPushButton" name="clearBtn">  <property name="geometry">
<property name="geometry">
<rect>
<x>420</x>
<y>310</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
承德避暑山庄一日游
<string>清空</string>
</property>
</widget>
<widget class="QTextEdit" name="resultText">
<property name="geometry">
<rect>
<x>50</x>
<y>110</y>
<width>491</width>
<height>181</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>查询城市天⽓</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>城市</string>
</property>
</widget>
<widget class="QComboBox" name="weatherComboBox">  <property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
报旅行团旅游<rect>
<x>100</x>
<y>40</y>
<width>361</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="duplicatesEnabled">
<bool>true</bool>
</property>
</property>
<item>
<property name="text">
<string>上海</string>
</property>
</item>
<item>
<property name="text">
<string>北京</string>
</property>
</item>
<item>
<property name="text">
<string>天津</string>
</property>
</item>
<item>
<property name="text">
<string>桂林</string>
</property>
</item>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>QueryBtn</sender>  <signal>clicked()</signal>
<receiver>Dialog</receiver>  <slot>QueryWeather()</slot>  <hints>
<hint type="sourcelabel">
<x>121</x>
<y>314</y>
</hint>
<hint type="destinationlabel">    <x>219</x>
<y>335</y>
</hint>
</hints>
</connection>
<connection>
<sender>clearBtn</sender>  <signal>clicked()</signal>
<receiver>Dialog</receiver>  <slot>clearResult()</slot>
<hints>
<hint type="sourcelabel">
<x>437</x>
<y>319</y>
</hint>
<hint type="destinationlabel">    <x>512</x>
<y>338</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>QueryWeather()</slot>  <slot>clearResult()</slot>
重庆好玩地方排名榜免费</slots>
</ui>

本文发布于:2023-08-26 21:34:37,感谢您对本站的认可!

本文链接:http://www.035400.com/whly/4/218021.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:预报   攻略   排名榜   好玩   地方   旅游   设计
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2024-2030 Comsenz Inc.Powered by © 文化旅游网 滇ICP备2022007236号-403 联系QQ:1103060800网站地图