You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

尝试创建boxed-list时无法找到Adw.EntryRow类的问题求助

问题:无法找到AdwEntryRow类,无法创建对应boxed-list

我尝试按照libadwaita官方文档创建包含AdwEntryRow的boxed-list,但在Adw库中找不到该类。通过调试查看Adw模块中的Row相关类,输出如下:

(Pdb) Adw
<IntrospectionModule 'Adw' from '/usr/lib64/girepository-1.0/Adw-1.typelib'>
(Pdb) [x for x in dir(Adw) if "Row" in x]
['ActionRow', 'ActionRowClass', 'ComboRow', 'ComboRowClass', 'ExpanderRow', 'ExpanderRowClass', 'PreferencesRow', 'PreferencesRowClass']

当前依赖版本:

pygobject       3.42.2 Python bindings for GObject Introspection

已安装的adwaita相关包:

dnf list --installed | grep adwaita
adwaita-cursor-theme.noarch                          42.0-1.fc36                         @anaconda                                               
adwaita-gtk2-theme.x86_64                            3.28-14.fc36                        @fedora                                                 
adwaita-icon-theme.noarch                            42.0-1.fc36                         @anaconda                                               
adwaita-qt5.x86_64                                   1.4.2-1.fc36                        @updates                                                
adwaita-qt6.x86_64                                   1.4.2-1.fc36                        @updates                                                
libadwaita.x86_64                                    1.1.4-1.fc36                        @updates                                                
libadwaita-qt5.x86_64                                1.4.2-1.fc36                        @updates                                                
libadwaita-qt6.x86_64                                1.4.2-1.fc36                        @updates       

原因分析

AdwEntryRow是libadwaita 1.2版本才新增的组件,当前系统安装的libadwaita版本为1.1.4,低于该类的最低要求版本,因此无法在Adw模块中找到它。

解决办法

  • 更新libadwaita至1.2及以上版本,在Fedora系统中执行以下命令:
sudo dnf update libadwaita
  • 版本更新完成后,重新运行代码即可正常调用AdwEntryRow类。

内容的提问来源于stack exchange,提问作者Shake0

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 03:45:31