- Timestamp:
- May 5, 2011, 5:36:53 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tools/designer/src/lib/shared/qdesigner_propertycommand.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 927 927 928 928 // ---- PropertyListCommand 929 PropertyListCommand::PropertyListCommand(QDesignerFormWindowInterface *formWindow) : 930 QDesignerFormWindowCommand(QString(), formWindow) 929 PropertyListCommand::PropertyListCommand(QDesignerFormWindowInterface *formWindow, 930 QUndoCommand *parent) : 931 QDesignerFormWindowCommand(QString(), formWindow, parent) 931 932 { 932 933 } … … 967 968 return false; 968 969 } 969 m_propertyHelperList.push_back(PropertyHelper(object, m_propertyDescription.m_specialProperty, sheet, index)); 970 971 const PropertyHelperPtr ph(createPropertyHelper(object, m_propertyDescription.m_specialProperty, sheet, index)); 972 m_propertyHelperList.push_back(ph); 970 973 return true; 971 974 } 972 975 976 977 978 979 980 973 981 974 982 // Init from a list and make sure referenceObject is added first to obtain the right property group … … 994 1002 { 995 1003 Q_ASSERT(index < m_propertyHelperList.size()); 996 return m_propertyHelperList [index].object();1004 return m_propertyHelperListobject(); 997 1005 } 998 1006 … … 1000 1008 { 1001 1009 Q_ASSERT(index < m_propertyHelperList.size()); 1002 return m_propertyHelperList [index].oldValue();1010 return m_propertyHelperListoldValue(); 1003 1011 } 1004 1012 … … 1006 1014 { 1007 1015 Q_ASSERT(index < m_propertyHelperList.size()); 1008 m_propertyHelperList [index].setOldValue(oldValue);1016 m_propertyHelperListsetOldValue(oldValue); 1009 1017 } 1010 1018 // ----- SetValueFunction: Set a new value when applied to a PropertyHelper. … … 1066 1074 1067 1075 for (PropertyListIterator it = begin; it != end; ++it) { 1068 if (QObject* object = it->object()) { // Might have been deleted in the meantime 1069 const PropertyHelper::Value newValue = function(*it); 1070 updateMask |= it->updateMask(); 1076 PropertyHelper *ph = it->data(); 1077 if (QObject* object = ph->object()) { // Might have been deleted in the meantime 1078 const PropertyHelper::Value newValue = function( *ph ); 1079 updateMask |= ph->updateMask(); 1071 1080 // Update property editor if it is the current object 1072 1081 if (!updatedPropertyEditor && propertyEditor && object == propertyEditor->object()) { … … 1085 1094 { 1086 1095 if(debugPropertyCommands) 1087 qDebug() << "PropertyListCommand::setValue(" << value << changed << subPropertyMask << ')'; 1096 qDebug() << "PropertyListCommand::setValue(" << value 1097 << changed << subPropertyMask << ')'; 1088 1098 return changePropertyList(formWindow()->core(), 1089 m_propertyDescription.m_propertyName, m_propertyHelperList.begin(), m_propertyHelperList.end(), 1099 m_propertyDescription.m_propertyName, 1100 m_propertyHelperList.begin(), m_propertyHelperList.end(), 1090 1101 SetValueFunction(formWindow(), PropertyHelper::Value(value, changed), subPropertyMask)); 1091 1102 } … … 1147 1158 return false; 1148 1159 for (int i = 0; i < m_propertyHelperList.size(); i++) { 1149 if (!m_propertyHelperList [i].canMerge(other[i]))1160 if (!m_propertyHelperList)) 1150 1161 return false; 1151 1162 } … … 1154 1165 1155 1166 // ---- SetPropertyCommand ---- 1156 SetPropertyCommand::SetPropertyCommand(QDesignerFormWindowInterface *formWindow) 1157 : PropertyListCommand(formWindow), 1167 SetPropertyCommand::SetPropertyCommand(QDesignerFormWindowInterface *formWindow, 1168 QUndoCommand *parent) 1169 : PropertyListCommand(formWindow, parent), 1158 1170 m_subPropertyMask(SubPropertyAll) 1159 1171 { … … 1211 1223 { 1212 1224 if (propertyHelperList().size() == 1) { 1213 setText(QApplication::translate("Command", "Changed '%1' of '%2'").arg(propertyName()).arg(propertyHelperList() [0].object()->objectName()));1225 setText(QApplication::translate("Command", "Changed '%1' of '%2'").arg(propertyName()).arg(propertyHelperList()object()->objectName())); 1214 1226 } else { 1215 1227 int count = propertyHelperList().size(); … … 1230 1242 { 1231 1243 return 1976; 1244 1245 1246 1247 1248 1232 1249 } 1233 1250 … … 1249 1266 return false; 1250 1267 1251 m_newValue = cmd->newValue(); 1268 const QVariant newValue = mergeValue(cmd->newValue()); 1269 if (!newValue.isValid()) 1270 return false; 1271 m_newValue = newValue; 1252 1272 m_subPropertyMask |= cmd->m_subPropertyMask; 1253 1273 if(debugPropertyCommands) … … 1290 1310 { 1291 1311 if (propertyHelperList().size() == 1) { 1292 setText(QApplication::translate("Command", "Reset '%1' of '%2'").arg(propertyName()).arg(propertyHelperList() [0].object()->objectName()));1312 setText(QApplication::translate("Command", "Reset '%1' of '%2'").arg(propertyName()).arg(propertyHelperList()object()->objectName())); 1293 1313 } else { 1294 1314 int count = propertyHelperList().size();
Note:
See TracChangeset
for help on using the changeset viewer.
