c++ - Where should I reimplement QAbstractItemModel::supportedDragActions()? -


I am moving the project from QT 4.x to 5, and the next function is obsolete: < Pre> model & gt; SetSupportedDragActions (QT :: MoveAction); I have researched and apparently I had the same problem with the function to recompile / support the virtual one supported dragging () function and solve it. My newbie is a question, how should I change this kind of work again? In Qabstractitemmodel.h / cpp?

Thank you:

Edit: I have implemented the function in my CPP, which is set just above the function, which call set up supported drawings (), From:

  mapmodulelist.cpp: Zero QAbstractItemModel :: setSupportedDragActions (Qt :: DropActions verb) {Q_D (QAbstractItemModel); d-> Supported dragaction = verbs; } Zero MapModuleList :: setupModel () {if (mapLayersModel == faucet) {mapLayersModel = New QStandardItemModel (0); MapLayersModel - & gt; Set Supported Dractions (Qt :: MoveAction); }}   

mapLayersModel is a member of this class, this is its announcement:

  Fixed QStandardItemModel * mapLayersModel;   

I also had to add a header to qabstractitemmodel.h:

  zero set: imported dragaction (QT :: drop action action);   

I get further errors: Invalid use of type 'Class QAbstractItemModelPrivate' d-> Supported dragaction = verbs; ^

and

  class QAbstractItemModelPrivate 'class forwarding announcement QAbstractItemModelPrivate; ^   

I have to do something wrong.

You need your model subclass, i.e. in the same class where you are obsolete In implementing the setSupportedDragActions () function, in order to implement (rather override) this virtual function, it is only necessary if you need drag and drop functionality for your ideas.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -