i am working on this task right, and as usual I require a bit of support.
First i want to renable zinis code. But how do i add the new subview? Clearly i need to use signal from the table and pass it through the tablesubview to the view. But where to connect? The only place that seems to make sense seems to be the moment of creation of the subview. Is that correct aproach?
Dialogue Sub-Views
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue Sub-Views
oh well, i just did this. Zinis code is enabled, i will try to work on that.
Re: Dialogue Sub-Views
Sorry for the late reply. Was kinda busy.
You add new subviews by registering a suitable sub view factory in apps/opencs/view/world/subviews.cpp. Everything else is already taken care of.
Also, careful with my branch. I ran into a dead end there. You might be able to make it work, but I wouldn't bet on it.
You add new subviews by registering a suitable sub view factory in apps/opencs/view/world/subviews.cpp. Everything else is already taken care of.
Also, careful with my branch. I ran into a dead end there. You might be able to make it work, but I wouldn't bet on it.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue Sub-Views
hmmm, i didn't knew that, so i did this manually. I will leave this for now.You add new subviews by registering a suitable sub view factory in apps/opencs/view/world/subviews.cpp. Everything else is already taken care of.
Well, i think that i will be able to find some kind of solution.Also, careful with my branch. I ran into a dead end there. You might be able to make it work, but I wouldn't bet on it.
Re: Dialogue Sub-Views
Not a good idea, because that will inevitably break things. There are multiple sources for view request for sub views. And they all go through the established system. If you use your own method, you will miss some of these.hmmm, i didn't knew that, so i did this manually. I will leave this for now.
Looking forward to that. I am very interested in what you can come up with here.Well, i think that i will be able to find some kind of solution.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue Sub-Views
sorry for disapointment but as it seems my understandig of the problem is insufficiant, or even completly wrong.
As i found, out, the data function returns the empty variant for the non editable fields. Why is that? How table itself is able to retrive the information?
Code: Select all
QVariant CSMWorld::IdTable::data (const QModelIndex & index, int role) const
{
if (role!=Qt::DisplayRole && role!=Qt::EditRole)
return QVariant();
if (role==Qt::EditRole && !mIdCollection->getColumn (index.column()).isEditable())
return QVariant();
return mIdCollection->getData (index.row(), index.column());
}
Re: Dialogue Sub-Views
This is just for editing (Qt:EditRole). For display purpose (Qt::DisplayRole) you get the value of the cell just fine.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue Sub-Views
ok, i have no idea how to register the new subview.
manager.add (CSMWorld::UniversalId::Type_Dialog, new CSVDoc::SubViewFactory<DialogueSubView>);
this is clearly wrong (yes, i added the new type). I dont know how this thing works so help is welcome.
manager.add (CSMWorld::UniversalId::Type_Dialog, new CSVDoc::SubViewFactory<DialogueSubView>);
this is clearly wrong (yes, i added the new type). I dont know how this thing works so help is welcome.
Re: Dialogue Sub-Views
That is exactly how it should work, except that you are not supposed to make a new type. The types for individual records already exist.
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue Sub-Views
manager.add (CSMWorld::UniversalId::Type_Cells, new CSVDoc::SubViewFactory<DialogueSubView>);
Like this? This won't work because
assert (mSubViewFactories.find (id)==mSubViewFactories.end());
fails.
I'm runing in circles right now. Frustraiting.
Like this? This won't work because
assert (mSubViewFactories.find (id)==mSubViewFactories.end());
fails.
I'm runing in circles right now. Frustraiting.