查看完整版本: [-- QListView 怎么拖动不了? --]

QTCN开发网 -> Qt基础编程 -> QListView 怎么拖动不了? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

zoemolly 2018-05-19 15:56

QListView 怎么拖动不了?



void ListView(QWidget *parent) : QListView(parent)
{
    model->initItems();
    this->setModel(model);
    this->setItemDelegate(delegate);

    setDragEnabled(true);
    setAcceptDrops(true);
    setDropIndicatorShown(true);

}

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dragMoveEvent(QDragMoveEvent *event);
    void dropEvent(QDropEvent *event);
    void startDrag(Qt::DropActions supportedActions);

只能接受dropEvent 事件。其他三个事件都触发不了,有可能是什么原因导致? Model?

jigetage 2018-05-23 12:04
看一下delegeta里面的editorEvent是不是做过什么处理


查看完整版本: [-- QListView 怎么拖动不了? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled