mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 11:26:37 +00:00 
			
		
		
		
	handle also bool boxes
This commit is contained in:
		
							parent
							
								
									08ccae6b49
								
							
						
					
					
						commit
						9612c6a6fd
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		|  | @ -37,7 +37,10 @@ mIndexWrapper(NULL) | ||||||
| 
 | 
 | ||||||
| void CSVWorld::DialogueDelegateDispatcherProxy::editorDataCommited() | void CSVWorld::DialogueDelegateDispatcherProxy::editorDataCommited() | ||||||
| { | { | ||||||
|     emit editorDataCommited(mEditor, mIndexWrapper->mIndex, mDisplay); |     if (mIndexWrapper.get()) | ||||||
|  |     { | ||||||
|  |         emit editorDataCommited(mEditor, mIndexWrapper->mIndex, mDisplay); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void CSVWorld::DialogueDelegateDispatcherProxy::setIndex(const QModelIndex& index) | void CSVWorld::DialogueDelegateDispatcherProxy::setIndex(const QModelIndex& index) | ||||||
|  | @ -79,7 +82,6 @@ CSVWorld::CommandDelegate* CSVWorld::DialogueDelegateDispatcher::makeDelegate(CS | ||||||
| 
 | 
 | ||||||
| void CSVWorld::DialogueDelegateDispatcher::editorDataCommited(QWidget* editor, const QModelIndex& index, CSMWorld::ColumnBase::Display display) | void CSVWorld::DialogueDelegateDispatcher::editorDataCommited(QWidget* editor, const QModelIndex& index, CSMWorld::ColumnBase::Display display) | ||||||
| { | { | ||||||
|     std::cout<<"triggered"<<std::endl; |  | ||||||
|     setModelData(editor, mTable, index, display); |     setModelData(editor, mTable, index, display); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -125,6 +127,11 @@ QSize CSVWorld::DialogueDelegateDispatcher::sizeHint (const QStyleOptionViewItem | ||||||
| QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::Display display, const QModelIndex& index) | QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::Display display, const QModelIndex& index) | ||||||
| { | { | ||||||
|     bool hasEnums = CSMWorld::Columns::hasEnums(static_cast<CSMWorld::Columns::ColumnId>(mTable->getColumnId(index.column() ) ) ); |     bool hasEnums = CSMWorld::Columns::hasEnums(static_cast<CSMWorld::Columns::ColumnId>(mTable->getColumnId(index.column() ) ) ); | ||||||
|  |     if (display == CSMWorld::ColumnBase::Display_Boolean) | ||||||
|  |     { | ||||||
|  |         hasEnums = true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     QWidget* editor = NULL; |     QWidget* editor = NULL; | ||||||
|     std::map<int, CommandDelegate*>::iterator delegateIt(mDelegates.find(display)); |     std::map<int, CommandDelegate*>::iterator delegateIt(mDelegates.find(display)); | ||||||
|     if (delegateIt != mDelegates.end()) |     if (delegateIt != mDelegates.end()) | ||||||
|  | @ -133,7 +140,7 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase:: | ||||||
|         DialogueDelegateDispatcherProxy* proxy = new DialogueDelegateDispatcherProxy(editor, display); |         DialogueDelegateDispatcherProxy* proxy = new DialogueDelegateDispatcherProxy(editor, display); | ||||||
|         if (hasEnums) //combox is used for all enums
 |         if (hasEnums) //combox is used for all enums
 | ||||||
|         { |         { | ||||||
|             connect(editor, SIGNAL(currentIndexChanged ( int)), proxy, SLOT(editorDataCommited())); |             connect(editor, SIGNAL(currentIndexChanged (int)), proxy, SLOT(editorDataCommited())); | ||||||
|         } else |         } else | ||||||
|         { |         { | ||||||
|             connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited())); |             connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited())); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue