推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
llsquaer
V2EX  ›  Python

pyqt5 列表拖拽并分类..怎么拖到的分类 item?

  •  
  •   llsquaer · Oct 16, 2020 · 1613 views
    This topic created in 2062 days ago, the information mentioned may be changed or developed.

    是这样的,想写一个拖拽内容到分类里..拖拽动作已经写好了.试了好几种方法都不完美.

    1. 方法一,分类的高度固定的.用计算高度来确定拖到的某个分类..这种方法有一个缺陷是,如果分类比较多,listwidget 出现滚动条.在计算高度的时候,分类计算就会出问题..按照我贴图片来说,永远也计算不到 分类 8 里面..
    2. 方法二, 使用 itemEntered 信号 但是在拖拽过程中,这个信号发不出来,就无法确定是哪个分类..

    请问怎么实现 拖拽到某个分类呢?

    如图. 0Hl8Bj.png

    其实感觉使用 itemEntered 最方便,但是使用不了,感觉是与拖拽事件冲突的.

    求大神指导..感谢.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5409 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:29 · PVG 16:29 · LAX 01:29 · JFK 04:29
    ♥ Do have faith in what you're doing.