diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-03 03:00:35 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-11-03 03:00:35 +0100 |
commit | 2095b1598ebe1d3ee91f9eeb1f7a13a4cbbf36f9 (patch) | |
tree | a25c55389f4073408ddd123d7663462078005acb /src | |
parent | 24189b5f0935914a979b7e9d3786bec8f9f019bc (diff) | |
parent | 767f783d65fdd8d154167966b75525c73036e27e (diff) | |
download | qttools-2095b1598ebe1d3ee91f9eeb1f7a13a4cbbf36f9.tar.gz |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Icff4035509596e277f4612cdfa9363cdaa5371bf
Diffstat (limited to 'src')
27 files changed, 202 insertions, 181 deletions
diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp index fb868c788..4647f154f 100644 --- a/src/assistant/assistant/preferencesdialog.cpp +++ b/src/assistant/assistant/preferencesdialog.cpp @@ -381,6 +381,7 @@ QList<int> PreferencesDialog::currentRegisteredDocsSelection() const QList<int> result; for (const QModelIndex &index : m_ui.registeredDocsListView->selectionModel()->selectedRows()) result.append(m_registereredDocsFilterModel->mapToSource(index).row()); + std::sort(result.begin(), result.end()); return result; } diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index 52a0e3b13..fcb8f68ef 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -79,7 +79,7 @@ #include <QtWidgets/qmenu.h> #include <QtWidgets/qaction.h> #include <QtWidgets/qactiongroup.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qundogroup.h> @@ -374,7 +374,7 @@ bool FormWindow::isChildOf(const QWidget *c, const QWidget *p) void FormWindow::setCursorToAll(const QCursor &c, QWidget *start) { -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) start->setCursor(c); const QWidgetList widgets = start->findChildren<QWidget*>(); for (QWidget *widget : widgets) { @@ -1646,7 +1646,7 @@ QString FormWindow::contents() const return QString::fromUtf8(b.buffer()); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void FormWindow::copy() { QBuffer b; @@ -1730,7 +1730,7 @@ QWidget *FormWindow::containerForPaste() const return w; } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) // Construct DomUI from clipboard (paste) and determine number of widgets/actions. static inline DomUI *domUIFromClipboard(int *widgetCount, int *actionCount) { @@ -1813,7 +1813,7 @@ static void positionPastedWidgetsAtMousePosition(FormWindow *fw, const QPoint &c (*it)->move((*it)->pos() + offset); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void FormWindow::paste(PasteMode pasteMode) { // Avoid QDesignerResource constructing widgets that are not used as @@ -1942,7 +1942,7 @@ void FormWindow::manageWidget(QWidget *w) m_insertedWidgets.insert(w); m_widgets.append(w); -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) setCursorToAll(Qt::ArrowCursor, w); #endif diff --git a/src/designer/src/components/formeditor/formwindow.h b/src/designer/src/components/formeditor/formwindow.h index 9cfaadb2c..9edfa5d53 100644 --- a/src/designer/src/components/formeditor/formwindow.h +++ b/src/designer/src/components/formeditor/formwindow.h @@ -199,7 +199,7 @@ public: // Initialize and return a popup menu for a managed widget QMenu *initializePopupMenu(QWidget *managedWidget) override; -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void paste(PasteMode pasteMode) override; #endif QEditorFormBuilder *createFormBuilder() override; @@ -216,7 +216,7 @@ public slots: void deleteWidgets(); void raiseWidgets(); void lowerWidgets(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void copy(); void cut(); void paste(); diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp index 410d9cad9..914180fe6 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.cpp +++ b/src/designer/src/components/formeditor/formwindowmanager.cpp @@ -66,7 +66,7 @@ #include <QtGui/qevent.h> #include <QtWidgets/qapplication.h> #include <QtWidgets/qsizegrip.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qmdiarea.h> @@ -157,7 +157,7 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e) case QEvent::ChildAdded: case QEvent::ChildPolished: case QEvent::ChildRemoved: -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) case QEvent::Clipboard: #endif case QEvent::ContentsRectChange: @@ -364,7 +364,7 @@ QWidget *FormWindowManager::findManagedWidget(FormWindow *fw, QWidget *w) void FormWindowManager::setupActions() { -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) const QIcon cutIcon = QIcon::fromTheme(QStringLiteral("edit-cut"), createIconSet(QStringLiteral("editcut.png"))); m_actionCut = new QAction(cutIcon, tr("Cu&t"), this); m_actionCut->setObjectName(QStringLiteral("__qt_cut_action")); @@ -530,7 +530,7 @@ void FormWindowManager::setupActions() m_actionShowFormWindowSettingsDialog->setEnabled(false); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void FormWindowManager::slotActionCutActivated() { m_activeFormWindow->cut(); @@ -814,7 +814,7 @@ void FormWindowManager::slotUpdateActions() int selectedWidgetCount = 0; int laidoutWidgetCount = 0; int unlaidoutWidgetCount = 0; -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) bool pasteAvailable = false; #endif bool layoutAvailable = false; @@ -832,7 +832,7 @@ void FormWindowManager::slotUpdateActions() QWidgetList simplifiedSelection = m_activeFormWindow->selectedWidgets(); selectedWidgetCount = simplifiedSelection.count(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) pasteAvailable = qApp->clipboard()->mimeData() && qApp->clipboard()->mimeData()->hasText(); #endif @@ -902,7 +902,7 @@ void FormWindowManager::slotUpdateActions() } } while(false); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) m_actionCut->setEnabled(selectedWidgetCount > 0); m_actionCopy->setEnabled(selectedWidgetCount > 0); m_actionPaste->setEnabled(pasteAvailable); @@ -998,7 +998,7 @@ void FormWindowManager::slotActionShowFormWindowSettingsDialog() QAction *FormWindowManager::action(Action action) const { switch (action) { -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) case QDesignerFormWindowManagerInterface::CutAction: return m_actionCut; case QDesignerFormWindowManagerInterface::CopyAction: diff --git a/src/designer/src/components/formeditor/formwindowmanager.h b/src/designer/src/components/formeditor/formwindowmanager.h index fb8d58bd9..16fa319f4 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.h +++ b/src/designer/src/components/formeditor/formwindowmanager.h @@ -91,7 +91,7 @@ public slots: void deviceProfilesChanged(); private slots: -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void slotActionCutActivated(); void slotActionCopyActivated(); void slotActionPasteActivated(); @@ -132,7 +132,7 @@ private: QWidget *m_morphLayoutContainer; // edit actions -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) QAction *m_actionCut; QAction *m_actionCopy; QAction *m_actionPaste; diff --git a/src/designer/src/components/formeditor/widgetselection.cpp b/src/designer/src/components/formeditor/widgetselection.cpp index 40c0cfb6b..608428554 100644 --- a/src/designer/src/components/formeditor/widgetselection.cpp +++ b/src/designer/src/components/formeditor/widgetselection.cpp @@ -93,7 +93,7 @@ WidgetHandle::WidgetHandle(FormWindow *parent, WidgetHandle::Type t, WidgetSelec void WidgetHandle::updateCursor() { -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) if (!m_active) { setCursor(Qt::ArrowCursor); return; diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp index 848ac8946..6ba9c1519 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -52,7 +52,7 @@ #include <QtWidgets/qtoolbutton.h> #include <QtWidgets/qboxlayout.h> #include <QtCore/qfileinfo.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qlineedit.h> @@ -551,7 +551,7 @@ private slots: void resourceActionActivated(); void fileActionActivated(); void themeActionActivated(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void copyActionActivated(); void pasteActionActivated(); void clipboardDataChanged(); @@ -616,14 +616,14 @@ PixmapEditor::PixmapEditor(QDesignerFormEditorInterface *core, QWidget *parent) connect(m_resourceAction, &QAction::triggered, this, &PixmapEditor::resourceActionActivated); connect(m_fileAction, &QAction::triggered, this, &PixmapEditor::fileActionActivated); connect(m_themeAction, &QAction::triggered, this, &PixmapEditor::themeActionActivated); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) connect(m_copyAction, &QAction::triggered, this, &PixmapEditor::copyActionActivated); connect(m_pasteAction, &QAction::triggered, this, &PixmapEditor::pasteActionActivated); #endif setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored)); setFocusProxy(m_button); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &PixmapEditor::clipboardDataChanged); clipboardDataChanged(); @@ -748,7 +748,7 @@ void PixmapEditor::themeActionActivated() } } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void PixmapEditor::copyActionActivated() { QClipboard *clipboard = QApplication::clipboard(); diff --git a/src/designer/src/components/tabordereditor/tabordereditor.cpp b/src/designer/src/components/tabordereditor/tabordereditor.cpp index e4139fbea..94cb59ddb 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor.cpp @@ -261,7 +261,7 @@ void TabOrderEditor::initTabOrder() void TabOrderEditor::mouseMoveEvent(QMouseEvent *e) { e->accept(); -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) if (m_indicator_region.contains(e->pos())) setCursor(Qt::PointingHandCursor); else diff --git a/src/designer/src/components/widgetbox/widgetbox.xml b/src/designer/src/components/widgetbox/widgetbox.xml index a610d4eb9..802c28f67 100644 --- a/src/designer/src/components/widgetbox/widgetbox.xml +++ b/src/designer/src/components/widgetbox/widgetbox.xml @@ -277,6 +277,16 @@ </ui> </categoryentry> + <categoryentry name="Undo View" icon="widgets/listbox.png"> + <ui> + <widget class="QUndoView"> + <property name="objectName"> + <string notr="true">undoView</string> + </property> + </widget> + </ui> + </categoryentry> + </category> <category name="Item Widgets (Item-Based)"> diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 70f277e37..a5e357994 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -72,8 +72,13 @@ #include <QtGui/qicon.h> #include <QtGui/qimage.h> #include <QtGui/qpixmap.h> -#ifndef QT_NO_PRINTER -#include <QtPrintSupport/qprintdialog.h> +#if defined(QT_PRINTSUPPORT_LIB) // Some platforms may not build QtPrintSupport +# include <QtPrintSupport/qtprintsupportglobal.h> +# if QT_CONFIG(printer) && QT_CONFIG(printdialog) +# include <QtPrintSupport/qprinter.h> +# include <QtPrintSupport/qprintdialog.h> +# define HAS_PRINTER +# endif #endif #include <QtGui/qpainter.h> #include <QtGui/qtransform.h> @@ -169,8 +174,6 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_settingsActions(createActionGroup(this)), m_windowActions(createActionGroup(this)), m_toolActions(createActionGroup(this, true)), - m_helpActions(0), - m_styleActions(0), m_editWidgetsAction(new QAction(tr("Edit Widgets"), this)), m_newFormAction(new QAction(qdesigner_internal::createIconSet(QStringLiteral("filenew.png")), tr("&New..."), this)), m_openFormAction(new QAction(qdesigner_internal::createIconSet(QStringLiteral("fileopen.png")), tr("&Open..."), this)), @@ -182,19 +185,13 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_savePreviewImageAction(new QAction(tr("Save &Image..."), this)), m_printPreviewAction(new QAction(tr("&Print..."), this)), m_quitAction(new QAction(tr("&Quit"), this)), - m_previewFormAction(0), m_viewCodeAction(new QAction(tr("View &Code..."), this)), m_minimizeAction(new QAction(tr("&Minimize"), this)), m_bringAllToFrontSeparator(createSeparator(this)), m_bringAllToFrontAction(new QAction(tr("Bring All to Front"), this)), m_windowListSeparatorAction(createSeparator(this)), m_preferencesAction(new QAction(tr("Preferences..."), this)), - m_appFontAction(new QAction(tr("Additional Fonts..."), this)), - m_appFontDialog(0), -#ifndef QT_NO_PRINTER - m_printer(0), -#endif - m_previewManager(0) + m_appFontAction(new QAction(tr("Additional Fonts..."), this)) { typedef void (QDesignerActions::*VoidSlot)(); @@ -487,7 +484,7 @@ QActionGroup *QDesignerActions::createHelpActions() QDesignerActions::~QDesignerActions() { -#ifndef QT_NO_PRINTER +#ifdef HAS_PRINTER delete m_printer; #endif } @@ -1363,7 +1360,7 @@ void QDesignerActions::formWindowCountChanged() void QDesignerActions::printPreviewImage() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#ifdef HAS_PRINTER QDesignerFormWindowInterface *fw = core()->formWindowManager()->activeFormWindow(); if (!fw) return; @@ -1409,7 +1406,7 @@ void QDesignerActions::printPreviewImage() core()->topLevel()->setCursor(oldCursor); showStatusBarMessage(tr("Printed %1.").arg(QFileInfo(fw->fileName()).fileName())); -#endif +#endif // HAS_PRINTER } QT_END_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_actions.h b/src/designer/src/designer/qdesigner_actions.h index 0daad568f..95556cffd 100644 --- a/src/designer/src/designer/qdesigner_actions.h +++ b/src/designer/src/designer/qdesigner_actions.h @@ -34,9 +34,6 @@ #include <QtCore/qobject.h> #include <QtCore/qpointer.h> -#ifndef QT_NO_PRINTER -#include <QtPrintSupport/qprinter.h> -#endif QT_BEGIN_NAMESPACE @@ -53,6 +50,7 @@ class AppFontDialog; class QRect; class QWidget; class QPixmap; +class QPrinter; class QMenu; namespace qdesigner_internal { @@ -176,8 +174,8 @@ private: QActionGroup *m_settingsActions; QActionGroup *m_windowActions; QActionGroup *m_toolActions; - QActionGroup *m_helpActions; - QActionGroup *m_styleActions; + QActionGroup *m_helpActions = nullptr; + QActionGroup *m_styleActions = nullptr; QAction *m_editWidgetsAction; @@ -193,7 +191,7 @@ private: QAction *m_quitAction; - QAction *m_previewFormAction; + QAction *m_previewFormAction = nullptr; QAction *m_viewCodeAction; QAction *m_minimizeAction; @@ -206,11 +204,9 @@ private: QPointer<AppFontDialog> m_appFontDialog; -#ifndef QT_NO_PRINTER - QPrinter *m_printer; -#endif + QPrinter *m_printer = nullptr; - qdesigner_internal::PreviewManager *m_previewManager; + qdesigner_internal::PreviewManager *m_previewManager = nullptr; }; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp index 7c1062c91..85d54a767 100644 --- a/src/designer/src/lib/shared/actioneditor.cpp +++ b/src/designer/src/lib/shared/actioneditor.cpp @@ -51,7 +51,7 @@ #include <QtWidgets/qsplitter.h> #include <QtWidgets/qaction.h> #include <QtWidgets/qapplication.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qitemdelegate.h> @@ -111,7 +111,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, m_actionNew(new QAction(tr("New..."), this)), m_actionEdit(new QAction(tr("Edit..."), this)), m_actionNavigateToSlot(new QAction(tr("Go to slot..."), this)), -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) m_actionCopy(new QAction(tr("Copy"), this)), m_actionCut(new QAction(tr("Cut"), this)), m_actionPaste(new QAction(tr("Paste"), this)), @@ -144,7 +144,7 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, connect(m_actionSelectAll, &QAction::triggered, m_actionView, &ActionView::selectAll); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) m_actionCut->setEnabled(false); connect(m_actionCut, &QAction::triggered, this, &ActionEditor::slotCut); QIcon editCutIcon = QIcon::fromTheme(QStringLiteral("edit-cut"), createIconSet(QStringLiteral("editcut.png"))); @@ -296,7 +296,7 @@ void ActionEditor::setFormWindow(QDesignerFormWindowInterface *formWindow) m_actionView->model()->clearActions(); m_actionEdit->setEnabled(false); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) m_actionCopy->setEnabled(false); m_actionCut->setEnabled(false); #endif @@ -326,7 +326,7 @@ void ActionEditor::setFormWindow(QDesignerFormWindowInterface *formWindow) void ActionEditor::slotSelectionChanged(const QItemSelection& selected, const QItemSelection& /*deselected*/) { const bool hasSelection = !selected.indexes().empty(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) m_actionCopy->setEnabled(hasSelection); m_actionCut->setEnabled(hasSelection); #endif @@ -613,7 +613,7 @@ void ActionEditor::deleteActions(QDesignerFormWindowInterface *fw, const ActionL fw->endCommand(); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void ActionEditor::copyActions(QDesignerFormWindowInterface *fwi, const ActionList &actions) { FormWindowBase *fw = qobject_cast<FormWindowBase *>(fwi); @@ -776,7 +776,7 @@ void ActionEditor::updateViewModeActions() } } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void ActionEditor::slotCopy() { QDesignerFormWindowInterface *fw = formWindow(); @@ -836,7 +836,7 @@ void ActionEditor::slotContextMenuRequested(QContextMenuEvent *e, QAction *item) } menu.addSeparator(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) menu.addAction(m_actionCut); menu.addAction(m_actionCopy); menu.addAction(m_actionPaste); diff --git a/src/designer/src/lib/shared/actioneditor_p.h b/src/designer/src/lib/shared/actioneditor_p.h index e651ab52b..0c913d477 100644 --- a/src/designer/src/lib/shared/actioneditor_p.h +++ b/src/designer/src/lib/shared/actioneditor_p.h @@ -109,7 +109,7 @@ private slots: void slotContextMenuRequested(QContextMenuEvent *, QAction *); void slotViewMode(QAction *a); void slotSelectAssociatedWidget(QWidget *w); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void slotCopy(); void slotCut(); void slotPaste(); @@ -123,7 +123,7 @@ signals: private: typedef QList<QAction *> ActionList; void deleteActions(QDesignerFormWindowInterface *formWindow, const ActionList &); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void copyActions(QDesignerFormWindowInterface *formWindow, const ActionList &); #endif @@ -143,7 +143,7 @@ private: QAction *m_actionNew; QAction *m_actionEdit; QAction *m_actionNavigateToSlot; -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) QAction *m_actionCopy; QAction *m_actionCut; QAction *m_actionPaste; diff --git a/src/designer/src/lib/shared/codedialog.cpp b/src/designer/src/lib/shared/codedialog.cpp index e01c75ac3..6793481c6 100644 --- a/src/designer/src/lib/shared/codedialog.cpp +++ b/src/designer/src/lib/shared/codedialog.cpp @@ -34,7 +34,7 @@ #include <QtWidgets/qaction.h> #include <QtWidgets/qapplication.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qdialogbuttonbox.h> @@ -84,7 +84,7 @@ CodeDialog::CodeDialog(QWidget *parent) : QAction *saveAction = toolBar->addAction(saveIcon, tr("Save...")); connect(saveAction, &QAction::triggered, this, &CodeDialog::slotSaveAs); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) const QIcon copyIcon = createIconSet(QStringLiteral("editcopy.png")); QAction *copyAction = toolBar->addAction(copyIcon, tr("Copy All")); connect(copyAction, &QAction::triggered, this, &CodeDialog::copyAll); @@ -245,7 +245,7 @@ void CodeDialog::warning(const QString &msg) msg, QMessageBox::Close); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void CodeDialog::copyAll() { QApplication::clipboard()->setText(code()); diff --git a/src/designer/src/lib/shared/codedialog_p.h b/src/designer/src/lib/shared/codedialog_p.h index 1707a034b..c185d0f52 100644 --- a/src/designer/src/lib/shared/codedialog_p.h +++ b/src/designer/src/lib/shared/codedialog_p.h @@ -66,7 +66,7 @@ public: private slots: void slotSaveAs(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void copyAll(); #endif diff --git a/src/designer/src/lib/shared/connectionedit.cpp b/src/designer/src/lib/shared/connectionedit.cpp index 556d2039c..11bfcb4e7 100644 --- a/src/designer/src/lib/shared/connectionedit.cpp +++ b/src/designer/src/lib/shared/connectionedit.cpp @@ -1120,7 +1120,7 @@ void ConnectionEdit::abortConnection() m_tmp_con->update(); delete m_tmp_con; m_tmp_con = 0; -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) setCursor(QCursor()); #endif if (m_widget_under_mouse == m_bg_widget) @@ -1213,7 +1213,7 @@ void ConnectionEdit::mouseReleaseEvent(QMouseEvent *e) abortConnection(); else endConnection(m_widget_under_mouse, e->pos()); -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) setCursor(QCursor()); #endif break; @@ -1248,7 +1248,7 @@ void ConnectionEdit::findObjectsUnderMouse(const QPoint &pos) const EndPoint hs = endPointAt(pos); if (hs != m_end_point_under_mouse) { -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) if (m_end_point_under_mouse.isNull()) setCursor(Qt::PointingHandCursor); else @@ -1271,7 +1271,7 @@ void ConnectionEdit::mouseMoveEvent(QMouseEvent *e) && !m_widget_under_mouse.isNull()) { m_start_connection_on_drag = false; startConnection(m_widget_under_mouse, e->pos()); -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) setCursor(Qt::CrossCursor); #endif } diff --git a/src/designer/src/lib/shared/formwindowbase_p.h b/src/designer/src/lib/shared/formwindowbase_p.h index 6c7f03de3..d6cf094a9 100644 --- a/src/designer/src/lib/shared/formwindowbase_p.h +++ b/src/designer/src/lib/shared/formwindowbase_p.h @@ -122,7 +122,7 @@ public: virtual void highlightWidget(QWidget *w, const QPoint &pos, HighlightMode mode = Highlight) = 0; enum PasteMode { PasteAll, PasteActionsOnly }; -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) virtual void paste(PasteMode pasteMode) = 0; #endif diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp index 150d2c8b8..e20b9c0d3 100644 --- a/src/designer/src/lib/shared/qtresourceview.cpp +++ b/src/designer/src/lib/shared/qtresourceview.cpp @@ -50,7 +50,7 @@ #include <QtWidgets/qpushbutton.h> #include <QtWidgets/qmessagebox.h> #include <QtWidgets/qapplication.h> -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) #include <QtGui/qclipboard.h> #endif #include <QtWidgets/qmenu.h> @@ -134,7 +134,7 @@ public: void slotResourceActivated(QListWidgetItem *); void slotEditResources(); void slotReloadResources(); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void slotCopyResourcePath(); #endif void slotListWidgetContextMenuRequested(const QPoint &pos); @@ -238,7 +238,7 @@ void QtResourceViewPrivate::slotReloadResources() } } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) void QtResourceViewPrivate::slotCopyResourcePath() { const QString path = q_ptr->selectedResource(); @@ -574,7 +574,7 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare connect(d_ptr->m_reloadResourcesAction, SIGNAL(triggered()), this, SLOT(slotReloadResources())); d_ptr->m_reloadResourcesAction->setEnabled(false); -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) QIcon copyIcon = QIcon::fromTheme(QStringLiteral("edit-copy"), qdesigner_internal::createIconSet(QStringLiteral("editcopy.png"))); d_ptr->m_copyResourcePathAction = new QAction(copyIcon, tr("Copy Path"), this); connect(d_ptr->m_copyResourcePathAction, SIGNAL(triggered()), this, SLOT(slotCopyResourcePath())); diff --git a/src/designer/src/lib/shared/qtresourceview_p.h b/src/designer/src/lib/shared/qtresourceview_p.h index b32e9370b..732b1fd62 100644 --- a/src/designer/src/lib/shared/qtresourceview_p.h +++ b/src/designer/src/lib/shared/qtresourceview_p.h @@ -98,7 +98,7 @@ private: Q_PRIVATE_SLOT(d_func(), void slotResourceActivated(QListWidgetItem *)) Q_PRIVATE_SLOT(d_func(), void slotEditResources()) Q_PRIVATE_SLOT(d_func(), void slotReloadResources()) -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) Q_PRIVATE_SLOT(d_func(), void slotCopyResourcePath()) #endif Q_PRIVATE_SLOT(d_func(), void slotListWidgetContextMenuRequested(const QPoint &pos)) diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index 04e1ebe39..061da9d48 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -418,7 +418,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge if (QMainWindow *mw = qobject_cast<QMainWindow*>(parentWidget)) { -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) // the menubar if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(widget)) { mw->setMenuBar(menuBar); @@ -426,7 +426,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_TOOLBAR +#if QT_CONFIG(toolbar) // apply the toolbar's attributes if (QToolBar *toolBar = qobject_cast<QToolBar*>(widget)) { mw->addToolBar(toolbarAreaFromDOMAttributes(attributes), toolBar); @@ -439,7 +439,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_STATUSBAR +#if QT_CONFIG(statusbar) // statusBar if (QStatusBar *statusBar = qobject_cast<QStatusBar*>(widget)) { mw->setStatusBar(statusBar); @@ -447,7 +447,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // apply the dockwidget's attributes if (QDockWidget *dockWidget = qobject_cast<QDockWidget*>(widget)) { if (const DomProperty *attr = attributes.value(strings.dockWidgetAreaAttribute)) { @@ -476,7 +476,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(parentWidget)) { widget->setParent(0); @@ -492,13 +492,13 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge tabWidget->setTabIcon(tabIndex, qvariant_cast<QIcon>(nativeValue)); } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) { tabWidget->setTabToolTip(tabIndex, toString(ptoolTip->elementString())); } #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) if (const DomProperty *pwhatsThis = attributes.value(strings.whatsThisAttribute)) { tabWidget->setTabWhatsThis(tabIndex, toString(pwhatsThis->elementString())); } @@ -508,7 +508,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) else if (QToolBox *toolBox = qobject_cast<QToolBox*>(parentWidget)) { const int tabIndex = toolBox->count(); if (const DomProperty *labelP = attributes.value(strings.labelAttribute, 0)) @@ -522,7 +522,7 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge toolBox->setItemIcon(tabIndex, qvariant_cast<QIcon>(nativeValue)); } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) { toolBox->setItemToolTip(tabIndex, toString(ptoolTip->elementString())); } @@ -532,42 +532,42 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(stackedwidget) else if (QStackedWidget *stackedWidget = qobject_cast<QStackedWidget*>(parentWidget)) { stackedWidget->addWidget(widget); return true; } #endif -#ifndef QT_NO_SPLITTER +#if QT_CONFIG(splitter) else if (QSplitter *splitter = qobject_cast<QSplitter*>(parentWidget)) { splitter->addWidget(widget); return true; } #endif -#ifndef QT_NO_MDIAREA +#if QT_CONFIG(mdiarea) else if (QMdiArea *mdiArea = qobject_cast<QMdiArea*>(parentWidget)) { mdiArea->addSubWindow(widget); return true; } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) else if (QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget)) { dockWidget->setWidget(widget); return true; } #endif -#ifndef QT_NO_SCROLLAREA +#if QT_CONFIG(scrollarea) else if (QScrollArea *scrollArea = qobject_cast<QScrollArea*>(parentWidget)) { scrollArea->setWidget(widget); return true; } #endif -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) else if (QWizard *wizard = qobject_cast<QWizard *>(parentWidget)) { QWizardPage *page = qobject_cast<QWizardPage*>(widget); if (!page) { @@ -744,7 +744,7 @@ QLayout *QAbstractFormBuilder::create(DomLayout *ui_layout, QLayout *parentLayou return layout; } -#ifndef QT_NO_FORMLAYOUT +#if QT_CONFIG(formlayout) static inline QFormLayout::ItemRole formLayoutRole(int column, int colspan) { if (colspan > 1) @@ -841,7 +841,7 @@ bool QAbstractFormBuilder::addItem(DomLayoutItem *ui_item, QLayoutItem *item, QL rowSpan, colSpan, item->alignment()); return true; } -#ifndef QT_NO_FORMLAYOUT +#if QT_CONFIG(formlayout) if (QFormLayout *form = qobject_cast<QFormLayout *>(layout)) { const int row = ui_item->attributeRow(); const int colSpan = ui_item->hasAttributeColSpan() ? ui_item->attributeColSpan() : 1; @@ -1288,7 +1288,7 @@ DomWidget *QAbstractFormBuilder::createDom(QWidget *widget, DomWidget *ui_parent // splitters need to store their children in the order specified by child indexes, // not the order of the child list. -#ifndef QT_NO_SPLITTER +#if QT_CONFIG(splitter) if (const QSplitter *splitter = qobject_cast<const QSplitter*>(widget)) { const int count = splitter->count(); for (int i = 0; i < count; ++i) @@ -1450,7 +1450,7 @@ static QList<FormBuilderSaveLayoutEntry> saveGridLayoutEntries(QGridLayout *grid return rc; } -#ifndef QT_NO_FORMLAYOUT +#if QT_CONFIG(formlayout) // Create list from form layout static QList<FormBuilderSaveLayoutEntry> saveFormLayoutEntries(const QFormLayout *formLayout) { @@ -1498,7 +1498,7 @@ DomLayout *QAbstractFormBuilder::createDom(QLayout *layout, DomLayout *ui_layout QList<FormBuilderSaveLayoutEntry> newList; if (QGridLayout *gridLayout = qobject_cast<QGridLayout *>(layout)) { newList = saveGridLayoutEntries(gridLayout); -#ifndef QT_NO_FORMLAYOUT +#if QT_CONFIG(formlayout) } else if (const QFormLayout *formLayout = qobject_cast<const QFormLayout *>(layout)) { newList = saveFormLayoutEntries(formLayout); #endif @@ -2523,36 +2523,36 @@ void QAbstractFormBuilder::loadExtraInfo(DomWidget *ui_widget, QWidget *widget, { const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); if (false) { -#ifndef QT_NO_LISTWIDGET +#if QT_CONFIG(listwidget) } else if (QListWidget *listWidget = qobject_cast<QListWidget*>(widget)) { loadListWidgetExtraInfo(ui_widget, listWidget, parentWidget); #endif -#ifndef QT_NO_TREEWIDGET +#if QT_CONFIG(treewidget) } else if (QTreeWidget *treeWidget = qobject_cast<QTreeWidget*>(widget)) { loadTreeWidgetExtraInfo(ui_widget, treeWidget, parentWidget); #endif -#ifndef QT_NO_TABLEWIDGET +#if QT_CONFIG(tablewidget) } else if (QTableWidget *tableWidget = qobject_cast<QTableWidget*>(widget)) { loadTableWidgetExtraInfo(ui_widget, tableWidget, parentWidget); #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) } else if (QComboBox *comboBox = qobject_cast<QComboBox*>(widget)) { if (!qobject_cast<QFontComboBox *>(widget)) loadComboBoxExtraInfo(ui_widget, comboBox, parentWidget); #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(widget)) { const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); if (currentIndex) tabWidget->setCurrentIndex(currentIndex->elementNumber()); #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(stackedwidget) } else if (QStackedWidget *stackedWidget = qobject_cast<QStackedWidget*>(widget)) { const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); if (currentIndex) stackedWidget->setCurrentIndex(currentIndex->elementNumber()); #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) } else if (QToolBox *toolBox = qobject_cast<QToolBox*>(widget)) { const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); if (currentIndex) diff --git a/src/designer/src/lib/uilib/formbuilder.cpp b/src/designer/src/lib/uilib/formbuilder.cpp index bbf356ba5..d5defe039 100644 --- a/src/designer/src/lib/uilib/formbuilder.cpp +++ b/src/designer/src/lib/uilib/formbuilder.cpp @@ -135,25 +135,25 @@ QWidget *QFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget) d->setProcessingLayoutWidget(false); if (ui_widget->attributeClass() == QFormBuilderStrings::instance().qWidgetClass && !ui_widget->hasAttributeNative() && parentWidget -#ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(mainwindow) && !qobject_cast<QMainWindow *>(parentWidget) #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) && !qobject_cast<QToolBox *>(parentWidget) #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(stackedwidget) && !qobject_cast<QStackedWidget *>(parentWidget) #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(tabwidget) && !qobject_cast<QTabWidget *>(parentWidget) #endif -#ifndef QT_NO_SCROLLAREA +#if QT_CONFIG(scrollarea) && !qobject_cast<QScrollArea *>(parentWidget) #endif -#ifndef QT_NO_MDIAREA +#if QT_CONFIG(mdiarea) && !qobject_cast<QMdiArea *>(parentWidget) #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) && !qobject_cast<QDockWidget *>(parentWidget) #endif ) { @@ -178,15 +178,15 @@ QWidget *QFormBuilder::createWidget(const QString &widgetName, QWidget *parentWi QWidget *w = 0; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (qobject_cast<QTabWidget*>(parentWidget)) parentWidget = 0; #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(stackedwidget) if (qobject_cast<QStackedWidget*>(parentWidget)) parentWidget = 0; #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) if (qobject_cast<QToolBox*>(parentWidget)) parentWidget = 0; #endif diff --git a/src/designer/src/lib/uilib/properties.cpp b/src/designer/src/lib/uilib/properties.cpp index cd891234b..dafd1ee14 100644 --- a/src/designer/src/lib/uilib/properties.cpp +++ b/src/designer/src/lib/uilib/properties.cpp @@ -281,7 +281,7 @@ QVariant domPropertyToVariant(const DomProperty *p) return QVariant(QUrl(url->elementString()->text())); } -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) case DomProperty::Cursor: return QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(p->elementCursor()))); @@ -479,7 +479,7 @@ static bool applySimpleProperty(const QVariant &v, bool translateString, DomProp } return true; -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) case QVariant::Cursor: { const QMetaEnum cursorShape_enum = metaEnum<QAbstractFormBuilderGadget>("cursorShape"); dom_prop->setElementCursorShape(QLatin1String(cursorShape_enum.valueToKey(qvariant_cast<QCursor>(v).shape()))); diff --git a/src/designer/src/lib/uilib/widgets.table b/src/designer/src/lib/uilib/widgets.table index 7516bf0af..3dbb7aff2 100644 --- a/src/designer/src/lib/uilib/widgets.table +++ b/src/designer/src/lib/uilib/widgets.table @@ -4,135 +4,140 @@ #endif // widgets -#ifndef QT_NO_CHECKBOX +#if QT_CONFIG(checkbox) DECLARE_WIDGET(QCheckBox, "text") #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) DECLARE_WIDGET(QComboBox, "") #endif -#ifndef QT_NO_DATETIMEEDIT +#if QT_CONFIG(datetimeedit) DECLARE_WIDGET(QDateTimeEdit, "") -#endif -#ifndef QT_NO_DATEEDIT DECLARE_WIDGET(QDateEdit, "") -#endif -#ifndef QT_NO_TIMEEDIT DECLARE_WIDGET(QTimeEdit, "") #endif -#ifndef QT_NO_DIAL +#if QT_CONFIG(dial) DECLARE_WIDGET(QDial, "") #endif DECLARE_WIDGET(QDialog, "") -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) DECLARE_WIDGET(QDockWidget, "") #endif DECLARE_WIDGET(QFrame, "") -#ifndef QT_NO_GROUPBOX +#if QT_CONFIG(groupbox) DECLARE_WIDGET(QGroupBox, "") #endif -#ifndef QT_NO_SCROLLAREA +#if QT_CONFIG(scrollarea) DECLARE_WIDGET(QScrollArea, "") #endif -#ifndef QT_NO_LCDNUMBER +#if QT_CONFIG(lcdnumber) DECLARE_WIDGET(QLCDNumber, "") #endif DECLARE_WIDGET(QLabel, "") -#ifndef QT_NO_LINEEDIT +#if QT_CONFIG(lineedit) DECLARE_WIDGET(QLineEdit, "") #endif -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) DECLARE_WIDGET(QListView, "") #endif -#ifndef QT_NO_LISTWIDGET +#if QT_CONFIG(listwidget) DECLARE_WIDGET(QListWidget, "") #endif -#ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(mainwindow) DECLARE_WIDGET(QMainWindow, "") #endif -#ifndef QT_NO_MDIAREA +#if QT_CONFIG(mdiarea) DECLARE_WIDGET(QMdiArea, "") #endif -#ifndef QT_NO_MENU +#if QT_CONFIG(menu) DECLARE_WIDGET(QMenu, "") #endif -#ifndef QT_NO_MENUBAR +#if QT_CONFIG(menubar) DECLARE_WIDGET(QMenuBar, "") #endif -#ifndef QT_NO_PROGRESSBAR +#if QT_CONFIG(progressbar) DECLARE_WIDGET(QProgressBar, "") #endif +#if QT_CONFIG(pushbutton) DECLARE_WIDGET(QPushButton, "text") +#endif +#if QT_CONFIG(radiobutton) DECLARE_WIDGET(QRadioButton, "text") +#endif +#if QT_CONFIG(commandlinkbutton) DECLARE_WIDGET(QCommandLinkButton, "text") -#ifndef QT_NO_SCROLLBAR +#endif +#if QT_CONFIG(scrollbar) DECLARE_WIDGET(QScrollBar, "") #endif -#ifndef QT_NO_SLIDER +#if QT_CONFIG(slider) DECLARE_WIDGET(QSlider, "") #endif -#ifndef QT_NO_SPINBOX +#if QT_CONFIG(spinbox) DECLARE_WIDGET(QSpinBox, "") DECLARE_WIDGET(QDoubleSpinBox, "") #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) DECLARE_WIDGET(QTabWidget, "") #endif -#ifndef QT_NO_TABLEVIEW +#if QT_CONFIG(tableview) DECLARE_WIDGET(QTableView, "") #endif -#ifndef QT_NO_TABLEWIDGET +#if QT_CONFIG(tablewidget) DECLARE_WIDGET(QTableWidget, "") #endif -#ifndef QT_NO_TEXTBROWSER +#if QT_CONFIG(textbrowser) DECLARE_WIDGET(QTextBrowser, "") #endif -#ifndef QT_NO_TEXTEDIT +#if QT_CONFIG(textedit) DECLARE_WIDGET(QTextEdit, "") DECLARE_WIDGET(QPlainTextEdit, "") #endif -#ifndef QT_NO_TOOLBAR +#if QT_CONFIG(toolbar) DECLARE_WIDGET(QToolBar, "") #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) DECLARE_WIDGET(QToolBox, "") #endif -#ifndef QT_NO_TOOLBUTTON +#if QT_CONFIG(toolbutton) DECLARE_WIDGET(QToolButton, "text") #endif -#ifndef QT_NO_TREEVIEW +#if QT_CONFIG(treeview) DECLARE_WIDGET(QTreeView, "") #endif -#ifndef QT_NO_TREEWIDGET +#if QT_CONFIG(treewidget) DECLARE_WIDGET(QTreeWidget, "") #endif DECLARE_WIDGET(QWidget, "") -#ifndef QT_NO_KEYSEQUENCEEDIT +#if QT_CONFIG(keysequenceedit) DECLARE_WIDGET(QKeySequenceEdit, "") #endif -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) DECLARE_WIDGET(QOpenGLWidget, "") #endif -#ifndef QT_NO_SPLITTER +#if QT_CONFIG(splitter) DECLARE_WIDGET(QSplitter, "") #endif -#ifndef QT_NO_STACKEDWIDGET +#if QT_CONFIG(stackedwidget) DECLARE_WIDGET(QStackedWidget, "") #endif -#ifndef QT_NO_STATUSBAR +#if QT_CONFIG(statusbar) DECLARE_WIDGET(QStatusBar, "") #endif DECLARE_WIDGET(QDialogButtonBox, "") -#ifndef QT_NO_FONTCOMBOBOX +#if QT_CONFIG(fontcombobox) DECLARE_WIDGET(QFontComboBox, "") #endif -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) DECLARE_WIDGET(QCalendarWidget, "") #endif -#ifndef QT_NO_COLUMNVIEW +#if QT_CONFIG(columnview) DECLARE_WIDGET(QColumnView, "") #endif +#if QT_CONFIG(undoview) +DECLARE_WIDGET(QUndoView, "") +#endif -#ifndef QT_NO_WIZARD +#if QT_CONFIG(wizard) DECLARE_WIDGET(QWizard, "") DECLARE_WIDGET(QWizardPage, "") #endif @@ -146,6 +151,6 @@ DECLARE_LAYOUT(QGridLayout, "") DECLARE_LAYOUT(QHBoxLayout, "") DECLARE_LAYOUT(QStackedLayout, "") DECLARE_LAYOUT(QVBoxLayout, "") -#ifndef QT_NO_FORMLAYOUT +#if QT_CONFIG(formlayout) DECLARE_LAYOUT(QFormLayout, "") #endif diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp index 5caf6623e..98bebe731 100644 --- a/src/designer/src/uitools/quiloader.cpp +++ b/src/designer/src/uitools/quiloader.cpp @@ -169,13 +169,13 @@ QVariant TranslatingTextBuilder::toNativeValue(const QVariant &value) const // This is "exported" to linguist const QUiItemRolePair qUiItemRoles[] = { { Qt::DisplayRole, Qt::DisplayPropertyRole }, -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) { Qt::ToolTipRole, Qt::ToolTipPropertyRole }, #endif -#ifndef QT_NO_STATUSTIP +#if QT_CONFIG(statustip) { Qt::StatusTipRole, Qt::StatusTipPropertyRole }, #endif -#ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) { Qt::WhatsThisRole, Qt::WhatsThisPropertyRole }, #endif { -1 , -1 } @@ -255,26 +255,26 @@ public: } } if (0) { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (QTabWidget *tabw = qobject_cast<QTabWidget*>(o)) { const int cnt = tabw->count(); for (int i = 0; i < cnt; ++i) { RETRANSLATE_SUBWIDGET_PROP(tabw, setTabText, PROP_TABPAGETEXT); -# ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) RETRANSLATE_SUBWIDGET_PROP(tabw, setTabToolTip, PROP_TABPAGETOOLTIP); # endif -# ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) RETRANSLATE_SUBWIDGET_PROP(tabw, setTabWhatsThis, PROP_TABPAGEWHATSTHIS); # endif } #endif -#ifndef QT_NO_LISTWIDGET +#if QT_CONFIG(listwidget) } else if (QListWidget *listw = qobject_cast<QListWidget*>(o)) { const int cnt = listw->count(); for (int i = 0; i < cnt; ++i) reTranslateWidgetItem(listw->item(i), m_className, m_idBased); #endif -#ifndef QT_NO_TREEWIDGET +#if QT_CONFIG(treewidget) } else if (QTreeWidget *treew = qobject_cast<QTreeWidget*>(o)) { if (QTreeWidgetItem *item = treew->headerItem()) recursiveReTranslate(item, m_className, m_idBased); @@ -284,7 +284,7 @@ public: recursiveReTranslate(item, m_className, m_idBased); } #endif -#ifndef QT_NO_TABLEWIDGET +#if QT_CONFIG(tablewidget) } else if (QTableWidget *tablew = qobject_cast<QTableWidget*>(o)) { const int row_cnt = tablew->rowCount(); const int col_cnt = tablew->columnCount(); @@ -296,7 +296,7 @@ public: reTranslateTableItem(tablew->item(i, j), m_className, m_idBased); } #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) } else if (QComboBox *combow = qobject_cast<QComboBox*>(o)) { if (!qobject_cast<QFontComboBox*>(o)) { const int cnt = combow->count(); @@ -309,12 +309,12 @@ public: } } #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) } else if (QToolBox *toolw = qobject_cast<QToolBox*>(o)) { const int cnt = toolw->count(); for (int i = 0; i < cnt; ++i) { RETRANSLATE_SUBWIDGET_PROP(toolw, setItemText, PROP_TOOLITEMTEXT); -# ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) RETRANSLATE_SUBWIDGET_PROP(toolw, setItemToolTip, PROP_TOOLITEMTOOLTIP); # endif } @@ -482,24 +482,24 @@ QWidget *FormBuilderPrivate::create(DomWidget *ui_widget, QWidget *parentWidget) return 0; if (0) { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (qobject_cast<QTabWidget*>(w)) { #endif -#ifndef QT_NO_LISTWIDGET +#if QT_CONFIG(listwidget) } else if (qobject_cast<QListWidget*>(w)) { #endif -#ifndef QT_NO_TREEWIDGET +#if QT_CONFIG(treewidget) } else if (qobject_cast<QTreeWidget*>(w)) { #endif -#ifndef QT_NO_TABLEWIDGET +#if QT_CONFIG(tablewidget) } else if (qobject_cast<QTableWidget*>(w)) { #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) } else if (qobject_cast<QComboBox*>(w)) { if (qobject_cast<QFontComboBox*>(w)) return w; #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) } else if (qobject_cast<QToolBox*>(w)) { #endif } else { @@ -539,24 +539,24 @@ bool FormBuilderPrivate::addItem(DomWidget *ui_widget, QWidget *widget, QWidget const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); if (0) { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(parentWidget)) { const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute()); const int i = tabWidget->count() - 1; TRANSLATE_SUBWIDGET_PROP(tabWidget, titleAttribute, setTabText, PROP_TABPAGETEXT); -# ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) TRANSLATE_SUBWIDGET_PROP(tabWidget, toolTipAttribute, setTabToolTip, PROP_TABPAGETOOLTIP); # endif -# ifndef QT_NO_WHATSTHIS +#if QT_CONFIG(whatsthis) TRANSLATE_SUBWIDGET_PROP(tabWidget, whatsThisAttribute, setTabWhatsThis, PROP_TABPAGEWHATSTHIS); # endif #endif -#ifndef QT_NO_TOOLBOX +#if QT_CONFIG(toolbox) } else if (QToolBox *toolBox = qobject_cast<QToolBox*>(parentWidget)) { const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute()); const int i = toolBox->count() - 1; TRANSLATE_SUBWIDGET_PROP(toolBox, labelAttribute, setItemText, PROP_TOOLITEMTEXT); -# ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) TRANSLATE_SUBWIDGET_PROP(toolBox, toolTipAttribute, setItemToolTip, PROP_TOOLITEMTOOLTIP); # endif #endif diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp index b72163248..045a030b5 100644 --- a/src/linguist/shared/qmakeevaluator.cpp +++ b/src/linguist/shared/qmakeevaluator.cpp @@ -2047,6 +2047,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( #ifdef PROEVALUATOR_CUMULATIVE bool cumulative = m_cumulative; + // Even when evaluating the project in cumulative mode to maximize the + // chance of collecting all source declarations, prfs are evaluated in + // exact mode to maximize the chance of them successfully executing + // their programmatic function. m_cumulative = false; #endif @@ -2055,6 +2059,13 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( #ifdef PROEVALUATOR_CUMULATIVE m_cumulative = cumulative; + if (cumulative) { + // As the data collected in cumulative mode is potentially total + // garbage, yet the prfs fed with it are executed in exact mode, + // we must ignore their results to avoid that evaluation is unduly + // aborted. + ok = ReturnTrue; + } #endif return ok; } diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index a6ff37ea0..bba71d9d1 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -647,6 +647,7 @@ void recursiveCopyAndDeploy(const QString &appBundlePath, const QSet<QString> &r QDir().mkpath(destinationPath); LogNormal() << "copy:" << sourcePath << destinationPath; + const bool isDwarfPath = sourcePath.endsWith("DWARF"); QStringList files = QDir(sourcePath).entryList(QStringList() << QStringLiteral("*"), QDir::Files | QDir::NoDotAndDotDot); foreach (QString file, files) { @@ -654,7 +655,7 @@ void recursiveCopyAndDeploy(const QString &appBundlePath, const QSet<QString> &r if (file.endsWith("_debug.dylib")) { continue; // Skip debug versions - } else if (file.endsWith(QStringLiteral(".dylib"))) { + } else if (!isDwarfPath && file.endsWith(QStringLiteral(".dylib"))) { // App store code signing rules forbids code binaries in Contents/Resources/, // which poses a problem for deploying mixed .qml/.dylib Qt Quick imports. // Solve this by placing the dylibs in Contents/PlugIns/quick, and then diff --git a/src/shared/winutils/utils.cpp b/src/shared/winutils/utils.cpp index 8f9cc198a..cdf017715 100644 --- a/src/shared/winutils/utils.cpp +++ b/src/shared/winutils/utils.cpp @@ -314,7 +314,7 @@ bool runElevatedBackgroundProcess(const QString &binary, const QStringList &args arguments.toWCharArray(argumentsW.data()); argumentsW[arguments.size()] = 0; - SHELLEXECUTEINFO shellExecute = {0}; + SHELLEXECUTEINFO shellExecute = {}; shellExecute.cbSize = sizeof(shellExecute); shellExecute.fMask = SEE_MASK_NOCLOSEPROCESS; shellExecute.hwnd = 0; |