I have implemented a model through which I display using the view some numbers...
This means you subclassed QAbstractItemModel(or one of its subclasses).
QAbstractItemView::model() returns a QAbstractItemModel.
Therefore, if your model is called MyCustomModel, in order to access specific methods of this type, you must cast the QAbstractItemModel returned by model() to MyCustomModel.
For example, you can do this in the view:
MyCustomModel * myModel = dynamic_cast<MyCustomModel*>(model());
if(myModel)
{
myModel->setMode(decOrHex); //switch to one of the two display modes
}
...
MyCustomModel * myModel = dynamic_cast<MyCustomModel*>(model());
if(myModel)
{
myModel->setMode(decOrHex); //switch to one of the two display modes
}
...
To copy to clipboard, switch view to plain text mode
Bookmarks