diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-04-11 10:48:44 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-04-11 10:48:44 (GMT) |
commit | 1062da14facb7dd10f0928a4c242549d3626f9ba (patch) | |
tree | 4462fcaa82b45c47eddcdcb1d89e1cc03de45a85 /tools/designer | |
parent | 847df81a5680fe4d71196d0afe5e68e41ae49700 (diff) | |
parent | dd60cf7ba8afdf5c84f5793c1e1d08ab18303a74 (diff) | |
download | Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.zip Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.tar.gz Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.tar.bz2 |
Merge branch 'master' of scm.dev.troll.no:qt/qt-earth-team into symbian-socket-engine
Conflicts:
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtNetworku.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
src/s60installs/eabi/QtNetworku.def
src/s60installs/eabi/QtOpenVGu.def
tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
Diffstat (limited to 'tools/designer')
21 files changed, 250 insertions, 127 deletions
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 073f125..409a20e 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -741,7 +741,10 @@ QWidget *QDesignerResource::load(QIODevice *dev, QWidget *parentWidget) case LoadPreCheckOk: break; } - return QEditorFormBuilder::load(dev, parentWidget); + QWidget *w = QEditorFormBuilder::load(dev, parentWidget); + if (w) // Store the class name as 'reset' value for the main container's object name. + w->setProperty("_q_classname", w->objectName()); + return w; } bool QDesignerResource::saveRelative() const diff --git a/tools/designer/src/components/taskmenu/itemlisteditor.cpp b/tools/designer/src/components/taskmenu/itemlisteditor.cpp index 8d317f5..a04246d 100644 --- a/tools/designer/src/components/taskmenu/itemlisteditor.cpp +++ b/tools/designer/src/components/taskmenu/itemlisteditor.cpp @@ -80,7 +80,7 @@ private: ////////////////// Item editor /////////////// AbstractItemEditor::AbstractItemEditor(QDesignerFormWindowInterface *form, QWidget *parent) - : QDialog(parent), + : QWidget(parent), m_iconCache(qobject_cast<FormWindowBase *>(form)->iconCache()), m_updatingBrowser(false) { @@ -104,15 +104,6 @@ AbstractItemEditor::~AbstractItemEditor() m_propertyBrowser->unsetFactoryForManager(m_propertyManager); } -void AbstractItemEditor::keyPressEvent(QKeyEvent *e) -{ - // Avoid that embedded dialogs react to enter and escape keys. - if (this == window()) - QDialog::keyPressEvent(e); - else - QWidget::keyPressEvent(e); -} - static const char * const itemFlagNames[] = { QT_TRANSLATE_NOOP("AbstractItemEditor", "Selectable"), QT_TRANSLATE_NOOP("AbstractItemEditor", "Editable"), @@ -304,7 +295,7 @@ ItemListEditor::ItemListEditor(QDesignerFormWindowInterface *form, QWidget *pare injectPropertyBrowser(this, ui.widget); connect(ui.showPropertiesButton, SIGNAL(clicked()), this, SLOT(togglePropertyBrowser())); - togglePropertyBrowser(); + setPropertyBrowserVisible(false); QIcon upIcon = createIconSet(QString::fromUtf8("up.png")); QIcon downIcon = createIconSet(QString::fromUtf8("down.png")); @@ -417,15 +408,13 @@ void ItemListEditor::on_listWidget_itemChanged(QListWidgetItem *item) void ItemListEditor::togglePropertyBrowser() { - // Always hide in case parent widget is not visible -> on startup - const bool isVisible = - !this->isVisible() ? true : m_propertyBrowser->isVisible(); - if (isVisible) - ui.showPropertiesButton->setText(tr("Properties &<<")); - else - ui.showPropertiesButton->setText(tr("Properties &>>")); + setPropertyBrowserVisible(!m_propertyBrowser->isVisible()); +} - m_propertyBrowser->setVisible(!isVisible); +void ItemListEditor::setPropertyBrowserVisible(bool v) +{ + ui.showPropertiesButton->setText(v ? tr("Properties &>>") : tr("Properties &<<")); + m_propertyBrowser->setVisible(v); } void ItemListEditor::setItemData(int role, const QVariant &v) @@ -484,6 +473,6 @@ void ItemListEditor::updateEditor() else m_propertyBrowser->clear(); } -} +} // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/components/taskmenu/itemlisteditor.h b/tools/designer/src/components/taskmenu/itemlisteditor.h index 2059620..ffacad2 100644 --- a/tools/designer/src/components/taskmenu/itemlisteditor.h +++ b/tools/designer/src/components/taskmenu/itemlisteditor.h @@ -53,6 +53,7 @@ class QtProperty; class QtVariantProperty; class QtTreePropertyBrowser; class QSplitter; +class QVBoxLayout; namespace qdesigner_internal { @@ -72,12 +73,12 @@ private: bool reset; }; -class AbstractItemEditor: public QDialog +class AbstractItemEditor: public QWidget { Q_OBJECT public: - AbstractItemEditor(QDesignerFormWindowInterface *form, QWidget *parent); + explicit AbstractItemEditor(QDesignerFormWindowInterface *form, QWidget *parent); ~AbstractItemEditor(); DesignerIconCache *iconCache() const { return m_iconCache; } @@ -95,7 +96,6 @@ private slots: void cacheReloaded(); protected: - void keyPressEvent(QKeyEvent *e); void setupProperties(PropertyDefinition *propDefs); void setupObject(QWidget *object); void setupEditor(QWidget *object, PropertyDefinition *propDefs); @@ -120,7 +120,7 @@ class ItemListEditor: public AbstractItemEditor Q_OBJECT public: - ItemListEditor(QDesignerFormWindowInterface *form, QWidget *parent); + explicit ItemListEditor(QDesignerFormWindowInterface *form, QWidget *parent); void setupEditor(QWidget *object, PropertyDefinition *propDefs); QListWidget *listWidget() const { return ui.listWidget; } @@ -150,6 +150,8 @@ protected: virtual void setItemData(int role, const QVariant &v); virtual QVariant getItemData(int role) const; +private: + void setPropertyBrowserVisible(bool v); void updateEditor(); Ui::ItemListEditor ui; bool m_updating; diff --git a/tools/designer/src/components/taskmenu/listwidgeteditor.h b/tools/designer/src/components/taskmenu/listwidgeteditor.h index 7719451..12d0591 100644 --- a/tools/designer/src/components/taskmenu/listwidgeteditor.h +++ b/tools/designer/src/components/taskmenu/listwidgeteditor.h @@ -45,7 +45,7 @@ #include "itemlisteditor.h" #include <qdesigner_command_p.h> -#include <QtGui/QDialog> +#include <QtGui/QWidget> QT_BEGIN_NAMESPACE diff --git a/tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp b/tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp index e3170bd..e98714f 100644 --- a/tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp +++ b/tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp @@ -94,7 +94,7 @@ void TableWidgetTaskMenu::editItems() Q_ASSERT(m_tableWidget != 0); - TableWidgetEditor dlg(m_formWindow, m_tableWidget->window()); + TableWidgetEditorDialog dlg(m_formWindow, m_tableWidget->window()); TableWidgetContents oldCont = dlg.fillContentsFromTableWidget(m_tableWidget); if (dlg.exec() == QDialog::Accepted) { TableWidgetContents newCont = dlg.contents(); diff --git a/tools/designer/src/components/taskmenu/tablewidgeteditor.cpp b/tools/designer/src/components/taskmenu/tablewidgeteditor.cpp index 4455ff1..35f1a0e 100644 --- a/tools/designer/src/components/taskmenu/tablewidgeteditor.cpp +++ b/tools/designer/src/components/taskmenu/tablewidgeteditor.cpp @@ -57,10 +57,10 @@ QT_BEGIN_NAMESPACE -using namespace qdesigner_internal; +namespace qdesigner_internal { -TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent) - : AbstractItemEditor(form, parent), m_updatingBrowser(false) +TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog) + : AbstractItemEditor(form, 0), m_updatingBrowser(false) { m_columnEditor = new ItemListEditor(form, this); m_columnEditor->setObjectName(QLatin1String("columnEditor")); @@ -68,12 +68,12 @@ TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QWidget m_rowEditor = new ItemListEditor(form, this); m_rowEditor->setObjectName(QLatin1String("rowEditor")); m_rowEditor->setNewItemText(tr("New Row")); - ui.setupUi(this); + ui.setupUi(dialog); injectPropertyBrowser(ui.itemsTab, ui.widget); connect(ui.showPropertiesButton, SIGNAL(clicked()), this, SLOT(togglePropertyBrowser())); - togglePropertyBrowser(); + setPropertyBrowserVisible(false); ui.tabWidget->insertTab(0, m_columnEditor, tr("&Columns")); ui.tabWidget->insertTab(1, m_rowEditor, tr("&Rows")); @@ -83,6 +83,36 @@ TableWidgetEditor::TableWidgetEditor(QDesignerFormWindowInterface *form, QWidget ui.tableWidget->setSelectionMode(QAbstractItemView::SingleSelection); connect(iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded())); + + connect(ui.tableWidget, SIGNAL(currentCellChanged(int,int,int,int)), + this, SLOT(on_tableWidget_currentCellChanged(int,int,int,int))); + connect(ui.tableWidget, SIGNAL(itemChanged(QTableWidgetItem*)), + this, SLOT(on_tableWidget_itemChanged(QTableWidgetItem*))); + connect(m_columnEditor, SIGNAL(indexChanged(int)), + this, SLOT(on_columnEditor_indexChanged(int))); + connect(m_columnEditor, SIGNAL(itemChanged(int,int,QVariant)), + this, SLOT(on_columnEditor_itemChanged(int,int,QVariant))); + connect(m_columnEditor, SIGNAL(itemInserted(int)), + this, SLOT(on_columnEditor_itemInserted(int))); + connect(m_columnEditor, SIGNAL(itemDeleted(int)), + this, SLOT(on_columnEditor_itemDeleted(int))); + connect(m_columnEditor, SIGNAL(itemMovedUp(int)), + this, SLOT(on_columnEditor_itemMovedUp(int))); + connect(m_columnEditor, SIGNAL(itemMovedDown(int)), + this, SLOT(on_columnEditor_itemMovedDown(int))); + + connect(m_rowEditor, SIGNAL(indexChanged(int)), + this, SLOT(on_rowEditor_indexChanged(int))); + connect(m_rowEditor, SIGNAL(itemChanged(int,int,QVariant)), + this, SLOT(on_rowEditor_itemChanged(int,int,QVariant))); + connect(m_rowEditor, SIGNAL(itemInserted(int)), + this, SLOT(on_rowEditor_itemInserted(int))); + connect(m_rowEditor, SIGNAL(itemDeleted(int)), + this, SLOT(on_rowEditor_itemDeleted(int))); + connect(m_rowEditor, SIGNAL(itemMovedUp(int)), + this, SLOT(on_rowEditor_itemMovedUp(int))); + connect(m_rowEditor, SIGNAL(itemMovedDown(int)), + this, SLOT(on_rowEditor_itemMovedDown(int))); } static AbstractItemEditor::PropertyDefinition tableHeaderPropList[] = { @@ -207,16 +237,15 @@ void TableWidgetEditor::on_rowEditor_itemChanged(int idx, int role, const QVaria ui.tableWidget->verticalHeaderItem(idx)->setData(role, v); } +void TableWidgetEditor::setPropertyBrowserVisible(bool v) +{ + ui.showPropertiesButton->setText(v ? tr("Properties &>>") : tr("Properties &<<")); + m_propertyBrowser->setVisible(v); +} + void TableWidgetEditor::togglePropertyBrowser() { - // Always hide in case parent widget is not visible -> on startup - const bool isVisible = - !this->isVisible() ? true : m_propertyBrowser->isVisible(); - if (isVisible) - ui.showPropertiesButton->setText(tr("Properties &<<")); - else - ui.showPropertiesButton->setText(tr("Properties &>>")); - m_propertyBrowser->setVisible(!isVisible); + setPropertyBrowserVisible(!m_propertyBrowser->isVisible()); } void TableWidgetEditor::updateEditor() @@ -400,4 +429,22 @@ void TableWidgetEditor::cacheReloaded() reloadIconResources(iconCache(), ui.tableWidget); } +TableWidgetEditorDialog::TableWidgetEditorDialog(QDesignerFormWindowInterface *form, QWidget *parent) : + QDialog(parent), m_editor(form, this) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +} + +TableWidgetContents TableWidgetEditorDialog::fillContentsFromTableWidget(QTableWidget *tableWidget) +{ + return m_editor.fillContentsFromTableWidget(tableWidget); +} + +TableWidgetContents TableWidgetEditorDialog::contents() const +{ + return m_editor.contents(); +} + +} // namespace qdesigner_internal + QT_END_NAMESPACE diff --git a/tools/designer/src/components/taskmenu/tablewidgeteditor.h b/tools/designer/src/components/taskmenu/tablewidgeteditor.h index cea2e2f..1d5ad1f 100644 --- a/tools/designer/src/components/taskmenu/tablewidgeteditor.h +++ b/tools/designer/src/components/taskmenu/tablewidgeteditor.h @@ -46,6 +46,8 @@ #include "listwidgeteditor.h" +#include <QtGui/QDialog> + QT_BEGIN_NAMESPACE class QTableWidget; @@ -60,7 +62,7 @@ class TableWidgetEditor: public AbstractItemEditor { Q_OBJECT public: - TableWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent); + explicit TableWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog); TableWidgetContents fillContentsFromTableWidget(QTableWidget *tableWidget); TableWidgetContents contents() const; @@ -95,6 +97,7 @@ protected: virtual QVariant getItemData(int role) const; private: + void setPropertyBrowserVisible(bool v); void updateEditor(); void moveColumnsLeft(int fromColumn, int toColumn); void moveColumnsRight(int fromColumn, int toColumn); @@ -107,6 +110,19 @@ private: bool m_updatingBrowser; }; +class TableWidgetEditorDialog : public QDialog +{ + Q_OBJECT +public: + explicit TableWidgetEditorDialog(QDesignerFormWindowInterface *form, QWidget *parent); + + TableWidgetContents fillContentsFromTableWidget(QTableWidget *tableWidget); + TableWidgetContents contents() const; + +private: + TableWidgetEditor m_editor; +}; + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp b/tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp index 882c656..96210dc 100644 --- a/tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp +++ b/tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp @@ -93,7 +93,7 @@ void TreeWidgetTaskMenu::editItems() Q_ASSERT(m_treeWidget != 0); - TreeWidgetEditor dlg(m_formWindow, m_treeWidget->window()); + TreeWidgetEditorDialog dlg(m_formWindow, m_treeWidget->window()); TreeWidgetContents oldCont = dlg.fillContentsFromTreeWidget(m_treeWidget); if (dlg.exec() == QDialog::Accepted) { TreeWidgetContents newCont = dlg.contents(); diff --git a/tools/designer/src/components/taskmenu/treewidgeteditor.cpp b/tools/designer/src/components/taskmenu/treewidgeteditor.cpp index 50fc86a..f5f6035 100644 --- a/tools/designer/src/components/taskmenu/treewidgeteditor.cpp +++ b/tools/designer/src/components/taskmenu/treewidgeteditor.cpp @@ -60,18 +60,18 @@ QT_BEGIN_NAMESPACE namespace qdesigner_internal { -TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent) - : AbstractItemEditor(form, parent), m_updatingBrowser(false) +TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog) + : AbstractItemEditor(form, 0), m_updatingBrowser(false) { m_columnEditor = new ItemListEditor(form, this); m_columnEditor->setObjectName(QLatin1String("columnEditor")); m_columnEditor->setNewItemText(tr("New Column")); - ui.setupUi(this); + ui.setupUi(dialog); injectPropertyBrowser(ui.itemsTab, ui.widget); connect(ui.showPropertiesButton, SIGNAL(clicked()), this, SLOT(togglePropertyBrowser())); - togglePropertyBrowser(); + setPropertyBrowserVisible(false); ui.tabWidget->insertTab(0, m_columnEditor, tr("&Columns")); ui.tabWidget->setCurrentIndex(0); @@ -87,6 +87,30 @@ TreeWidgetEditor::TreeWidgetEditor(QDesignerFormWindowInterface *form, QWidget * ui.treeWidget->header()->setMovable(false); + connect(ui.newItemButton, SIGNAL(clicked()), this, SLOT(on_newItemButton_clicked())); + connect(ui.newSubItemButton, SIGNAL(clicked()), this, SLOT(on_newSubItemButton_clicked())); + connect(ui.moveItemUpButton, SIGNAL(clicked()), this, SLOT(on_moveItemUpButton_clicked())); + connect(ui.moveItemDownButton, SIGNAL(clicked()), this, SLOT(on_moveItemDownButton_clicked())); + connect(ui.moveItemRightButton, SIGNAL(clicked()), this, SLOT(on_moveItemRightButton_clicked())); + connect(ui.moveItemLeftButton, SIGNAL(clicked()), this, SLOT(on_moveItemLeftButton_clicked())); + connect(ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), + this, SLOT(on_treeWidget_currentItemChanged())); + connect(ui.treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), + this, SLOT(on_treeWidget_itemChanged(QTreeWidgetItem*,int))); + + connect(m_columnEditor, SIGNAL(indexChanged(int)), + this, SLOT(on_columnEditor_indexChanged(int))); + connect(m_columnEditor, SIGNAL(itemChanged(int,int,QVariant)), + this, SLOT(on_columnEditor_itemChanged(int,int,QVariant))); + connect(m_columnEditor, SIGNAL(itemInserted(int)), + this, SLOT(on_columnEditor_itemInserted(int))); + connect(m_columnEditor, SIGNAL(itemDeleted(int)), + this, SLOT(on_columnEditor_itemDeleted(int))); + connect(m_columnEditor, SIGNAL(itemMovedUp(int)), + this, SLOT(on_columnEditor_itemMovedUp(int))); + connect(m_columnEditor, SIGNAL(itemMovedDown(int)), + this, SLOT(on_columnEditor_itemMovedDown(int))); + connect(iconCache(), SIGNAL(reloaded()), this, SLOT(cacheReloaded())); } @@ -386,15 +410,13 @@ void TreeWidgetEditor::on_moveItemRightButton_clicked() void TreeWidgetEditor::togglePropertyBrowser() { - // Always hide in case parent widget is not visible -> on startup - const bool isVisible = - !this->isVisible() ? true : m_propertyBrowser->isVisible(); - if (isVisible) - ui.showPropertiesButton->setText(tr("Properties &<<")); - else - ui.showPropertiesButton->setText(tr("Properties &>>")); + setPropertyBrowserVisible(!m_propertyBrowser->isVisible()); +} - m_propertyBrowser->setVisible(!isVisible); +void TreeWidgetEditor::setPropertyBrowserVisible(bool v) +{ + ui.showPropertiesButton->setText(v ? tr("Properties &>>") : tr("Properties &<<")); + m_propertyBrowser->setVisible(v); } void TreeWidgetEditor::on_treeWidget_currentItemChanged() @@ -599,5 +621,22 @@ void TreeWidgetEditor::cacheReloaded() reloadIconResources(iconCache(), ui.treeWidget); } +TreeWidgetEditorDialog::TreeWidgetEditorDialog(QDesignerFormWindowInterface *form, QWidget *parent) : + QDialog(parent), m_editor(form, this) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); +} + +TreeWidgetContents TreeWidgetEditorDialog::fillContentsFromTreeWidget(QTreeWidget *treeWidget) +{ + return m_editor.fillContentsFromTreeWidget(treeWidget); } + +TreeWidgetContents TreeWidgetEditorDialog::contents() const +{ + return m_editor.contents(); +} + +} // namespace qdesigner_internal + QT_END_NAMESPACE diff --git a/tools/designer/src/components/taskmenu/treewidgeteditor.h b/tools/designer/src/components/taskmenu/treewidgeteditor.h index 461b20f..f502bf3 100644 --- a/tools/designer/src/components/taskmenu/treewidgeteditor.h +++ b/tools/designer/src/components/taskmenu/treewidgeteditor.h @@ -46,6 +46,8 @@ #include "listwidgeteditor.h" +#include <QtGui/QDialog> + QT_BEGIN_NAMESPACE class QTreeWidget; @@ -60,7 +62,7 @@ class TreeWidgetEditor: public AbstractItemEditor { Q_OBJECT public: - TreeWidgetEditor(QDesignerFormWindowInterface *form, QWidget *parent); + explicit TreeWidgetEditor(QDesignerFormWindowInterface *form, QDialog *dialog); TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget); TreeWidgetContents contents() const; @@ -93,6 +95,7 @@ protected: virtual QVariant getItemData(int role) const; private: + void setPropertyBrowserVisible(bool v); QtVariantProperty *setupPropertyGroup(const QString &title, PropertyDefinition *propDefs); void updateEditor(); void moveColumnItems(const PropertyDefinition *propList, QTreeWidgetItem *item, int fromColumn, int toColumn, int step); @@ -106,6 +109,19 @@ private: bool m_updatingBrowser; }; +class TreeWidgetEditorDialog : public QDialog +{ + Q_OBJECT +public: + explicit TreeWidgetEditorDialog(QDesignerFormWindowInterface *form, QWidget *parent); + + TreeWidgetContents fillContentsFromTreeWidget(QTreeWidget *treeWidget); + TreeWidgetContents contents() const; + +private: + TreeWidgetEditor m_editor; +}; + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/designer/qdesigner_workbench.cpp b/tools/designer/src/designer/qdesigner_workbench.cpp index 840667a..ffc4b8c 100644 --- a/tools/designer/src/designer/qdesigner_workbench.cpp +++ b/tools/designer/src/designer/qdesigner_workbench.cpp @@ -198,7 +198,7 @@ QDesignerWorkbench::QDesignerWorkbench() : // Build main menu bar addMenu(m_globalMenuBar, tr("&File"), m_actionManager->fileActions()->actions()); - QMenu *editMenu = addMenu(m_globalMenuBar, tr("Edit"), m_actionManager->editActions()->actions()); + QMenu *editMenu = addMenu(m_globalMenuBar, tr("&Edit"), m_actionManager->editActions()->actions()); editMenu->addSeparator(); addActionsToMenu(editMenu, m_actionManager->toolActions()->actions()); diff --git a/tools/designer/src/lib/sdk/membersheet.qdoc b/tools/designer/src/lib/sdk/membersheet.qdoc index fdd13f2..57a3664 100644 --- a/tools/designer/src/lib/sdk/membersheet.qdoc +++ b/tools/designer/src/lib/sdk/membersheet.qdoc @@ -40,7 +40,7 @@ manipulate the member functions' appearance in \QD's signals and slots editing mode. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 2 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 2 When implementing a custom widget plugin, a pointer to \QD's current QDesignerFormEditorInterface object (\c formEditor in the @@ -69,7 +69,7 @@ made known to the meta object system using the Q_INTERFACES() macro: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 3 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 3 This enables \QD to use qobject_cast() to query for supported interfaces using nothing but a QObject pointer. @@ -101,13 +101,13 @@ QExtensionFactory and reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 4 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 4 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a member sheet extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 5 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 5 For a complete example using an extension class, see \l {designer/taskmenuextension}{Task Menu Extension example}. The diff --git a/tools/designer/src/lib/sdk/propertysheet.qdoc b/tools/designer/src/lib/sdk/propertysheet.qdoc index d82de88..becc74b 100644 --- a/tools/designer/src/lib/sdk/propertysheet.qdoc +++ b/tools/designer/src/lib/sdk/propertysheet.qdoc @@ -41,7 +41,7 @@ manipulate the properties' appearance in the property editor. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 15 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 15 Note that if you change the value of a property using the QDesignerPropertySheetExtension::setProperty() function, the undo @@ -80,7 +80,7 @@ an interface, we must ensure that it's made known to the meta object system using the Q_INTERFACES() macro: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 16 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 16 This enables \QD to use qobject_cast() to query for supported interfaces using nothing but a QObject pointer. @@ -112,14 +112,14 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 17 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 17 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a property sheet extension extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 18 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 18 For a complete example using an extension class, see the \l {designer/taskmenuextension}{Task Menu Extension example}. The diff --git a/tools/designer/src/lib/sdk/taskmenu.qdoc b/tools/designer/src/lib/sdk/taskmenu.qdoc index 06d0b96..c5a3795 100644 --- a/tools/designer/src/lib/sdk/taskmenu.qdoc +++ b/tools/designer/src/lib/sdk/taskmenu.qdoc @@ -51,7 +51,7 @@ inherit from both QObject and QDesignerTaskMenuExtension. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 9 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 9 Since we are implementing an interface, we must ensure that it is made known to the meta-object system using the Q_INTERFACES() @@ -94,13 +94,13 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 10 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 10 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a task menu extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 11 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 11 For a complete example using the QDesignerTaskMenuExtension class, see the \l {designer/taskmenuextension}{Task Menu Extension diff --git a/tools/designer/src/lib/shared/newactiondialog.ui b/tools/designer/src/lib/shared/newactiondialog.ui index 17b5d64..aef9710 100644 --- a/tools/designer/src/lib/shared/newactiondialog.ui +++ b/tools/designer/src/lib/shared/newactiondialog.ui @@ -89,6 +89,50 @@ <item row="1" column="1"> <widget class="QLineEdit" name="editObjectName"/> </item> + <item row="2" column="0"> + <widget class="QLabel" name="toolTipLabel"> + <property name="text"> + <string>T&oolTip:</string> + </property> + <property name="buddy"> + <cstring>tooltipEditor</cstring> + </property> + </widget> + </item> + <item row="2" column="1"> + <layout class="QHBoxLayout" name="toolTipLayout"> + <item> + <widget class="TextPropertyEditor" name="tooltipEditor" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolTipToolButton"> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="iconThemeLabel"> + <property name="text"> + <string>Icon th&eme:</string> + </property> + <property name="buddy"> + <cstring>iconThemeEditor</cstring> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="qdesigner_internal::IconThemeEditor" name="iconThemeEditor" native="true"/> + </item> <item row="4" column="0"> <widget class="QLabel" name="iconLabel"> <property name="text"> @@ -119,16 +163,6 @@ </item> </layout> </item> - <item row="6" column="0"> - <widget class="QLabel" name="shortcutLabel"> - <property name="text"> - <string>&Shortcut:</string> - </property> - <property name="buddy"> - <cstring>keySequenceEdit</cstring> - </property> - </widget> - </item> <item row="5" column="1"> <widget class="QCheckBox" name="checkableCheckBox"> <property name="text"> @@ -146,37 +180,16 @@ </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="toolTipLabel"> + <item row="6" column="0"> + <widget class="QLabel" name="shortcutLabel"> <property name="text"> - <string>T&oolTip:</string> + <string>&Shortcut:</string> </property> <property name="buddy"> - <cstring>tooltipEditor</cstring> + <cstring>keySequenceEdit</cstring> </property> </widget> </item> - <item row="2" column="1"> - <layout class="QHBoxLayout" name="toolTipLayout"> - <item> - <widget class="TextPropertyEditor" name="tooltipEditor" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolTipToolButton"> - <property name="text"> - <string>...</string> - </property> - </widget> - </item> - </layout> - </item> <item row="6" column="1"> <layout class="QHBoxLayout" name="keysequenceLayout"> <item> @@ -198,19 +211,6 @@ </item> </layout> </item> - <item row="3" column="0"> - <widget class="QLabel" name="iconThemeLabel"> - <property name="text"> - <string>Icon th&eme:</string> - </property> - <property name="buddy"> - <cstring>iconThemeEditor</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="qdesigner_internal::IconThemeEditor" name="iconThemeEditor" native="true"/> - </item> </layout> </item> <item> diff --git a/tools/designer/src/lib/shared/qdesigner_command.cpp b/tools/designer/src/lib/shared/qdesigner_command.cpp index 148b4c8..f4e250d 100644 --- a/tools/designer/src/lib/shared/qdesigner_command.cpp +++ b/tools/designer/src/lib/shared/qdesigner_command.cpp @@ -2094,12 +2094,12 @@ void AddContainerWidgetPageCommand::init(QWidget *containerWidget, ContainerType case PageContainer: setText(QApplication::translate("Command", "Insert Page")); m_widget = new QDesignerWidget(formWindow(), m_containerWidget); - m_widget->setObjectName(QApplication::translate("Command", "page")); + m_widget->setObjectName(QLatin1String("page")); break; case MdiContainer: setText(QApplication::translate("Command", "Insert Subwindow")); m_widget = new QDesignerWidget(formWindow(), m_containerWidget); - m_widget->setObjectName(QApplication::translate("Command", "subwindow")); + m_widget->setObjectName(QLatin1String("subwindow")); setPropertySheetWindowTitle(core, m_widget, QApplication::translate("Command", "Subwindow")); break; case WizardContainer: // Apply style, don't manage diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index babe20e..27527da 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -1195,8 +1195,17 @@ bool QDesignerPropertySheet::reset(int index) { if (d->invalidIndex(Q_FUNC_INFO, index)) return false; - if (d->isStringProperty(index)) - setProperty(index, QVariant::fromValue(qdesigner_internal::PropertySheetStringValue())); + if (d->isStringProperty(index)) { + qdesigner_internal::PropertySheetStringValue value; + // Main container: Reset to stored class name as not to change the file names generated by uic. + if (propertyName(index) == QLatin1String("objectName")) { + const QVariant classNameDefaultV = d->m_object->property("_q_classname"); + if (classNameDefaultV.isValid()) + value.setValue(classNameDefaultV.toString()); + } + setProperty(index, QVariant::fromValue(value)); + return true; + } if (d->isKeySequenceProperty(index)) setProperty(index, QVariant::fromValue(qdesigner_internal::PropertySheetKeySequenceValue())); if (d->isResourceProperty(index)) { diff --git a/tools/designer/src/lib/shared/shared.pri b/tools/designer/src/lib/shared/shared.pri index 8286360..9d50911 100644 --- a/tools/designer/src/lib/shared/shared.pri +++ b/tools/designer/src/lib/shared/shared.pri @@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD contains(QT_CONFIG, script): QT += script -include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri) +include(../../../../shared/qtpropertybrowser/qtpropertybrowserutils.pri) include(../../../../shared/deviceskin/deviceskin.pri) include(../../../../../src/tools/rcc/rcc.pri) include(../../../../shared/findwidget/findwidget.pri) diff --git a/tools/designer/src/lib/uilib/container.qdoc b/tools/designer/src/lib/uilib/container.qdoc index 51d942e..d931051 100644 --- a/tools/designer/src/lib/uilib/container.qdoc +++ b/tools/designer/src/lib/uilib/container.qdoc @@ -44,7 +44,7 @@ To create a container extension, your extension class must inherit from both QObject and QDesignerContainerExtension. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 6 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 6 Since we are implementing an interface, we must ensure that it's made known to the meta object system using the Q_INTERFACES() @@ -88,13 +88,13 @@ reimplement the QExtensionFactory::createExtension() function. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 7 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 7 Or you can use an existing factory, expanding the QExtensionFactory::createExtension() function to make the factory able to create a container extension as well. For example: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 8 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 8 For a complete example using the QDesignerContainerExtension class, see the \l {designer/containerextension}{Container diff --git a/tools/designer/src/lib/uilib/customwidget.qdoc b/tools/designer/src/lib/uilib/customwidget.qdoc index 3410fc6..d5ddaa7 100644 --- a/tools/designer/src/lib/uilib/customwidget.qdoc +++ b/tools/designer/src/lib/uilib/customwidget.qdoc @@ -73,7 +73,7 @@ class called \c MyCustomWidget, we can export it by adding the following line to the file containing the plugin implementation: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 14 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 14 This macro ensures that \QD can access and construct the custom widget. Without this macro, there is no way for \QD to use it. @@ -264,13 +264,13 @@ several custom widgets \c CustomWidgetOne, \c CustomWidgetTwo and \c CustomWidgetThree, the class definition may look like this: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 12 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 12 In the class constructor you add the interfaces to your custom widgets to the list which you return in the customWidgets() function: - \snippet doc/src/snippets/code/doc_src_qtdesigner.qdoc 13 + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 13 Note that instead of exporting each custom widget plugin using the Q_EXPORT_PLUGIN2() macro, you export the entire collection. The diff --git a/tools/designer/src/uitools/uitools.pro b/tools/designer/src/uitools/uitools.pro index 6e0a247..be46afc 100644 --- a/tools/designer/src/uitools/uitools.pro +++ b/tools/designer/src/uitools/uitools.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -TARGET = $$qtLibraryTarget(QtUiTools) +TARGET = QtUiTools QT += xml CONFIG += qt staticlib DESTDIR = ../../../../lib @@ -43,3 +43,5 @@ unix|win32-g++* { QMAKE_PKGCONFIG_DESTDIR = pkgconfig QMAKE_PKGCONFIG_REQUIRES += QtXml } + +TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end |