Commits

zjes committed cdddb54

Fix designer drag&drop

Comments (0)

Files changed (9)

src/Designer/DesignerWidget.cpp

     _ui->splitter_2->setStretchFactor(1, 100);
     if (!_iface){
         _iface = QDesignerComponents::createFormEditor(parentWidget());
-        _iface->setTopLevel(parentWidget());
+        _iface->setTopLevel(this);
         QDesignerComponents::createTaskMenu(_iface, parentWidget());
         QDesignerComponents::initializePlugins(_iface);
         QDesignerComponents::initializeResources();
     }
 
-
     _wb = QDesignerComponents::createWidgetBox(_iface, this);
+    _wb->setWindowTitle(tr("Widget Box"));
+    _wb->setObjectName(QLatin1String("WidgetBox"));
     _ui->widgetsPlace->layout()->addWidget(_wb);
     _iface->setWidgetBox(_wb);
 
     _form->setContents(f.readAll());
     f.close();
 
+    _form->setDesignerGrid(qdesigner_internal::FormWindowBase::defaultDesignerGrid());
     qdesigner_internal::FormWindowBase::setupDefaultAction(_form);
     _designer->setupFormWindow(_form);
 

src/Designer/DesignerWidget.ui

    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1054</width>
-    <height>639</height>
+    <width>1052</width>
+    <height>637</height>
    </rect>
   </property>
   <property name="sizePolicy">

src/Designer/internals/formwindowbase_p.h

 **
 ** This file is part of Qt Creator
 **
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (info@qt.nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 **
 ** GNU Lesser General Public License Usage
 ** conditions contained in a signed written agreement between you and Nokia.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
+** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
 
 
 #include <QtDesigner/QDesignerFormWindowInterface>
 
-#include <QtCore/QVariantMap>
-#include <QtCore/QList>
+#include <QVariantMap>
+#include <QList>
 
 QT_BEGIN_NAMESPACE
 

src/Designer/internals/pluginmanager_p.h

 **
 ** This file is part of Qt Creator
 **
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (info@qt.nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 **
 ** GNU Lesser General Public License Usage
 ** conditions contained in a signed written agreement between you and Nokia.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
+** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
 
 #include "shared_global_p.h"
 #include "shared_enums_p.h"
 
-#include <QtCore/QSharedDataPointer>
-#include <QtCore/QMap>
-#include <QtCore/QPair>
-#include <QtCore/QStringList>
+#include <QSharedDataPointer>
+#include <QMap>
+#include <QPair>
+#include <QStringList>
 
 QT_BEGIN_NAMESPACE
 

src/Designer/internals/qdesigner_integration_p.h

 **
 ** This file is part of Qt Creator
 **
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (info@qt.nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 **
 ** GNU Lesser General Public License Usage
 ** conditions contained in a signed written agreement between you and Nokia.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
+** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
 
 #include "shared_global_p.h"
 #include <QtDesigner/QDesignerIntegrationInterface>
 
-#include <QtCore/QObject>
+#include <QObject>
 
 QT_BEGIN_NAMESPACE
 

src/Designer/internals/shared_enums_p.h

 **
 ** This file is part of Qt Creator
 **
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (info@qt.nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 **
 ** GNU Lesser General Public License Usage
 ** conditions contained in a signed written agreement between you and Nokia.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
+** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
 

src/Designer/internals/shared_global_p.h

 **
 ** This file is part of Qt Creator
 **
-** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
 **
-** Contact: Nokia Corporation (info@qt.nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
 **
 **
 ** GNU Lesser General Public License Usage
 ** conditions contained in a signed written agreement between you and Nokia.
 **
 ** If you have questions regarding the use of this file, please contact
-** Nokia at info@qt.nokia.com.
+** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
 
 #ifndef SHARED_GLOBAL_H
 #define SHARED_GLOBAL_H
 
-#include <QtCore/qglobal.h>
+#include <qglobal.h>
 
 #ifdef QT_DESIGNER_STATIC
 #define QDESIGNER_SHARED_EXTERN

src/Project/NewItems/SelectTypePage.cpp

 {
     _ui->setupUi(this);
 
-    items.append("Python class");
-    items.append("Empty Python file");
-    items.append("Python module");
-    items.append("Python Qt Designer class form");
-    items.append("Qt Designer form");
-    items.append("Qt Resource file");
-    items.append("Qml file");
-    items.append("Javascript file");
-    items.append("File");
-    items.append("Directory");
+    items.append(tr("Python class"));
+    items.append(tr("Empty Python file"));
+    items.append(tr("Python module"));
+    items.append(tr("Python Qt Designer class form"));
+    items.append(tr("Qt Designer form"));
+    items.append(tr("Qt Resource file"));
+    items.append(tr("Qml file"));
+    items.append(tr("Javascript file"));
+    items.append(tr("File"));
+    items.append(tr("Directory"));
 
+    _ui->items->addItems(items);
+    connect(_ui->items, SIGNAL(currentRowChanged(int)), SLOT(onItemChanged(int)));
 }
 
 SelectTypePage::~SelectTypePage()
     delete _ui;
 }
 
+void SelectTypePage::onItemChanged(int row)
+{
+    switch(row){
+    case 0: _ui->descr->setText(tr("Creates python class from template")); break;
+    case 1: _ui->descr->setText(tr("Creates empty python file")); break;
+    case 2: _ui->descr->setText(tr("Creates empty python module")); break;
+    case 3: _ui->descr->setText(tr("Creates designer class form")); break;
+    case 4: _ui->descr->setText(tr("Creates qt ui form from template")); break;
+    case 5: _ui->descr->setText(tr("Creates qt resource file")); break;
+    case 6: _ui->descr->setText(tr("Creates empty QML file")); break;
+    case 7: _ui->descr->setText(tr("Creates javascript file")); break;
+    case 8: _ui->descr->setText(tr("Creates any file")); break;
+    case 9: _ui->descr->setText(tr("Creates directory")); break;
+    }
+}
+
 }

src/Project/NewItems/SelectTypePage.h

 public:
     SelectTypePage(QWidget * parent, NodeTypes type);
     virtual ~SelectTypePage();
+private slots:
+    void onItemChanged(int);
 private:
     Ui::SelectTypePage * _ui;
     QList<QString> items;