Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/designer/src/lib/shared/actioneditor.cpp

    r651 r769  
    429429}
    430430
    431 // Set an intial property and mark it as changed in the sheet
     431// Set an initial property and mark it as changed in the sheet
    432432static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value)
    433433{
  • trunk/tools/designer/src/lib/shared/actionrepository.cpp

    r651 r769  
    7878}
    7979
    80 static QIcon fixActionIcon(const QIcon &icon)
    81 {
    82     if (icon.isNull())
    83         return qdesigner_internal::emptyIcon();
    84     return icon;
    85 }
    86 
    8780namespace qdesigner_internal {
    8881
     
    9083ActionModel::ActionModel(QWidget *parent ) :
    9184    QStandardItemModel(parent),
     85    m_emptyIcon(emptyIcon()),
    9286    m_core(0)
    9387{
     
    128122       list += item(row, i);
    129123
    130     setItems(m_core, actionOfItem(list.front()), list);
     124    setItems(m_core, actionOfItem(list.front()), m_emptyIcon, list);
    131125}
    132126
     
    151145        items.push_back(item);
    152146    }
    153     setItems(m_core, action, items);
     147    setItems(m_core, action, m_emptyIcon, items);
    154148    appendRow(items);
    155149    return indexFromItem(items.front());
     
    186180}
    187181
    188 void  ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, QStandardItemList &sl)
     182void  ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action,
     183                            const QIcon &defaultIcon,
     184                            QStandardItemList &sl)
    189185{
    190186
     
    201197    QStandardItem *item =  sl[NameColumn];
    202198    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);
    204203    item->setToolTip(firstTooltip);
    205204    item->setWhatsThis(firstTooltip);
     
    245244
    246245    QSet<QAction*> actions;
    247     foreach (const  QModelIndex &index, indexes)
     246    foreach (const QModelIndex &index, indexes)
    248247        if (QStandardItem *item = itemFromIndex(index))
    249248            if (QAction *action = actionOfItem(item))
  • trunk/tools/designer/src/lib/shared/actionrepository_p.h

    r651 r769  
    6060#include <QtGui/QListView>
    6161#include <QtGui/QStackedWidget>
     62#include <QtGui/QIcon>
    6263
    6364QT_BEGIN_NAMESPACE
     
    111112
    112113private:
     114    typedef QList<QStandardItem *> QStandardItemList;
     115
    113116    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;
    117122
    118123    QDesignerFormEditorInterface *m_core;
  • trunk/tools/designer/src/lib/shared/connectionedit_p.h

    r651 r769  
    8888    public:
    8989        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) {}
    9191        bool isNull() const { return con == 0; }
    9292        bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; }
  • trunk/tools/designer/src/lib/shared/filterwidget_p.h

    r651 r769  
    6767
    6868/* A line edit that displays a grayed hintText (like "Type Here to Filter")
    69  * when not focussed and empty. When connecting to the changed signals and
     69 * when not focused and empty. When connecting to the changed signals and
    7070 * querying text, one has to be aware that the text is set to that hint
    7171 * text if isShowingHintText() returns true (that is, does not contain
  • trunk/tools/designer/src/lib/shared/iconloader.cpp

    r651 r769  
    6161        << (QString::fromUtf8(":/trolltech/formeditor/images/designer_") + name);
    6262
    63     foreach (QString f, candidates) {
     63    foreach (const QString &f, candidates) {
    6464        if (QFile::exists(f))
    6565            return QIcon(f);
     
    7171QDESIGNER_SHARED_EXPORT QIcon emptyIcon()
    7272{
    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"));
    7574}
    7675
  • trunk/tools/designer/src/lib/shared/iconselector_p.h

    r651 r769  
    7777    Q_OBJECT
    7878
    79     LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
     79    explicit LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
    8080
    8181public:
  • trunk/tools/designer/src/lib/shared/plugindialog.cpp

    r651 r769  
    106106        QFont boldFont = topLevelItem->font(0);
    107107
    108         foreach (QString fileName, fileNames) {
     108        foreach (const QString &fileName, fileNames) {
    109109            QPluginLoader loader(fileName);
    110110            const QFileInfo fileInfo(fileName);
     
    128128        QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Failed Plugins"));
    129129        const QFont boldFont = topLevelItem->font(0);
    130         foreach (const QString plugin, notLoadedPlugins) {
     130        foreach (const QString &plugin, notLoadedPlugins) {
    131131            const QString failureReason = pluginManager->failureReason(plugin);
    132132            QTreeWidgetItem *pluginItem = setPluginItem(topLevelItem, plugin, boldFont);
  • trunk/tools/designer/src/lib/shared/qdesigner_introspection.cpp

    r651 r769  
    6464{
    6565    if (!c)
    66         return QString::null;
     66        return QString();
    6767    return QString::fromUtf8(c);
    6868}
  • trunk/tools/designer/src/lib/shared/qdesigner_menu.cpp

    r651 r769  
    8989QDesignerMenu::QDesignerMenu(QWidget *parent) :
    9090    QMenu(parent),
     91    m_subMenuPixmap(QPixmap(QLatin1String(":/trolltech/formeditor/images/submenu.png"))),
    9192    m_currentIndex(0),
    9293    m_addItem(new SpecialMenuAction(this)),
     
    557558QRect QDesignerMenu::subMenuPixmapRect(QAction *action) const
    558559{
    559     static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png"));
    560560    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());
    564564}
    565565
     
    598598            p.fillRect(g, lg);
    599599        } 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);
    602601        }
    603602    }
  • trunk/tools/designer/src/lib/shared/qdesigner_menu_p.h

    r651 r769  
    5858#include <QtGui/QAction>
    5959#include <QtGui/QMenu>
     60#include <QtGui/QPixmap>
    6061#include <QtCore/QHash>
    6162
     
    184185    bool hideSubMenuOnCursorKey();
    185186    bool showSubMenuOnCursorKey();
     187    const QPixmap m_subMenuPixmap;
    186188
    187189    QPoint m_startPosition;
  • trunk/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h

    r651 r769  
    8686    Q_OBJECT
    8787public:
    88     QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     88    explicit QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    8989
    9090    // Select a qobject unmanaged by form window
  • trunk/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h

    r651 r769  
    8181        Q_OBJECT
    8282    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);
    8686
    8787        signals:
     
    115115        enum Mode { ModeEdit, ModeEditChooseClass };
    116116
    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);
    121121        // Return an alphabetically ordered list of base class names for adding new classes.
    122122        static const QStringList &baseClassNames(const QDesignerPromotionInterface *promotion);
  • trunk/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h

    r651 r769  
    7070    Q_OBJECT
    7171public:
    72     QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     72    explicit QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    7373
    7474    // A pair <ValidationMode, bool isTranslatable>.
  • trunk/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp

    r651 r769  
    676676        const QStringList parameterNames = qVariantValue<QStringList>(selectedItem->data(0, Qt::UserRole));
    677677
    678         // TODO: Check wether signal is connected to slot
     678        // TODO: Check whether signal is connected to slot
    679679        integr->emitNavigateToSlot(objectName, signalSignature, parameterNames);
    680680    }
  • trunk/tools/designer/src/lib/shared/qdesigner_toolbar.cpp

    r651 r769  
    449449}
    450450
    451 //that's a trick to get acces to the initStyleOption which is a protected member
     451//that's a trick to get access to the initStyleOption which is a protected member
    452452class FriendlyToolBar : public QToolBar {
    453453public:
  • trunk/tools/designer/src/lib/shared/qdesigner_utils_p.h

    r651 r769  
    299299    Q_OBJECT
    300300public:
    301     DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
     301    explicit DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
    302302    QIcon icon(const PropertySheetIconValue &value) const;
    303303    void clear();
     
    314314{
    315315public:
    316     PropertySheetStringValue(const QString &value = QString(),
     316    explicit PropertySheetStringValue(const QString &value = QString(),
    317317                             bool translatable = true,
    318318                             const QString &disambiguation = QString(),
     
    346346{
    347347public:
    348     PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
     348    explicit PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
    349349                                  bool translatable = true,
    350350                                  const QString &disambiguation = QString(),
    351351                                  const QString &comment = QString());
    352     PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
     352    explicit PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
    353353                                  bool translatable = true,
    354354                                  const QString &disambiguation = QString(),
  • trunk/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h

    r651 r769  
    7171    enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly };
    7272
    73     QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     73    explicit QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    7474
    7575    LoadMode loadMode() const;
  • trunk/tools/designer/src/lib/shared/qtresourceview_p.h

    r651 r769  
    6969    Q_OBJECT
    7070public:
    71     QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     71    explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    7272    ~QtResourceView();
    7373
     
    121121    Q_OBJECT
    122122public:
    123     QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     123    explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    124124    virtual ~QtResourceViewDialog();
    125125
  • trunk/tools/designer/src/lib/shared/richtexteditor_p.h

    r651 r769  
    7373    Q_OBJECT
    7474public:
    75     RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     75    explicit RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    7676    ~RichTextEditorDialog();
    7777
  • trunk/tools/designer/src/lib/shared/shared_settings.cpp

    r651 r769  
    162162    // get template paths excluding internal ones
    163163    QStringList rc = formTemplatePaths();
    164     foreach (QString internalTemplatePath, defaultFormTemplatePaths()) {
     164    foreach (const QString &internalTemplatePath, defaultFormTemplatePaths()) {
    165165        const int index = rc.indexOf(internalTemplatePath);
    166166        if (index != -1)
  • trunk/tools/designer/src/lib/shared/textpropertyeditor_p.h

    r651 r769  
    9191        };
    9292
    93         TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
     93        explicit TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
    9494
    9595        TextPropertyValidationMode textPropertyValidationMode() const { return m_validationMode; }
  • trunk/tools/designer/src/lib/shared/widgetdatabase_p.h

    r651 r769  
    7575{
    7676public:
    77     WidgetDataBaseItem(const QString &name = QString(),
    78                        const QString &group = QString());
     77    explicit WidgetDataBaseItem(const QString &name = QString(),
     78                                const QString &group = QString());
    7979
    8080    QString name() const;
     
    160160    Q_OBJECT
    161161public:
    162     WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
     162    explicit WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
    163163    virtual ~WidgetDataBase();
    164164
Note: See TracChangeset for help on using the changeset viewer.