Changeset 846 for trunk/tools/designer/src/components
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 191 edited
- 3 copied
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/components/buddyeditor/buddyeditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 406 406 QWidget *neighbour = 0; 407 407 switch (l->layoutDirection()) { 408 case Qt::LayoutDirectionAuto: 408 409 case Qt::LeftToRight: { // Walk right to find next managed neighbour 409 410 const int xEnd = parent->size().width(); -
trunk/tools/designer/src/components/buddyeditor/buddyeditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_instance.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_plugin.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_tool.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/buddyeditor/buddyeditor_tool.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/brushmanagerproxy.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/brushmanagerproxy.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_actionprovider.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_actionprovider.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_container.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_container.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_layoutdecoration.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/default_layoutdecoration.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/deviceprofiledialog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/deviceprofiledialog.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/dpi_chooser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/dpi_chooser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/embeddedoptionspage.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/embeddedoptionspage.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formeditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formeditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formeditor.pri
r2 r846 9 9 10 10 HEADERS += $$PWD/qdesigner_resource.h \ 11 $$PWD/qdesignerundostack.h \ 11 12 $$PWD/formwindow.h \ 12 13 $$PWD/formwindow_widgetstack.h \ … … 42 43 43 44 SOURCES += $$PWD/qdesigner_resource.cpp \ 45 $$PWD/qdesignerundostack.cpp \ 44 46 $$PWD/formwindow.cpp \ 45 47 $$PWD/formwindow_widgetstack.cpp \ -
trunk/tools/designer/src/components/formeditor/formeditor.qrc
r2 r846 64 64 <file>images/qt3logo.png</file> 65 65 <file>images/resetproperty.png</file> 66 <file>images/cleartext.png</file> 66 67 <file>images/sort.png</file> 67 68 <file>images/edit.png</file> … … 112 113 <file>images/widgets/vslider.png</file> 113 114 <file>images/widgets/vspacer.png</file> 114 <file>images/widgets/widget.png</file>115 115 <file>images/widgets/widget.png</file> 116 116 <file>images/widgets/widgetstack.png</file> -
trunk/tools/designer/src/components/formeditor/formeditor_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formeditor_optionspage.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 87 87 const IntList zoomValues = ZoomMenu::zoomValues(); 88 88 const IntList::const_iterator cend = zoomValues.constEnd(); 89 //: Zoom percentage 90 for (IntList::const_iterator it = zoomValues.constBegin(); it != cend; ++it) 89 90 for (IntList::const_iterator it = zoomValues.constBegin(); it != cend; ++it) { 91 //: Zoom percentage 91 92 m_zoomCombo->addItem(QCoreApplication::translate("FormEditorOptionsPage", "%1 %").arg(*it), QVariant(*it)); 93 } 92 94 93 95 // Layout -
trunk/tools/designer/src/components/formeditor/formeditor_optionspage.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindow.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 400 400 { 401 401 if (FormWindowManager *manager = qobject_cast<FormWindowManager*> (core()->formWindowManager())) { 402 m_commandHistory = new QUndoStack(this); 403 manager->undoGroup()->addStack(m_commandHistory); 402 manager->undoGroup()->addStack(m_undoStack.qundoStack()); 404 403 } 405 404 … … 430 429 m_currentWidget = 0; 431 430 432 connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SLOT(updateDirty())); 433 connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SIGNAL(changed())); 434 connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SLOT(checkSelection())); 431 connect(&m_undoStack, SIGNAL(changed()), this, SIGNAL(changed())); 432 connect(&m_undoStack, SIGNAL(changed()), this, SLOT(checkSelection())); 435 433 436 434 core()->metaDataBase()->add(this); … … 485 483 sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); 486 484 sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); 485 sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); 487 486 sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); 488 487 // ### generalize … … 1227 1226 ReparentWidgetCommand *cmd = new ReparentWidgetCommand(this); 1228 1227 cmd->init(w, container); 1229 m_ commandHistory->push(cmd);1230 } 1231 1232 m_ commandHistory->push(geom_cmd);1228 m_undoStack.push(cmd); 1229 } 1230 1231 m_undoStack.push(geom_cmd); 1233 1232 1234 1233 InsertWidgetCommand *cmd = new InsertWidgetCommand(this); 1235 1234 cmd->init(w, already_in_form); 1236 m_ commandHistory->push(cmd);1235 m_undoStack.push(cmd); 1237 1236 1238 1237 endCommand(); … … 1277 1276 1278 1277 QRect r = geometry; 1279 if (m_lastIndex > m_commandHistory->index())1280 m_lastIndex = -1;1281 1278 SetPropertyCommand *cmd = new SetPropertyCommand(this); 1282 1279 cmd->init(widget, QLatin1String("geometry"), r); 1283 1280 cmd->setText(tr("Resize")); 1284 m_ commandHistory->push(cmd);1281 m_undoStack.push(cmd); 1285 1282 } 1286 1283 … … 1428 1425 } 1429 1426 1430 QRect FormWindow::applyValue(const QRect &rect, int val, int key, bool size) const 1427 // ArrowKeyOperation: Stores a keyboard move or resize (Shift pressed) 1428 // operation. 1429 struct ArrowKeyOperation { 1430 ArrowKeyOperation() : resize(false), distance(0), arrowKey(Qt::Key_Left) {} 1431 1432 QRect apply(const QRect &in) const; 1433 1434 bool resize; // Resize: Shift-Key->drag bottom/right corner, else just move 1435 int distance; 1436 int arrowKey; 1437 }; 1438 1439 } // namespace 1440 1441 QT_END_NAMESPACE 1442 Q_DECLARE_METATYPE(qdesigner_internal::ArrowKeyOperation) 1443 QT_BEGIN_NAMESPACE 1444 1445 namespace qdesigner_internal { 1446 1447 QRect ArrowKeyOperation::apply(const QRect &rect) const 1431 1448 { 1432 1449 QRect r = rect; 1433 if ( size) {1434 if ( key == Qt::Key_Left || key == Qt::Key_Right)1435 r.setWidth( val);1450 if (resize) { 1451 if (arrowKey == Qt::Key_Left || arrowKey == Qt::Key_Right) 1452 r.setWidth(r.width() + distance); 1436 1453 else 1437 r.setHeight( val);1454 r.setHeight(r.height() + distance); 1438 1455 } else { 1439 if ( key == Qt::Key_Left || key == Qt::Key_Right)1440 r.moveLeft( val);1456 if (arrowKey == Qt::Key_Left || arrowKey == Qt::Key_Right) 1457 r.moveLeft(r.x() + distance); 1441 1458 else 1442 r.moveTop( val);1459 r.moveTop(r.y() + distance); 1443 1460 } 1444 1461 return r; 1445 1462 } 1446 1463 1464 QDebug operator<<(QDebug in, const ArrowKeyOperation &op) 1465 { 1466 in.nospace() << "Resize=" << op.resize << " dist=" << op.distance << " Key=" << op.arrowKey << ' '; 1467 return in; 1468 } 1469 1470 // ArrowKeyPropertyHelper: Applies a struct ArrowKeyOperation 1471 // (stored as new value) to a list of widgets using to calculate the 1472 // changed geometry of the widget in setValue(). Thus, the 'newValue' 1473 // of the property command is the relative move distance, which is the same 1474 // for all widgets (although resulting in different geometries for the widgets). 1475 // The command merging can then work as it would when applying the same text 1476 // to all QLabels. 1477 1478 class ArrowKeyPropertyHelper : public PropertyHelper { 1479 public: 1480 ArrowKeyPropertyHelper(QObject* o, SpecialProperty sp, 1481 QDesignerPropertySheetExtension *s, int i) : 1482 PropertyHelper(o, sp, s, i) {} 1483 1484 virtual Value setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask); 1485 }; 1486 1487 PropertyHelper::Value ArrowKeyPropertyHelper::setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask) 1488 { 1489 // Apply operation to obtain the new geometry value. 1490 QWidget *w = qobject_cast<QWidget*>(object()); 1491 const ArrowKeyOperation operation = qvariant_cast<ArrowKeyOperation>(value); 1492 const QRect newGeom = operation.apply(w->geometry()); 1493 return PropertyHelper::setValue(fw, QVariant(newGeom), changed, subPropertyMask); 1494 } 1495 1496 // ArrowKeyPropertyCommand: Helper factory overwritten to create 1497 // ArrowKeyPropertyHelper and a merge operation that merges values of 1498 // the same direction. 1499 class ArrowKeyPropertyCommand: public SetPropertyCommand { 1500 public: 1501 explicit ArrowKeyPropertyCommand(QDesignerFormWindowInterface *fw, 1502 QUndoCommand *p = 0); 1503 1504 void init(QWidgetList &l, const ArrowKeyOperation &op); 1505 1506 protected: 1507 virtual PropertyHelper *createPropertyHelper(QObject *o, SpecialProperty sp, 1508 QDesignerPropertySheetExtension *s, int i) const 1509 { return new ArrowKeyPropertyHelper(o, sp, s, i); } 1510 virtual QVariant mergeValue(const QVariant &newValue); 1511 }; 1512 1513 ArrowKeyPropertyCommand::ArrowKeyPropertyCommand(QDesignerFormWindowInterface *fw, 1514 QUndoCommand *p) : 1515 SetPropertyCommand(fw, p) 1516 { 1517 static const int mid = qRegisterMetaType<qdesigner_internal::ArrowKeyOperation>(); 1518 Q_UNUSED(mid) 1519 } 1520 1521 void ArrowKeyPropertyCommand::init(QWidgetList &l, const ArrowKeyOperation &op) 1522 { 1523 QObjectList ol; 1524 foreach(QWidget *w, l) 1525 ol.push_back(w); 1526 SetPropertyCommand::init(ol, QLatin1String("geometry"), qVariantFromValue(op)); 1527 1528 setText(op.resize ? FormWindow::tr("Key Resize") : FormWindow::tr("Key Move")); 1529 } 1530 1531 QVariant ArrowKeyPropertyCommand::mergeValue(const QVariant &newMergeValue) 1532 { 1533 // Merge move operations of the same arrow key 1534 if (!qVariantCanConvert<ArrowKeyOperation>(newMergeValue)) 1535 return QVariant(); 1536 ArrowKeyOperation mergedOperation = qvariant_cast<ArrowKeyOperation>(newValue()); 1537 const ArrowKeyOperation newMergeOperation = qvariant_cast<ArrowKeyOperation>(newMergeValue); 1538 if (mergedOperation.resize != newMergeOperation.resize || mergedOperation.arrowKey != newMergeOperation.arrowKey) 1539 return QVariant(); 1540 mergedOperation.distance += newMergeOperation.distance; 1541 return qVariantFromValue(mergedOperation); 1542 } 1543 1447 1544 void FormWindow::handleArrowKeyEvent(int key, Qt::KeyboardModifiers modifiers) 1448 1545 { 1449 bool startMacro = false;1450 1546 const QDesignerFormWindowCursorInterface *c = cursor(); 1451 1547 if (!c->hasSelection()) … … 1480 1576 const int newValue = calcValue(oldValue, forward, snap, snapPoint); 1481 1577 1482 const int offset = newValue - oldValue; 1483 1484 const int selCount = selection.count(); 1485 // check if selection is the same as last time 1486 if (selCount != m_moveSelection.count() || 1487 m_lastUndoIndex != m_commandHistory->index()) { 1488 m_moveSelection.clear(); 1489 startMacro = true; 1490 } else { 1491 for (int index = 0; index < selCount; ++index) { 1492 if (m_moveSelection[index]->object() != selection.at(index)) { 1493 m_moveSelection.clear(); 1494 startMacro = true; 1495 break; 1496 } 1497 } 1498 } 1499 1500 if (startMacro) 1501 beginCommand(tr("Key Move")); 1502 1503 for (int index = 0; index < selCount; ++index) { 1504 QWidget *w = selection.at(index); 1505 const QRect oldGeom = w->geometry(); 1506 const QRect geom = applyValue(oldGeom, getValue(oldGeom, key, size) + offset, key, size); 1507 1508 SetPropertyCommand *cmd = 0; 1509 1510 if (m_moveSelection.count() > index) 1511 cmd = m_moveSelection[index]; 1512 1513 if (!cmd) { 1514 cmd = new SetPropertyCommand(this); 1515 cmd->init(w, QLatin1String("geometry"), geom); 1516 cmd->setText(tr("Key Move")); 1517 m_commandHistory->push(cmd); 1518 1519 if (m_moveSelection.count() > index) 1520 m_moveSelection.replace(index, cmd); 1521 else 1522 m_moveSelection.append(cmd); 1523 } else { 1524 cmd->setNewValue(geom); 1525 cmd->redo(); 1526 } 1527 } 1528 1529 if (startMacro) { 1530 endCommand(); 1531 m_lastUndoIndex = m_commandHistory->index(); 1532 } 1578 ArrowKeyOperation operation; 1579 operation.resize = modifiers & Qt::ShiftModifier; 1580 operation.distance = newValue - oldValue; 1581 operation.arrowKey = key; 1582 1583 ArrowKeyPropertyCommand *cmd = new ArrowKeyPropertyCommand(this); 1584 cmd->init(selection, operation); 1585 m_undoStack.push(cmd); 1533 1586 } 1534 1587 … … 1631 1684 QWidget *FormWindow::innerContainer(QWidget *outerContainer) const 1632 1685 { 1633 bool isContainer = m_core->widgetDataBase()->isContainer(outerContainer); 1634 if (isContainer) 1635 if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), outerContainer)) 1636 return container->widget(container->currentIndex()); 1686 if (m_core->widgetDataBase()->isContainer(outerContainer)) 1687 if (const QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), outerContainer)) { 1688 const int currentIndex = container->currentIndex(); 1689 return currentIndex >= 0 ? 1690 container->widget(currentIndex) : 1691 static_cast<QWidget *>(0); 1692 } 1637 1693 return outerContainer; 1638 1694 } … … 1654 1710 if (!containerOfW || containerOfW == mainContainer()) 1655 1711 break; 1656 // No layouts, must be container 1712 // No layouts, must be container. No empty page-based containers. 1657 1713 containerOfW = innerContainer(containerOfW); 1714 if (!containerOfW) 1715 break; 1658 1716 if (LayoutInfo::layoutType(m_core, containerOfW) != LayoutInfo::NoLayout || !m_core->widgetDataBase()->isContainer(containerOfW)) 1659 1717 break; … … 1664 1722 1665 1723 w = innerContainer(w); 1724 if (!w) 1725 return 0; 1666 1726 if (LayoutInfo::layoutType(m_core, w) != LayoutInfo::NoLayout) 1667 1727 return 0; … … 1809 1869 InsertWidgetCommand *cmd = new InsertWidgetCommand(this); 1810 1870 cmd->init(w); 1811 m_ commandHistory->push(cmd);1871 m_undoStack.push(cmd); 1812 1872 selectWidget(w); 1813 1873 } … … 1819 1879 AddActionCommand *cmd = new AddActionCommand(this); 1820 1880 cmd->init(a); 1821 m_ commandHistory->push(cmd);1881 m_undoStack.push(cmd); 1822 1882 } 1823 1883 endCommand(); … … 1955 2015 void FormWindow::beginCommand(const QString &description) 1956 2016 { 1957 if (m_lastIndex > m_commandHistory->index()) 1958 m_lastIndex = -1; 1959 m_commandHistory->beginMacro(description); 2017 m_undoStack.beginMacro(description); 1960 2018 } 1961 2019 1962 2020 void FormWindow::endCommand() 1963 2021 { 1964 m_ commandHistory->endMacro();2022 m_undoStack.endMacro(); 1965 2023 } 1966 2024 … … 1977 2035 RaiseWidgetCommand *cmd = new RaiseWidgetCommand(this); 1978 2036 cmd->init(widget); 1979 m_ commandHistory->push(cmd);2037 m_undoStack.push(cmd); 1980 2038 } 1981 2039 endCommand(); … … 1994 2052 LowerWidgetCommand *cmd = new LowerWidgetCommand(this); 1995 2053 cmd->init(widget); 1996 m_ commandHistory->push(cmd);2054 m_undoStack.push(cmd); 1997 2055 } 1998 2056 endCommand(); … … 2375 2433 bool FormWindow::isDirty() const 2376 2434 { 2377 return m_ dirty;2435 return m_undoStack.isDirty(); 2378 2436 } 2379 2437 2380 2438 void FormWindow::setDirty(bool dirty) 2381 2439 { 2382 m_dirty = dirty; 2383 2384 if (!m_dirty) 2385 m_lastIndex = m_commandHistory->index(); 2386 } 2387 2388 void FormWindow::updateDirty() 2389 { 2390 m_dirty = m_commandHistory->index() != m_lastIndex; 2440 m_undoStack.setDirty(dirty); 2391 2441 } 2392 2442 … … 2757 2807 SetPropertyCommand *cmd = new SetPropertyCommand(this); 2758 2808 cmd->init(widget, dockWidgetAreaName, v); 2759 m_ commandHistory->push(cmd);2809 m_undoStack.push(cmd); 2760 2810 } 2761 2811 … … 2921 2971 } 2922 2972 2973 QUndoStack *FormWindow::commandHistory() const 2974 { 2975 return const_cast<QDesignerUndoStack &>(m_undoStack).qundoStack(); 2976 } 2977 2923 2978 } // namespace 2924 2979 2925 2980 QT_END_NAMESPACE 2981 -
trunk/tools/designer/src/components/formeditor/formwindow.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 45 45 #include "formeditor_global.h" 46 #include "qdesignerundostack.h" 46 47 #include <formwindowbase_p.h> 47 48 … … 65 66 class QAction; 66 67 class QMenu; 67 class QUndoStack;68 68 class QRubberBand; 69 69 … … 166 166 void unmanageWidget(QWidget *w); 167 167 168 inline QUndoStack *commandHistory() const 169 { return m_commandHistory; } 170 168 virtual QUndoStack *commandHistory() const; 171 169 void beginCommand(const QString &description); 172 170 void endCommand(); … … 239 237 private slots: 240 238 void selectionChangedTimerDone(); 241 void updateDirty();242 239 void checkSelection(); 243 240 void checkSelectionNow(); … … 264 261 int getValue(const QRect &rect, int key, bool size) const; 265 262 int calcValue(int val, bool forward, bool snap, int snapOffset) const; 266 QRect applyValue(const QRect &rect, int val, int key, bool size) const;267 263 void handleClickSelection(QWidget *managedWidget, unsigned mouseFlags); 268 264 … … 339 335 QPoint m_startPos; 340 336 341 Q UndoStack *m_commandHistory;337 QDesignerUndoStack m_undoStack; 342 338 343 339 QString m_fileName; … … 352 348 QTimer *m_checkSelectionTimer; 353 349 QTimer *m_geometryChangedTimer; 354 355 int m_dirty;356 int m_lastIndex;357 350 358 351 FormWindowWidgetStack *m_widgetStack; … … 369 362 QStringList m_includeHints; 370 363 371 QList<SetPropertyCommand*> m_moveSelection;372 int m_lastUndoIndex;373 364 QPoint m_contextMenuPosition; 374 365 -
trunk/tools/designer/src/components/formeditor/formwindow_dnditem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindow_dnditem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindow_widgetstack.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowcursor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowcursor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowmanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 193 193 case QEvent::WhatsThis: 194 194 case QEvent::WhatsThisClicked: 195 case QEvent::WinIdChange: 195 196 case QEvent::DynamicPropertyChange: 196 197 case QEvent::HoverEnter: … … 524 525 m_actionShowFormWindowSettingsDialog->setEnabled(false); 525 526 526 527 #ifdef Q_WS_X11 527 528 m_actionCopy->setIcon(QIcon::fromTheme("edit-copy", m_actionCopy->icon())); 528 529 m_actionCut->setIcon(QIcon::fromTheme("edit-cut", m_actionCut->icon())); 529 530 m_actionPaste->setIcon(QIcon::fromTheme("edit-paste", m_actionPaste->icon())); 531 m_actionDelete->setIcon(QIcon::fromTheme("edit-delete", m_actionDelete->icon())); 530 532 531 533 // These do not currently exist, but will allow theme authors to fill in the gaps … … 537 539 m_actionSplitVertical->setIcon(QIcon::fromTheme("designer-split-vertical", m_actionSplitVertical->icon())); 538 540 m_actionAdjustSize->setIcon(QIcon::fromTheme("designer-adjust-size", m_actionAdjustSize->icon())); 541 #endif 539 542 } 540 543 -
trunk/tools/designer/src/components/formeditor/formwindowmanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowsettings.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowsettings.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/formwindowsettings.ui
r651 r846 3 3 <comment>********************************************************************* 4 4 ** 5 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).5 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 6 6 ** All rights reserved. 7 7 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/iconcache.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/iconcache.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/itemview_propertysheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/itemview_propertysheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/layout_propertysheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/layout_propertysheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/line_propertysheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/line_propertysheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/previewactiongroup.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/previewactiongroup.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qdesigner_resource.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 54 54 #include "qmdiarea_container.h" 55 55 #include "qwizard_container.h" 56 #include "itemview_propertysheet.h"57 56 #include "layout_propertysheet.h" 58 57 … … 107 106 #include <QtGui/QFileDialog> 108 107 #include <QtGui/QHeaderView> 109 #include <QtGui/QTreeView>110 #include <QtGui/QTableView>111 108 #include <QtGui/QWizardPage> 112 109 #include <private/qlayoutengine_p.h> … … 1276 1273 else if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(core()->extensionManager(), widget)) 1277 1274 w = saveWidget(widget, container, ui_parentWidget); 1278 else if (QTreeView *treeView = qobject_cast<QTreeView*>(widget))1279 w = saveWidget(treeView, ui_parentWidget);1280 else if (QTableView *tableView = qobject_cast<QTableView*>(widget))1281 w = saveWidget(tableView, ui_parentWidget);1282 1275 else if (QWizardPage *wizardPage = qobject_cast<QWizardPage*>(widget)) 1283 1276 w = saveWidget(wizardPage, ui_parentWidget); … … 1549 1542 attr->setElementNumber(int(area)); 1550 1543 ui_widget->setElementAttribute(ui_widget->elementAttribute() << attr); 1551 }1552 1553 return ui_widget;1554 }1555 1556 DomWidget *QDesignerResource::saveWidget(QTreeView *treeView, DomWidget *ui_parentWidget)1557 {1558 DomWidget *ui_widget = QAbstractFormBuilder::createDom(treeView, ui_parentWidget, true);1559 1560 QDesignerPropertySheetExtension *sheet1561 = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), treeView);1562 ItemViewPropertySheet *itemViewSheet = static_cast<ItemViewPropertySheet*>(sheet);1563 1564 if (itemViewSheet) {1565 QHash<QString,QString> nameMap = itemViewSheet->propertyNameMap();1566 foreach (const QString &fakeName, nameMap.keys()) {1567 int index = itemViewSheet->indexOf(fakeName);1568 if (sheet->isChanged(index)) {1569 DomProperty *domAttr = createProperty(treeView->header(), nameMap.value(fakeName),1570 itemViewSheet->property(index));1571 domAttr->setAttributeName(fakeName);1572 ui_widget->setElementAttribute(ui_widget->elementAttribute() << domAttr);1573 }1574 }1575 }1576 1577 return ui_widget;1578 }1579 1580 DomWidget *QDesignerResource::saveWidget(QTableView *tableView, DomWidget *ui_parentWidget)1581 {1582 DomWidget *ui_widget = QAbstractFormBuilder::createDom(tableView, ui_parentWidget, true);1583 1584 QDesignerPropertySheetExtension *sheet1585 = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), tableView);1586 ItemViewPropertySheet *itemViewSheet = static_cast<ItemViewPropertySheet*>(sheet);1587 1588 if (itemViewSheet) {1589 QHash<QString,QString> nameMap = itemViewSheet->propertyNameMap();1590 foreach (const QString &fakeName, nameMap.keys()) {1591 int index = itemViewSheet->indexOf(fakeName);1592 if (sheet->isChanged(index)) {1593 DomProperty *domAttr;1594 if (fakeName.startsWith(QLatin1String("horizontal"))) {1595 domAttr = createProperty(tableView->horizontalHeader(), nameMap.value(fakeName),1596 itemViewSheet->property(index));1597 } else {1598 domAttr = createProperty(tableView->verticalHeader(), nameMap.value(fakeName),1599 itemViewSheet->property(index));1600 }1601 domAttr->setAttributeName(fakeName);1602 ui_widget->setElementAttribute(ui_widget->elementAttribute() << domAttr);1603 }1604 }1605 1544 } 1606 1545 -
trunk/tools/designer/src/components/formeditor/qdesigner_resource.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 65 65 class QToolBox; 66 66 class QToolBar; 67 class QTreeView;68 class QTableView;69 67 class QDesignerDockWidget; 70 68 class QLayoutWidget; … … 139 137 DomWidget *saveWidget(QToolBar *toolBar, DomWidget *ui_parentWidget); 140 138 DomWidget *saveWidget(QDesignerDockWidget *dockWidget, DomWidget *ui_parentWidget); 141 DomWidget *saveWidget(QTreeView *treeView, DomWidget *ui_parentWidget);142 DomWidget *saveWidget(QTableView *tableView, DomWidget *ui_parentWidget);143 139 DomWidget *saveWidget(QWizardPage *wizardPage, DomWidget *ui_parentWidget); 144 140 -
trunk/tools/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qlayoutwidget_propertysheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qmainwindow_container.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qmainwindow_container.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qmdiarea_container.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 106 106 const QSize areaSize = area->size(); 107 107 switch (QApplication::layoutDirection()) { 108 case Qt::LayoutDirectionAuto: 108 109 case Qt::LeftToRight: { 109 110 const QSize fullSize = QSize(areaSize.width() - pos.x(), areaSize.height() - pos.y()); -
trunk/tools/designer/src/components/formeditor/qmdiarea_container.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qtbrushmanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qtbrushmanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qwizard_container.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qwizard_container.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qworkspace_container.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/qworkspace_container.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/spacer_propertysheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/spacer_propertysheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/templateoptionspage.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/templateoptionspage.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/tool_widgeteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/tool_widgeteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/widgetselection.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/formeditor/widgetselection.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/lib/lib.pro
r561 r846 40 40 41 41 INCLUDEPATH += . .. \ 42 $$ QT_SOURCE_TREE/tools/designer/src/lib/components \43 $$ QT_SOURCE_TREE/tools/designer/src/lib/sdk \44 $$ QT_SOURCE_TREE/tools/designer/src/lib/extension \45 $$ QT_SOURCE_TREE/tools/designer/src/lib/uilib \46 $$ QT_SOURCE_TREE/tools/designer/src/lib/shared42 $$PWD/../../lib/components \ 43 $$PWD/../../lib/sdk \ 44 $$PWD/../../lib/extension \ 45 $$PWD/../../lib/uilib \ 46 $$PWD/../../lib/shared 47 47 48 48 include(../propertyeditor/propertyeditor.pri) -
trunk/tools/designer/src/components/lib/lib_pch.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/lib/qdesigner_components.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/objectinspector/objectinspector.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/objectinspector/objectinspector.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/objectinspector/objectinspector.pri
r561 r846 4 4 INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/findwidget 5 5 } else { 6 include( $$QT_SOURCE_TREE/tools/shared/findwidget/findwidget.pri)6 include(../../../../shared/findwidget/findwidget.pri) 7 7 } 8 8 -
trunk/tools/designer/src/components/objectinspector/objectinspector_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/objectinspector/objectinspectormodel.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/objectinspector/objectinspectormodel_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/brushpropertymanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 120 120 } 121 121 122 123 typedef QMap<int, QIcon> EnumIndexIconMap; 124 125 static void clearBrushIcons(); 126 Q_GLOBAL_STATIC_WITH_INITIALIZER(EnumIndexIconMap, brushIcons, qAddPostRoutine(clearBrushIcons)) 127 128 static void clearBrushIcons() 129 { 130 brushIcons()->clear(); 131 } 132 122 133 const BrushPropertyManager::EnumIndexIconMap &BrushPropertyManager::brushStyleIcons() 123 134 { 124 135 // Create a map of icons for the brush style editor 125 static EnumIndexIconMap rc; 126 if (rc.empty()) { 136 if (brushIcons()->empty()) { 127 137 const int brushStyleCount = sizeof(brushStyles)/sizeof(const char *); 128 138 QBrush brush(Qt::black); … … 131 141 const Qt::BrushStyle style = brushStyleIndexToStyle(i); 132 142 brush.setStyle(style); 133 rc.insert(i, QtPropertyBrowserUtils::brushValueIcon(brush));143 brushIcons()->insert(i, QtPropertyBrowserUtils::brushValueIcon(brush)); 134 144 } 135 145 } 136 return rc;146 return *(brushIcons()); 137 147 } 138 148 -
trunk/tools/designer/src/components/propertyeditor/brushpropertymanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/designerpropertymanager.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/fontmapping.xml
r651 r846 3 3 <!--************************************************************************ 4 4 ** 5 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).5 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 6 6 ** All rights reserved. 7 7 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/fontpropertymanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/fontpropertymanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/newdynamicpropertydialog.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/paletteeditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/paletteeditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/paletteeditor.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/paletteeditorbutton.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/paletteeditorbutton.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/previewframe.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/previewframe.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/previewwidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/previewwidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/previewwidget.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/propertyeditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 #include <QtGui/QActionGroup> 81 81 #include <QtGui/QLabel> 82 #include <QtGui/QPainter> 82 83 83 84 #include <QtCore/QDebug> … … 99 100 100 101 namespace qdesigner_internal { 102 103 // ----------- ElidingLabel 104 // QLabel does not support text eliding so we need a helper class 105 106 class ElidingLabel : public QWidget 107 { 108 public: 109 ElidingLabel(const QString &text = QString(), QWidget *parent = 0) 110 : QWidget(parent), 111 m_text(text), 112 m_mode(Qt::ElideRight) { 113 setContentsMargins(3, 2, 3, 2); 114 } 115 QSize sizeHint() const; 116 void paintEvent(QPaintEvent *e); 117 void setText(const QString &text) { 118 m_text = text; 119 updateGeometry(); 120 } 121 void setElidemode(Qt::TextElideMode mode) { 122 m_mode = mode; 123 updateGeometry(); 124 } 125 private: 126 QString m_text; 127 Qt::TextElideMode m_mode; 128 }; 129 130 QSize ElidingLabel::sizeHint() const 131 { 132 QSize size = fontMetrics().boundingRect(m_text).size(); 133 size += QSize(contentsMargins().left() + contentsMargins().right(), 134 contentsMargins().top() + contentsMargins().bottom()); 135 return size; 136 } 137 138 void ElidingLabel::paintEvent(QPaintEvent *) { 139 QPainter painter(this); 140 painter.setPen(QColor(0, 0, 0, 60)); 141 painter.setBrush(QColor(255, 255, 255, 40)); 142 painter.drawRect(rect().adjusted(0, 0, -1, -1)); 143 painter.setPen(palette().windowText().color()); 144 painter.drawText(contentsRect(), Qt::AlignLeft, 145 fontMetrics().elidedText(m_text, Qt::ElideRight, width(), 0)); 146 } 147 148 101 149 // ----------- PropertyEditor::Strings 102 150 … … 187 235 m_treeAction(new QAction(tr("Tree View"), this)), 188 236 m_buttonAction(new QAction(tr("Drop Down Button View"), this)), 189 m_classLabel(new QLabel),237 m_classLabel(new ElidingLabel), 190 238 m_sorting(false), 191 239 m_coloring(false), … … 223 271 actionGroup->addAction(m_buttonAction); 224 272 connect(actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotViewTriggered(QAction*))); 225 226 QWidget *classWidget = new QWidget;227 QHBoxLayout *l = new QHBoxLayout(classWidget);228 l->setContentsMargins(5, 0, 5, 0);229 l->addWidget(m_classLabel);230 273 231 274 // Add actions … … 270 313 // Assemble toolbar 271 314 QToolBar *toolBar = new QToolBar; 272 toolBar->addWidget(classWidget);273 315 toolBar->addWidget(m_filterWidget); 274 316 toolBar->addWidget(createDropDownButton(m_addDynamicAction)); … … 293 335 QVBoxLayout *layout = new QVBoxLayout(this); 294 336 layout->addWidget(toolBar); 337 layout->addWidget(m_classLabel); 338 layout->addSpacerItem(new QSpacerItem(0,1)); 295 339 layout->addWidget(m_stackedWidget); 296 340 layout->setMargin(0); … … 779 823 } 780 824 781 QString classLabelText = objectName; 782 classLabelText += QLatin1Char('\n'); 825 m_classLabel->setVisible(!objectName.isEmpty() || !className.isEmpty()); 826 m_classLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 827 828 QString classLabelText; 829 if (!objectName.isEmpty()) 830 classLabelText += objectName + QLatin1String(" : "); 783 831 classLabelText += className; 832 784 833 m_classLabel->setText(classLabelText); 785 834 m_classLabel->setToolTip(tr("Object: %1\nClass: %2").arg(objectName).arg(className)); … … 1176 1225 QVariant v; 1177 1226 qVariantSetValue(v, e); 1178 emit propertyValueChanged(property->propertyName(), v, true);1179 return; 1180 } 1181 1182 emit propertyValueChanged(property->propertyName(), value, enableSubPropertyHandling);1227 emitPropertyValueChanged(property->propertyName(), v, true); 1228 return; 1229 } 1230 1231 emitPropertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); 1183 1232 } 1184 1233 -
trunk/tools/designer/src/components/propertyeditor/propertyeditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 63 63 class QtVariantProperty; 64 64 class QtBrowserItem; 65 66 65 class QStackedWidget; 67 class QLabel;68 66 69 67 namespace qdesigner_internal { … … 73 71 class DesignerEditorFactory; 74 72 class FilterWidget; 73 class ElidingLabel; 75 74 76 75 class QT_PROPERTYEDITOR_EXPORT PropertyEditor: public QDesignerPropertyEditor … … 187 186 QAction *m_treeAction; 188 187 QAction *m_buttonAction; 189 QLabel *m_classLabel;188 ElidingLabel *m_classLabel; 190 189 191 190 bool m_sorting; -
trunk/tools/designer/src/components/propertyeditor/propertyeditor.pri
r561 r846 11 11 INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/qtgradienteditor 12 12 } else { 13 include( $$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri)14 include( $$QT_SOURCE_TREE/tools/shared/qtgradienteditor/qtcolorbutton.pri)13 include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri) 14 include(../../../../shared/qtgradienteditor/qtcolorbutton.pri) 15 15 } 16 16 … … 46 46 HEADERS += \ 47 47 $$PWD/propertyeditor_global.h \ 48 $$PWD/defs.h \49 48 $$PWD/qlonglongvalidator.h 50 49 51 SOURCES += $$PWD/defs.cpp \ 52 $$PWD/qlonglongvalidator.cpp 50 SOURCES += $$PWD/qlonglongvalidator.cpp 53 51 54 52 RESOURCES += $$PWD/propertyeditor.qrc -
trunk/tools/designer/src/components/propertyeditor/propertyeditor_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/qlonglongvalidator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/qlonglongvalidator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/stringlisteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/stringlisteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/stringlisteditor.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/stringlisteditorbutton.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/propertyeditor/stringlisteditorbutton.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/connectdialog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/connectdialog_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalslot_utils_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_instance.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditor_tool.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 64 64 #include <QtGui/QButtonGroup> 65 65 #include <QtGui/QMenu> 66 #include <QtGui/QSortFilterProxyModel> 66 67 #include <QtGui/QStandardItemModel> 67 68 #include <QtGui/QComboBox> … … 713 714 m_core(core), 714 715 m_model(new ConnectionModel(this)), 716 m_proxy_model(new QSortFilterProxyModel(this)), 715 717 m_handling_selection_change(false) 716 718 { 717 m_view->setModel(m_model); 719 m_proxy_model->setSourceModel(m_model); 720 m_view->setModel(m_proxy_model); 721 m_view->setSortingEnabled(true); 718 722 m_view->setItemDelegate(new ConnectionDelegate(this)); 719 723 m_view->setEditTriggers(QAbstractItemView::DoubleClicked … … 721 725 m_view->setRootIsDecorated(false); 722 726 m_view->setTextElideMode (Qt::ElideMiddle); 723 connect(m_view , SIGNAL(activated(QModelIndex)), this, SLOT(updateUi()));727 connect(m_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(updateUi())); 724 728 connect(m_view->header(), SIGNAL(sectionDoubleClicked(int)), m_view, SLOT(resizeColumnToContents(int))); 725 729 … … 791 795 return; 792 796 793 QModelIndex index = m_ model->connectionToIndex(con);797 QModelIndex index = m_proxy_model->mapFromSource(m_model->connectionToIndex(con)); 794 798 if (index == m_view->currentIndex()) 795 799 return; … … 809 813 return; 810 814 811 Connection *con = m_model->indexToConnection( index);815 Connection *con = m_model->indexToConnection(m_proxy_model->mapToSource(index)); 812 816 if (m_editor->selected(con)) 813 817 return; -
trunk/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 51 51 class QDesignerFormEditorInterface; 52 52 class QModelIndex; 53 class QSortFilterProxyModel; 53 54 class QTreeView; 54 55 class QToolButton; … … 85 86 QDesignerFormEditorInterface *m_core; 86 87 ConnectionModel *m_model; 88 QSortFilterProxyModel *m_proxy_model; 87 89 bool m_handling_selection_change; 88 90 }; -
trunk/tools/designer/src/components/tabordereditor/tabordereditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_instance.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_plugin.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_tool.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/tabordereditor/tabordereditor_tool.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/button_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/button_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/combobox_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/combobox_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/containerwidget_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/groupbox_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/groupbox_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/inplace_editor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/inplace_editor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/inplace_widget_helper.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/inplace_widget_helper.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/itemlisteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 115 115 116 116 static const char * const itemFlagNames[] = { 117 "Selectable",118 "Editable",119 "DragEnabled",120 "DropEnabled",121 "UserCheckable",122 "Enabled",123 "Tristate",117 QT_TRANSLATE_NOOP("AbstractItemEditor", "Selectable"), 118 QT_TRANSLATE_NOOP("AbstractItemEditor", "Editable"), 119 QT_TRANSLATE_NOOP("AbstractItemEditor", "DragEnabled"), 120 QT_TRANSLATE_NOOP("AbstractItemEditor", "DropEnabled"), 121 QT_TRANSLATE_NOOP("AbstractItemEditor", "UserCheckable"), 122 QT_TRANSLATE_NOOP("AbstractItemEditor", "Enabled"), 123 QT_TRANSLATE_NOOP("AbstractItemEditor", "Tristate"), 124 124 0 125 125 }; 126 126 127 127 static const char * const checkStateNames[] = { 128 "Unchecked",129 "PartiallyChecked",130 "Checked",128 QT_TRANSLATE_NOOP("AbstractItemEditor", "Unchecked"), 129 QT_TRANSLATE_NOOP("AbstractItemEditor", "PartiallyChecked"), 130 QT_TRANSLATE_NOOP("AbstractItemEditor", "Checked"), 131 131 0 132 132 }; … … 136 136 QStringList out; 137 137 for (int i = 0; in[i]; i++) 138 out << QLatin1String(in[i]);138 out << AbstractItemEditor::tr(in[i]); 139 139 return out; 140 140 } -
trunk/tools/designer/src/components/taskmenu/itemlisteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/itemlisteditor.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/label_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/label_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/layouttaskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/layouttaskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/lineedit_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/lineedit_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/listwidget_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/listwidget_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/listwidgeteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/listwidgeteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/menutaskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/menutaskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/tablewidget_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/tablewidgeteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/tablewidgeteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/tablewidgeteditor.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/taskmenu_component.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/taskmenu_component.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/taskmenu_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/textedit_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/textedit_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/toolbar_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/toolbar_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/treewidget_taskmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/treewidgeteditor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/treewidgeteditor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/taskmenu/treewidgeteditor.ui
r651 r846 2 2 <comment>********************************************************************* 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetbox.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 75 75 filterWidget->setRefuseFocus(true); 76 76 connect(filterWidget, SIGNAL(filterChanged(QString)), m_view, SLOT(filter(QString))); 77 l->addWidget(filterWidget); 77 78 QToolBar *toolBar = new QToolBar(this); 79 toolBar->addWidget(filterWidget); 80 l->addWidget(toolBar); 78 81 79 82 // View -
trunk/tools/designer/src/components/widgetbox/widgetbox.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetbox.xml
r651 r846 2 2 <!--************************************************************************ 3 3 ** 4 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).4 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 5 5 ** All rights reserved. 6 6 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetbox_dnditem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetbox_dnditem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetbox_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 89 89 struct WidgetBoxCategoryEntry { 90 90 WidgetBoxCategoryEntry(); 91 explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, const QIcon &icon, bool editable); 91 explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, 92 const QString &filter, 93 const QIcon &icon, 94 bool editable); 92 95 93 96 QDesignerWidgetBoxInterface::Widget widget; 94 97 QString toolTip; 95 98 QString whatsThis; 99 QString filter; 96 100 QIcon icon; 97 101 bool editable; … … 104 108 } 105 109 106 WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, const QIcon &i, bool e) : 110 WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, 111 const QString &filterIn, 112 const QIcon &i, bool e) : 107 113 widget(w), 114 filter(filterIn), 108 115 icon(i), 109 116 editable(e) … … 143 150 typedef QList<WidgetBoxCategoryEntry> WidgetBoxCategoryEntrys; 144 151 152 QRegExp m_classNameRegExp; 145 153 QDesignerFormEditorInterface *m_core; 146 154 WidgetBoxCategoryEntrys m_items; … … 150 158 WidgetBoxCategoryModel::WidgetBoxCategoryModel(QDesignerFormEditorInterface *core, QObject *parent) : 151 159 QAbstractListModel(parent), 160 m_classNameRegExp(QLatin1String("<widget +class *= *\"([^\"]+)\"")), 152 161 m_core(core), 153 162 m_viewMode(QListView::ListMode) 154 163 { 164 Q_ASSERT(m_classNameRegExp.isValid()); 155 165 } 156 166 … … 206 216 void WidgetBoxCategoryModel::addWidget(const QDesignerWidgetBoxInterface::Widget &widget, const QIcon &icon,bool editable) 207 217 { 208 // build item 209 WidgetBoxCategoryEntry item(widget, icon, editable); 218 // build item. Filter on name + class name if it is different and not a layout. 219 QString filter = widget.name(); 220 if (!filter.contains(QLatin1String("Layout")) && m_classNameRegExp.indexIn(widget.domXml()) != -1) { 221 const QString className = m_classNameRegExp.cap(1); 222 if (!filter.contains(className)) 223 filter += className; 224 } 225 WidgetBoxCategoryEntry item(widget, filter, icon, editable); 210 226 const QDesignerWidgetDataBaseInterface *db = m_core->widgetDataBase(); 211 227 const int dbIndex = db->indexOfClassName(widget.name()); … … 256 272 return QVariant(item.whatsThis); 257 273 case FilterRole: 258 return item. widget.name();274 return item.filter; 259 275 } 260 276 return QVariant(); -
trunk/tools/designer/src/components/widgetbox/widgetboxcategorylistview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/designer/src/components/widgetbox/widgetboxtreewidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.