diff --git a/common.pri b/common.pri index 69593fa..018c3f7 100644 --- a/common.pri +++ b/common.pri @@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 44 +LIMEREPORT_VERSION_RELEASE = 45 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/dialogdesigner/lrdialogdesigner.cpp b/limereport/dialogdesigner/lrdialogdesigner.cpp index 82a08d0..4a23d4d 100644 --- a/limereport/dialogdesigner/lrdialogdesigner.cpp +++ b/limereport/dialogdesigner/lrdialogdesigner.cpp @@ -40,6 +40,8 @@ DialogDesignerManager::DialogDesignerManager(QObject *parent) : QObject(parent) m_editWidgetsAction = new QAction(tr("Edit Widgets"), this); m_editWidgetsAction->setIcon(QIcon(":/images/images/widgettool.png")); m_editWidgetsAction->setEnabled(false); + m_editWidgetsAction->setCheckable(true); + m_editWidgetsAction->setChecked(true); connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(slotEditWidgets())); connect(m_formEditor->formWindowManager(), SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), this, SLOT(slotActiveFormWindowChanged(QDesignerFormWindowInterface*)) ); @@ -258,6 +260,8 @@ void DialogDesignerManager::slotActiveFormWindowChanged(QDesignerFormWindowInter { if (formWindow){ m_editWidgetsAction->setEnabled(true); + m_editWidgetsAction->trigger(); + m_editWidgetsAction->setChecked(true); m_activeWindowName = formWindow->objectName(); } } diff --git a/limereport/items/lrshapeitem.cpp b/limereport/items/lrshapeitem.cpp index 182ea9e..4bef04b 100644 --- a/limereport/items/lrshapeitem.cpp +++ b/limereport/items/lrshapeitem.cpp @@ -55,7 +55,6 @@ ShapeItem::ShapeItem(QObject *owner, QGraphicsItem *parent) m_shapeBrushType(Qt::NoBrush), m_lineWidth(1), m_penStyle(Qt::SolidLine), - m_opacity(100), m_cornerRadius(0) { } @@ -89,7 +88,7 @@ void ShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, brush.setTransform(painter->worldTransform().inverted()); painter->setBrush(brush); painter->setBackground(QBrush(Qt::NoBrush)); - painter->setOpacity(qreal(m_opacity)/100); + painter->setOpacity(qreal(opacity())/100); QRectF rectangleRect = rect().adjusted((lineWidth() / 2), (lineWidth() / 2), -(lineWidth() / 2), @@ -190,27 +189,5 @@ void ShapeItem::setCornerRadius(int borderRadius) notify("cornerRadius",oldValue,m_cornerRadius); } } -int ShapeItem::opacity() const -{ - return m_opacity; -} - -void ShapeItem::setOpacity(int opacity) -{ - if (m_opacity!=opacity){ - if (opacity < 0) { - m_opacity = 0; - } - else if (opacity > 100) { - m_opacity = 100; - } - else { - m_opacity = opacity; - } - update(); - } -} - - } diff --git a/limereport/items/lrshapeitem.h b/limereport/items/lrshapeitem.h index 1516aad..bdfab3b 100644 --- a/limereport/items/lrshapeitem.h +++ b/limereport/items/lrshapeitem.h @@ -66,8 +66,6 @@ public: qreal lineWidth() const {return m_lineWidth;} Qt::PenStyle penStyle() const; void setPenStyle(const Qt::PenStyle &value); - int opacity() const; - void setOpacity(int opacity); int cornerRadius() const; void setCornerRadius(int cornerRadius); @@ -81,7 +79,7 @@ private: Qt::BrushStyle m_shapeBrushType; qreal m_lineWidth; Qt::PenStyle m_penStyle; - int m_opacity; +// int m_opacity; int m_cornerRadius; }; diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index fe2e53c..ba990d4 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -1408,11 +1408,13 @@ void ScriptEngineContext::qobjectToScript(const QString& name, QObject *item) #ifdef HAVE_UI_LOADER #ifdef USE_QJSENGINE -void registerChildObjects(ScriptEngineType* se, ScriptValueType* sv){ - foreach(QObject* obj, sv->toQObject()->children()){ - ScriptValueType child = se->newQObject(obj); - sv->setProperty(obj->objectName(),child); - registerChildObjects(se, &child); +void registerChildObjects(ScriptEngineType* se, ScriptValueType* root, QObject* currObj){ + foreach(QObject* obj, currObj->children()){ + if (!obj->objectName().isEmpty()){ + ScriptValueType child = se->newQObject(obj); + root->setProperty(obj->objectName(),child); + } + registerChildObjects(se, root, obj); } } #endif @@ -1422,7 +1424,7 @@ void ScriptEngineContext::initDialogs(){ foreach(DialogDescriber::Ptr dialog, dialogDescribers()){ ScriptValueType sv = se->newQObject(getDialog(dialog->name())); #ifdef USE_QJSENGINE - registerChildObjects(se,&sv); + registerChildObjects(se, &sv, sv.toQObject()); #endif se->globalObject().setProperty(dialog->name(),sv); }