我有 QLineEdit , 2 QPush buttons (添加和删除按钮)和 QListView . QListView 时 QListView QLineEdit will gets added 中输入的文字 . 如果我选择 Item from the QListView 中的任何一个并单击 Remove Button ,则将删除所选项目 . 我完成了这些事情并且工作正常 . Now i want to add a another QListView and if am Double clicking the QListView Items (QListView 1) the items should be transfered (QListView 1中的项目应该完全删除) to the new QListView (QListView 2) and vice versa. plz帮我提出建议 . 提前致谢 .
2 回答
Example.h
Example.cpp
更可扩展的方法是创建自定义模型(如果符合您的需要,可能继承
QStringListModel
),然后实现moveRows
和/或拖放工具 .