看板 Python 關於我們 聯絡資訊
目前參考了網路上的一個簡單的程式碼,如下圖所示 https://imgur.com/Drtjpn0 def set_pixmap(self): self.ui.piclabel.setPixmap(self.pic_path) def get_movie_info(self, htmlx): self.movie_info = htmlx.xpath("//div[@class='intro-box-txt']/p[2]/text()")[0] self.ui.episodeinfo.setText(self.movie_info) def get_episode(self, htmlx): self.episode_name = htmlx.xpath('//div[@id="ji_show_1_0"]/div[@class="drama_page"]/a/text()') self.episode_href = htmlx.xpath('//div[@id="ji_show_1_0"]/div[@class="drama_page"]/a/@href') def set_episodelist(self): qlist = QStringListModel() qlist.setStringList(self.episode_name) self.ui.episodelist.setModel(qlist) 其中加入圖片 使用setPixmap方法 ,顯示文字使用setText,確認數據用setModel 目前有以下兩個問題: 1.假設我現在想寫一個加入圖片的功能,該如何查到使用setPixmap這個方法 加入圖片功能百百種,add也可以,但是如何在茫茫碼海找到,用這樣的字典嗎? 或是如何在官方的操作手冊查詢到? 謝謝! 想詢問經歷多年的前輩! 2.QStringListModel()這個方法,網路上都沒有找到使用例子 想精準知道這個方法的使用時機? 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.137.18.82 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1642690125.A.67B.html
lycantrope: IDE可以直接點擊查看source 01/20 23:50
chickengod: linux 可以 cd 到原始碼資料夾 01/21 02:43
chickengod: grep -ir "文字" 01/21 02:43
chickengod: 搜尋符合的字串 也支援 regex 01/21 02:43
chickengod: 符合結果太多也可以過濾掉不想要的 01/21 02:52
chickengod: grep -r "do" | grep -v "dont\|not" 01/21 02:52