diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-08 03:16:46 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-08 03:16:46 (GMT) |
commit | 791a72e880db9886d5d16f053da31a2948ba8631 (patch) | |
tree | dcdae98651b2a8ba549818e53144122c46527814 /tools/designer | |
parent | fe239b32550e83e8a42617457adca8d7922ff92f (diff) | |
parent | cc1f88b869f23bb2855c1ada0fc6187ca21413b6 (diff) | |
download | Qt-791a72e880db9886d5d16f053da31a2948ba8631.zip Qt-791a72e880db9886d5d16f053da31a2948ba8631.tar.gz Qt-791a72e880db9886d5d16f053da31a2948ba8631.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1:
A few trivial optimizations
Rewrote bookmark handling, the previous code was just plain awful.
Small style cleanup.
Fix some warnings.
Designer: Emit QDesignerPropertyEditorInterface::propertyChanged().
Designer: Support the 'windowOpacity'-property for forms.
Expanded tst_QFileSystemModel::rootPath() to check directories ending in "." or ".."
Assistant: Treat "unfiltered" filter in a apecial way.
Assistant: Give meaningful context to translations.
Fixed handling of paths containing ".." in QFileSystemModel on Windows.
QAbstractItemModel docs: Fix typo.
Assistant: Eliminate private tr contexts.
Diffstat (limited to 'tools/designer')
5 files changed, 32 insertions, 7 deletions
diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index 9fd084d..3a7cd83 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -484,6 +484,7 @@ void FormWindow::setMainContainer(QWidget *w) sheet->setVisible(sheet->indexOf(QLatin1String("windowTitle")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); + sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); // ### generalize } diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp index b171ddc..512cc82 100644 --- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp @@ -1175,11 +1175,11 @@ void PropertyEditor::slotValueChanged(QtProperty *property, const QVariant &valu Q_ASSERT(ok); QVariant v; qVariantSetValue(v, e); - emit propertyValueChanged(property->propertyName(), v, true); + emitPropertyValueChanged(property->propertyName(), v, true); return; } - emit propertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); + emitPropertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); } bool PropertyEditor::isDynamicProperty(const QtBrowserItem* item) const diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp index e89c47c..9a1739e 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -92,7 +92,8 @@ static const PropertyNameTypeMap &stringPropertyTypes() } QDesignerPropertyEditor::QDesignerPropertyEditor(QWidget *parent, Qt::WindowFlags flags) : - QDesignerPropertyEditorInterface(parent, flags) + QDesignerPropertyEditorInterface(parent, flags), + m_propertyChangedForwardingBlocked(false) { // Make old signal work for compatibility connect(this, SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(slotPropertyChanged(QString,QVariant))); @@ -147,9 +148,20 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP return StringPropertyParameters(ValidationSingleLine, true); } +void QDesignerPropertyEditor::emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling) +{ + // Avoid duplicate signal emission - see below + m_propertyChangedForwardingBlocked = true; + emit propertyValueChanged(name, value, enableSubPropertyHandling); + emit propertyChanged(name, value); + m_propertyChangedForwardingBlocked = false; +} + void QDesignerPropertyEditor::slotPropertyChanged(const QString &name, const QVariant &value) { - emit propertyValueChanged(name, value, true); + // Forward signal from Integration using the old interfaces. + if (!m_propertyChangedForwardingBlocked) + emit propertyValueChanged(name, value, true); } } diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h index cdd53f0..27078f2 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h @@ -79,7 +79,6 @@ public: static StringPropertyParameters textPropertyValidationMode(QDesignerFormEditorInterface *core, const QObject *object, const QString &propertyName, bool isMainContainer); - Q_SIGNALS: void propertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); void resetProperty(const QString &name); @@ -97,6 +96,13 @@ public Q_SLOTS: private Q_SLOTS: void slotPropertyChanged(const QString &name, const QVariant &value); + +protected: + void emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); + +private: + bool m_propertyChangedForwardingBlocked; + }; } // namespace qdesigner_internal diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index b4b962c..13bb1d7 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -610,8 +610,9 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) createFakeProperty(QLatin1String("whatsThis")); createFakeProperty(QLatin1String("acceptDrops")); createFakeProperty(QLatin1String("dragEnabled")); - // windowModality is visible only for the main container, in which case the form windows enables it on loading + // windowModality/Opacity is visible only for the main container, in which case the form windows enables it on loading setVisible(createFakeProperty(QLatin1String("windowModality")), false); + setVisible(createFakeProperty(QLatin1String("windowOpacity"), double(1.0)), false); if (qobject_cast<const QToolBar *>(d->m_object)) { // prevent toolbars from being dragged off createFakeProperty(QLatin1String("floatable"), QVariant(true)); } else { @@ -1451,8 +1452,13 @@ bool QDesignerPropertySheet::isVisible(int index) const } if (isFakeProperty(index)) { - if (type == PropertyWindowModality) // Hidden for child widgets + switch (type) { + case PropertyWindowModality: // Hidden for child widgets + case PropertyWindowOpacity: return d->m_info.value(index).visible; + default: + break; + } return true; } |