summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@nokia.com>2011-10-28 10:17:44 +0200
committerEike Ziller <eike.ziller@nokia.com>2011-10-28 10:17:44 +0200
commit81cce8902ee0383c57d90792e5dd52fe5d7f0b84 (patch)
tree0ff6facd20b82a61803b1f8d22d3576aa0016469 /src/plugins/qmldesigner
parent2ee0b36342446dd8816480d849138496321b154a (diff)
parent5dcf7d2ef03827329e2d57ac33ac391abf278d57 (diff)
downloadqt-creator-81cce8902ee0383c57d90792e5dd52fe5d7f0b84.tar.gz
Merge remote-tracking branch 'origin/2.4'
Conflicts: qtcreator.pri src/libs/qmljs/qmljscheck.cpp src/plugins/debugger/gdb/gdbengine.cpp src/plugins/debugger/gdb/remotegdbserveradapter.cpp src/plugins/plugins.pro src/plugins/projectexplorer/buildmanager.cpp src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp Change-Id: Id2dcebf95b94dc46c1d85908ba1d1378aaf362ac
Diffstat (limited to 'src/plugins/qmldesigner')
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp24
-rw-r--r--src/plugins/qmldesigner/components/formeditor/toolbox.cpp5
-rw-r--r--src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri5
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp10
-rw-r--r--src/plugins/qmldesigner/desktopplugin/desktop.metainfo6
5 files changed, 29 insertions, 21 deletions
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index 946b96c089..1214cd7e1b 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -294,32 +294,34 @@ void FormEditorItem::paintPlaceHolderForInvisbleItem(QPainter *painter) const
displayText = qmlItemNode().simplifiedTypeName();
QTextOption textOption;
- textOption.setAlignment(Qt::AlignCenter);
+ textOption.setAlignment(Qt::AlignTop);
textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
- if (boundingRect().width() > 60) {
+ if (boundingRect().height() > 60) {
painter->save();
QFont font;
font.setStyleHint(QFont::SansSerif);
font.setBold(true);
- font.setPixelSize(14);
+ font.setPixelSize(12);
painter->setFont(font);
QFontMetrics fm(font);
- if (fm.width(displayText) > (boundingRect().width() - 22) && displayText.length() > 4) {
+ painter->rotate(90);
+ if (fm.width(displayText) > (boundingRect().height() - 32) && displayText.length() > 4) {
- displayText = fm.elidedText(displayText, Qt::ElideRight, boundingRect().width() - 22, Qt::TextShowMnemonic);
+ displayText = fm.elidedText(displayText, Qt::ElideRight, boundingRect().height() - 32, Qt::TextShowMnemonic);
}
- painter->setPen(QColor(255, 255, 255, 128));
- painter->setCompositionMode(QPainter::CompositionMode_Exclusion);
-
- painter->drawText(boundingRect().adjusted(-2, -2, 0,0), displayText, textOption);
+ QRectF rotatedBoundingBox;
+ rotatedBoundingBox.setWidth(boundingRect().height());
+ rotatedBoundingBox.setHeight(12);
+ rotatedBoundingBox.setY(-boundingRect().width() + 12);
+ rotatedBoundingBox.setX(20);
painter->setFont(font);
- painter->setPen(QColor(0, 0, 0, 255));
- painter->drawText(boundingRect(), displayText, textOption);
+ painter->setPen(QColor(48, 48, 96, 255));
+ painter->drawText(rotatedBoundingBox, displayText, textOption);
painter->restore();
}
diff --git a/src/plugins/qmldesigner/components/formeditor/toolbox.cpp b/src/plugins/qmldesigner/components/formeditor/toolbox.cpp
index 98ee05e674..b9dc95a448 100644
--- a/src/plugins/qmldesigner/components/formeditor/toolbox.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/toolbox.cpp
@@ -49,6 +49,7 @@ ToolBox::ToolBox(QWidget *parentWidget)
m_leftToolBar(new QToolBar("LeftSidebar", this)),
m_rightToolBar(new QToolBar("RightSidebar", this))
{
+ setMaximumHeight(44);
setSingleRow(false);
QFrame *frame = new QFrame(this);
m_crumblePath = new Utils::CrumblePath(frame);
@@ -65,7 +66,7 @@ ToolBox::ToolBox(QWidget *parentWidget)
verticalLayout->setMargin(0);
verticalLayout->setSpacing(0);
- QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
+ QHBoxLayout *horizontalLayout = new QHBoxLayout();
verticalLayout->addLayout(horizontalLayout);
verticalLayout->addWidget(frame);
horizontalLayout->setMargin(0);
@@ -96,8 +97,6 @@ ToolBox::ToolBox(QWidget *parentWidget)
horizontalLayout->addWidget(m_leftToolBar);
horizontalLayout->addWidget(stretchToolbar);
horizontalLayout->addWidget(m_rightToolBar);
-
- setLayout(verticalLayout);
}
void ToolBox::setLeftSideActions(const QList<QAction*> &actions)
diff --git a/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri b/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri
index e624bcc5e8..d0b68ece2a 100644
--- a/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri
+++ b/src/plugins/qmldesigner/customstyleplugin/customstyleplugin.pri
@@ -15,8 +15,3 @@ HEADERS += $$PWD/customstyleplugin.h $$PWD/../designercore/include/iwidgetplugi
RESOURCES += $$PWD/customstyleplugin.qrc
OTHER_FILES += $$PWD/customstyle.metainfo
-
-!macx {
- target.path = /$$IDE_LIBRARY_BASENAME/qmldesigner
- INSTALLS += target
-}
diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
index 8b34468efe..b76e9e6ea5 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
@@ -826,6 +826,7 @@ void NodeMetaInfoPrivate::setupPrototypes()
objects = PrototypeIterator(getObjectValue(), context()).all();
else
objects = PrototypeIterator(getCppComponentValue(), context()).all();
+
foreach (const ObjectValue *ov, objects) {
TypeDescription description;
description.className = ov->className();
@@ -834,8 +835,15 @@ void NodeMetaInfoPrivate::setupPrototypes()
if (const CppComponentValue * qmlValue = value_cast<CppComponentValue>(ov)) {
description.minorVersion = qmlValue->componentVersion().minorVersion();
description.majorVersion = qmlValue->componentVersion().majorVersion();
- if (!qmlValue->moduleName().isEmpty())
+ LanguageUtils::FakeMetaObject::Export qtquickExport = qmlValue->metaObject()->exportInPackage("QtQuick");
+ LanguageUtils::FakeMetaObject::Export cppExport = qmlValue->metaObject()->exportInPackage("<cpp>");
+ if (qtquickExport.isValid()) {
+ description.className = qtquickExport.package + '.' + qtquickExport.type;
+ } else if (qmlValue->moduleName().isEmpty() && cppExport.isValid()) {
+ description.className = cppExport.package + '.' + cppExport.type;
+ } else if (!qmlValue->moduleName().isEmpty()) {
description.className = qmlValue->moduleName() + '.' + description.className;
+ }
m_prototypes.append(description);
} else {
if (context()->lookupType(document(), QStringList() << ov->className()))
diff --git a/src/plugins/qmldesigner/desktopplugin/desktop.metainfo b/src/plugins/qmldesigner/desktopplugin/desktop.metainfo
index 7efe47ba1a..07f4a5aed0 100644
--- a/src/plugins/qmldesigner/desktopplugin/desktop.metainfo
+++ b/src/plugins/qmldesigner/desktopplugin/desktop.metainfo
@@ -128,8 +128,12 @@
<node name="QtDesktop.TextField" icon=":/desktopplugin/images/textfield16.png">
<itemlibraryentry name="TextField" category="Components Desktop" libraryIcon=":/desktopplugin/images/textfield.png" version="0.1" requiredImport="QtDesktop">
<property name="width" type="int" value="180"/>
- <property name="height" type="int" value="50"/>
<property name="text" type="QString" value="TextField"/>
</itemlibraryentry>
</node>
+ <node name="QtDesktop.Label" icon=":/desktopplugin/images/window16.png.png">
+ <itemlibraryentry name="Label" category="Components Desktop" libraryIcon=":/desktopplugin/images/window.png" version="0.1" requiredImport="QtDesktop">
+ <property name="text" type="QString" value="Label"/>
+ </itemlibraryentry>
+ </node>
</metainfo>