Changeset 769 for trunk/tools/designer/src/lib/shared
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/tools/designer/src/lib/shared/actioneditor.cpp
r651 r769 429 429 } 430 430 431 // Set an in tial property and mark it as changed in the sheet431 // Set an initial property and mark it as changed in the sheet 432 432 static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value) 433 433 { -
trunk/tools/designer/src/lib/shared/actionrepository.cpp
r651 r769 78 78 } 79 79 80 static QIcon fixActionIcon(const QIcon &icon)81 {82 if (icon.isNull())83 return qdesigner_internal::emptyIcon();84 return icon;85 }86 87 80 namespace qdesigner_internal { 88 81 … … 90 83 ActionModel::ActionModel(QWidget *parent ) : 91 84 QStandardItemModel(parent), 85 m_emptyIcon(emptyIcon()), 92 86 m_core(0) 93 87 { … … 128 122 list += item(row, i); 129 123 130 setItems(m_core, actionOfItem(list.front()), list);124 setItems(m_core, actionOfItem(list.front()), m_emptyIcon, list); 131 125 } 132 126 … … 151 145 items.push_back(item); 152 146 } 153 setItems(m_core, action, items);147 setItems(m_core, action, m_emptyIcon, items); 154 148 appendRow(items); 155 149 return indexFromItem(items.front()); … … 186 180 } 187 181 188 void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, QStandardItemList &sl) 182 void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, 183 const QIcon &defaultIcon, 184 QStandardItemList &sl) 189 185 { 190 186 … … 201 197 QStandardItem *item = sl[NameColumn]; 202 198 item->setText(action->objectName()); 203 item->setIcon(fixActionIcon(action->icon())); 199 QIcon icon = action->icon(); 200 if (icon.isNull()) 201 icon = defaultIcon; 202 item->setIcon(icon); 204 203 item->setToolTip(firstTooltip); 205 204 item->setWhatsThis(firstTooltip); … … 245 244 246 245 QSet<QAction*> actions; 247 foreach (const 246 foreach (const QModelIndex &index, indexes) 248 247 if (QStandardItem *item = itemFromIndex(index)) 249 248 if (QAction *action = actionOfItem(item)) -
trunk/tools/designer/src/lib/shared/actionrepository_p.h
r651 r769 60 60 #include <QtGui/QListView> 61 61 #include <QtGui/QStackedWidget> 62 #include <QtGui/QIcon> 62 63 63 64 QT_BEGIN_NAMESPACE … … 111 112 112 113 private: 114 typedef QList<QStandardItem *> QStandardItemList; 115 113 116 void initializeHeaders(); 114 115 typedef QList<QStandardItem *> QStandardItemList; 116 static void setItems(QDesignerFormEditorInterface *core, QAction *a, QStandardItemList &sl); 117 static void setItems(QDesignerFormEditorInterface *core, QAction *a, 118 const QIcon &defaultIcon, 119 QStandardItemList &sl); 120 121 const QIcon m_emptyIcon; 117 122 118 123 QDesignerFormEditorInterface *m_core; -
trunk/tools/designer/src/lib/shared/connectionedit_p.h
r651 r769 88 88 public: 89 89 enum Type { Source, Target }; 90 EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {}90 explicit EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {} 91 91 bool isNull() const { return con == 0; } 92 92 bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; } -
trunk/tools/designer/src/lib/shared/filterwidget_p.h
r651 r769 67 67 68 68 /* A line edit that displays a grayed hintText (like "Type Here to Filter") 69 * when not focus sed and empty. When connecting to the changed signals and69 * when not focused and empty. When connecting to the changed signals and 70 70 * querying text, one has to be aware that the text is set to that hint 71 71 * text if isShowingHintText() returns true (that is, does not contain -
trunk/tools/designer/src/lib/shared/iconloader.cpp
r651 r769 61 61 << (QString::fromUtf8(":/trolltech/formeditor/images/designer_") + name); 62 62 63 foreach ( QStringf, candidates) {63 foreach (const QString &f, candidates) { 64 64 if (QFile::exists(f)) 65 65 return QIcon(f); … … 71 71 QDESIGNER_SHARED_EXPORT QIcon emptyIcon() 72 72 { 73 static const QIcon empty_icon(QLatin1String(":/trolltech/formeditor/images/emptyicon.png")); 74 return empty_icon; 73 return QIcon(QLatin1String(":/trolltech/formeditor/images/emptyicon.png")); 75 74 } 76 75 -
trunk/tools/designer/src/lib/shared/iconselector_p.h
r651 r769 77 77 Q_OBJECT 78 78 79 LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);79 explicit LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0); 80 80 81 81 public: -
trunk/tools/designer/src/lib/shared/plugindialog.cpp
r651 r769 106 106 QFont boldFont = topLevelItem->font(0); 107 107 108 foreach ( QStringfileName, fileNames) {108 foreach (const QString &fileName, fileNames) { 109 109 QPluginLoader loader(fileName); 110 110 const QFileInfo fileInfo(fileName); … … 128 128 QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Failed Plugins")); 129 129 const QFont boldFont = topLevelItem->font(0); 130 foreach (const QString plugin, notLoadedPlugins) {130 foreach (const QString &plugin, notLoadedPlugins) { 131 131 const QString failureReason = pluginManager->failureReason(plugin); 132 132 QTreeWidgetItem *pluginItem = setPluginItem(topLevelItem, plugin, boldFont); -
trunk/tools/designer/src/lib/shared/qdesigner_introspection.cpp
r651 r769 64 64 { 65 65 if (!c) 66 return QString ::null;66 return QString(); 67 67 return QString::fromUtf8(c); 68 68 } -
trunk/tools/designer/src/lib/shared/qdesigner_menu.cpp
r651 r769 89 89 QDesignerMenu::QDesignerMenu(QWidget *parent) : 90 90 QMenu(parent), 91 m_subMenuPixmap(QPixmap(QLatin1String(":/trolltech/formeditor/images/submenu.png"))), 91 92 m_currentIndex(0), 92 93 m_addItem(new SpecialMenuAction(this)), … … 557 558 QRect QDesignerMenu::subMenuPixmapRect(QAction *action) const 558 559 { 559 static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png"));560 560 const QRect g = actionGeometry(action); 561 const int x = layoutDirection() == Qt::LeftToRight ? (g.right() - pm.width() - 2) : 2;562 const int y = g.top() + (g.height() - pm.height())/2 + 1;563 return QRect(x, y, pm.width(), pm.height());561 const int x = layoutDirection() == Qt::LeftToRight ? (g.right() - m_subMenuPixmap.width() - 2) : 2; 562 const int y = g.top() + (g.height() - m_subMenuPixmap.height())/2 + 1; 563 return QRect(x, y, m_subMenuPixmap.width(), m_subMenuPixmap.height()); 564 564 } 565 565 … … 598 598 p.fillRect(g, lg); 599 599 } else if (hasSubMenuPixmap(a)) { 600 static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png")); 601 p.drawPixmap(subMenuPixmapRect(a).topLeft(), pm); 600 p.drawPixmap(subMenuPixmapRect(a).topLeft(), m_subMenuPixmap); 602 601 } 603 602 } -
trunk/tools/designer/src/lib/shared/qdesigner_menu_p.h
r651 r769 58 58 #include <QtGui/QAction> 59 59 #include <QtGui/QMenu> 60 #include <QtGui/QPixmap> 60 61 #include <QtCore/QHash> 61 62 … … 184 185 bool hideSubMenuOnCursorKey(); 185 186 bool showSubMenuOnCursorKey(); 187 const QPixmap m_subMenuPixmap; 186 188 187 189 QPoint m_startPosition; -
trunk/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h
r651 r769 86 86 Q_OBJECT 87 87 public: 88 QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);88 explicit QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0); 89 89 90 90 // Select a qobject unmanaged by form window -
trunk/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h
r651 r769 81 81 Q_OBJECT 82 82 public: 83 NewPromotedClassPanel(const QStringList &baseClasses,84 int selectedBaseClass = -1,85 QWidget *parent = 0);83 explicit NewPromotedClassPanel(const QStringList &baseClasses, 84 int selectedBaseClass = -1, 85 QWidget *parent = 0); 86 86 87 87 signals: … … 115 115 enum Mode { ModeEdit, ModeEditChooseClass }; 116 116 117 QDesignerPromotionDialog(QDesignerFormEditorInterface *core,118 QWidget *parent = 0,119 const QString &promotableWidgetClassName = QString(),120 QString *promoteTo = 0);117 explicit QDesignerPromotionDialog(QDesignerFormEditorInterface *core, 118 QWidget *parent = 0, 119 const QString &promotableWidgetClassName = QString(), 120 QString *promoteTo = 0); 121 121 // Return an alphabetically ordered list of base class names for adding new classes. 122 122 static const QStringList &baseClassNames(const QDesignerPromotionInterface *promotion); -
trunk/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h
r651 r769 70 70 Q_OBJECT 71 71 public: 72 QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);72 explicit QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0); 73 73 74 74 // A pair <ValidationMode, bool isTranslatable>. -
trunk/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp
r651 r769 676 676 const QStringList parameterNames = qVariantValue<QStringList>(selectedItem->data(0, Qt::UserRole)); 677 677 678 // TODO: Check w ether signal is connected to slot678 // TODO: Check whether signal is connected to slot 679 679 integr->emitNavigateToSlot(objectName, signalSignature, parameterNames); 680 680 } -
trunk/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
r651 r769 449 449 } 450 450 451 //that's a trick to get acces to the initStyleOption which is a protected member451 //that's a trick to get access to the initStyleOption which is a protected member 452 452 class FriendlyToolBar : public QToolBar { 453 453 public: -
trunk/tools/designer/src/lib/shared/qdesigner_utils_p.h
r651 r769 299 299 Q_OBJECT 300 300 public: 301 DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);301 explicit DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0); 302 302 QIcon icon(const PropertySheetIconValue &value) const; 303 303 void clear(); … … 314 314 { 315 315 public: 316 PropertySheetStringValue(const QString &value = QString(),316 explicit PropertySheetStringValue(const QString &value = QString(), 317 317 bool translatable = true, 318 318 const QString &disambiguation = QString(), … … 346 346 { 347 347 public: 348 PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),348 explicit PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(), 349 349 bool translatable = true, 350 350 const QString &disambiguation = QString(), 351 351 const QString &comment = QString()); 352 PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,352 explicit PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey, 353 353 bool translatable = true, 354 354 const QString &disambiguation = QString(), -
trunk/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h
r651 r769 71 71 enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly }; 72 72 73 QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);73 explicit QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0); 74 74 75 75 LoadMode loadMode() const; -
trunk/tools/designer/src/lib/shared/qtresourceview_p.h
r651 r769 69 69 Q_OBJECT 70 70 public: 71 QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);71 explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0); 72 72 ~QtResourceView(); 73 73 … … 121 121 Q_OBJECT 122 122 public: 123 QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);123 explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0); 124 124 virtual ~QtResourceViewDialog(); 125 125 -
trunk/tools/designer/src/lib/shared/richtexteditor_p.h
r651 r769 73 73 Q_OBJECT 74 74 public: 75 RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);75 explicit RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0); 76 76 ~RichTextEditorDialog(); 77 77 -
trunk/tools/designer/src/lib/shared/shared_settings.cpp
r651 r769 162 162 // get template paths excluding internal ones 163 163 QStringList rc = formTemplatePaths(); 164 foreach ( QStringinternalTemplatePath, defaultFormTemplatePaths()) {164 foreach (const QString &internalTemplatePath, defaultFormTemplatePaths()) { 165 165 const int index = rc.indexOf(internalTemplatePath); 166 166 if (index != -1) -
trunk/tools/designer/src/lib/shared/textpropertyeditor_p.h
r651 r769 91 91 }; 92 92 93 TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);93 explicit TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine); 94 94 95 95 TextPropertyValidationMode textPropertyValidationMode() const { return m_validationMode; } -
trunk/tools/designer/src/lib/shared/widgetdatabase_p.h
r651 r769 75 75 { 76 76 public: 77 WidgetDataBaseItem(const QString &name = QString(),78 const QString &group = QString());77 explicit WidgetDataBaseItem(const QString &name = QString(), 78 const QString &group = QString()); 79 79 80 80 QString name() const; … … 160 160 Q_OBJECT 161 161 public: 162 WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);162 explicit WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0); 163 163 virtual ~WidgetDataBase(); 164 164
Note:
See TracChangeset
for help on using the changeset viewer.