OSDN Git Service

build fix for the case when QT_NO_WHATSTHIS is defined
authorIvailo Monev <xakepa10@gmail.com>
Sun, 27 Feb 2022 12:03:14 +0000 (14:03 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 27 Feb 2022 12:03:14 +0000 (14:03 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/global/qconfig.h.cmake
src/designer/shared/actionrepository.cpp
src/designer/shared/plugindialog.cpp
src/designer/shared/qdesigner_command.cpp
src/designer/shared/qdesigner_tabwidget.cpp
src/designer/shared/scriptdialog.cpp
src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp
src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp
src/shared/qtpropertybrowser/qttreepropertybrowser.cpp
src/tools/qtconfig/paletteeditoradvanced.cpp
tests/auto/qstandarditem/tst_qstandarditem.cpp

index d570f98..ad138e5 100644 (file)
 // #cmakedefine QT_NO_UNDOCOMMAND
 // #cmakedefine QT_NO_UNDOSTACK
 // #cmakedefine QT_NO_VALIDATOR
+// #cmakedefine QT_NO_VECTOR4D
+// #cmakedefine QT_NO_WARNING_OUTPUT
 
 // Misc
 #cmakedefine QT_NO_USING_NAMESPACE
 #cmakedefine QT_NO_UNDOGROUP
 #cmakedefine QT_NO_UNDOVIEW
 #cmakedefine QT_NO_VECTOR2D
-#cmakedefine QT_NO_VECTOR4D
-#cmakedefine QT_NO_WARNING_OUTPUT
 #cmakedefine QT_NO_WHATSTHIS
 #cmakedefine QT_NO_WHEELEVENT
 #cmakedefine QT_NO_WIZARD
index 93a8fcc..84cfa86 100644 (file)
@@ -179,7 +179,9 @@ void  ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action,
         icon = defaultIcon;
     item->setIcon(icon);
     item->setToolTip(firstTooltip);
+#ifndef QT_NO_WHATSTHIS
     item->setWhatsThis(firstTooltip);
+#endif // QT_NO_WHATSTHIS
     // Used
     const QWidgetList associatedDesignerWidgets = associatedWidgets(action);
     const bool used = !associatedDesignerWidgets.empty();
index 3b038b5..e21db72 100644 (file)
@@ -65,7 +65,9 @@ PluginDialog::PluginDialog(QDesignerFormEditorInterface *core, QWidget *parent)
         QPushButton *updateButton = new QPushButton(tr("Refresh"));
         const QString tooltip = tr("Scan for newly installed custom widget plugins.");
         updateButton->setToolTip(tooltip);
+#ifndef QT_NO_WHATSTHIS
         updateButton->setWhatsThis(tooltip);
+#endif // QT_NO_WHATSTHIS
         connect(updateButton, SIGNAL(clicked()), this, SLOT(updateCustomWidgetPlugins()));
         ui.buttonBox->addButton(updateButton, QDialogButtonBox::ActionRole);
     }
@@ -160,7 +162,9 @@ void PluginDialog::setItem(QTreeWidgetItem *pluginItem, const QString &name,
     QTreeWidgetItem *item = new QTreeWidgetItem(pluginItem);
     item->setText(0, name);
     item->setToolTip(0, toolTip);
+#ifndef QT_NO_WHATSTHIS
     item->setWhatsThis(0, whatsThis);
+#endif // QT_NO_WHATSTHIS
     item->setIcon(0, pluginIcon(icon));
 }
 
index 9a58506..8ff20b6 100644 (file)
@@ -2190,9 +2190,11 @@ static void copyRolesToItem(const ItemData *id, T *item, DesignerIconCache *icon
                 case Qt::StatusTipPropertyRole:
                     item->setStatusTip(qvariant_cast<PropertySheetStringValue>(it.value()).value());
                     break;
+#ifndef QT_NO_WHATSTHIS
                 case Qt::WhatsThisPropertyRole:
                     item->setWhatsThis(qvariant_cast<PropertySheetStringValue>(it.value()).value());
                     break;
+#endif // QT_NO_WHATSTHIS
                 }
             }
         }
@@ -2262,9 +2264,11 @@ void ItemData::fillTreeItemColumn(QTreeWidgetItem *item, int column, DesignerIco
             case Qt::StatusTipPropertyRole:
                 item->setStatusTip(column, qvariant_cast<PropertySheetStringValue>(it.value()).value());
                 break;
+#ifndef QT_NO_WHATSTHIS
             case Qt::WhatsThisPropertyRole:
                 item->setWhatsThis(column, qvariant_cast<PropertySheetStringValue>(it.value()).value());
                 break;
+#endif // QT_NO_WHATSTHIS
             }
         }
 }
index 6919f5c..b0ca788 100644 (file)
@@ -441,7 +441,9 @@ void QTabWidgetPropertySheet::setProperty(int index, const QVariant &value)
         m_pageToData[currentWidget].tooltip = qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value);
         break;
     case PropertyCurrentTabWhatsThis:
+#ifndef QT_NO_WHATSTHIS
         m_tabWidget->setTabWhatsThis(currentIndex, qvariant_cast<QString>(resolvePropertyValue(index, value)));
+#endif // QT_NO_WHATSTHIS
         m_pageToData[currentWidget].whatsthis = qvariant_cast<qdesigner_internal::PropertySheetStringValue>(value);
         break;
     case PropertyTabWidgetNone:
index 21c6680..af6afd0 100644 (file)
@@ -51,7 +51,9 @@ namespace qdesigner_internal {
 The widget and its children are accessible via the \
 variables <i>widget</i> and <i>childWidgets</i>, respectively.");
         m_textEdit->setToolTip(textHelp);
+#ifndef QT_NO_WHATSTHIS
         m_textEdit->setWhatsThis(textHelp);
+#endif // QT_NO_WHATSTHIS
         m_textEdit->setMinimumSize(QSize(600, 400));
         vboxLayout->addWidget(m_textEdit);
         new QScriptHighlighter(m_textEdit->document());
index 882d88e..92d44dd 100644 (file)
@@ -441,7 +441,9 @@ void QtButtonPropertyBrowserPrivate::updateItem(WidgetItem *item)
         item->button->setText(property->propertyName());
         item->button->setToolTip(property->toolTip());
         item->button->setStatusTip(property->statusTip());
+#ifndef QT_NO_WHATSTHIS
         item->button->setWhatsThis(property->whatsThis());
+#endif // QT_NO_WHATSTHIS
         item->button->setEnabled(property->isEnabled());
     }
     if (item->label) {
@@ -451,7 +453,9 @@ void QtButtonPropertyBrowserPrivate::updateItem(WidgetItem *item)
         item->label->setText(property->propertyName());
         item->label->setToolTip(property->toolTip());
         item->label->setStatusTip(property->statusTip());
+#ifndef QT_NO_WHATSTHIS
         item->label->setWhatsThis(property->whatsThis());
+#endif // QT_NO_WHATSTHIS
         item->label->setEnabled(property->isEnabled());
     }
     if (item->widgetLabel) {
index 624de7b..8e9108c 100644 (file)
@@ -388,7 +388,9 @@ void QtGroupBoxPropertyBrowserPrivate::updateItem(WidgetItem *item)
         item->groupBox->setTitle(property->propertyName());
         item->groupBox->setToolTip(property->toolTip());
         item->groupBox->setStatusTip(property->statusTip());
+#ifndef QT_NO_WHATSTHIS
         item->groupBox->setWhatsThis(property->whatsThis());
+#endif // QT_NO_WHATSTHIS
         item->groupBox->setEnabled(property->isEnabled());
     }
     if (item->label) {
@@ -398,7 +400,9 @@ void QtGroupBoxPropertyBrowserPrivate::updateItem(WidgetItem *item)
         item->label->setText(property->propertyName());
         item->label->setToolTip(property->toolTip());
         item->label->setStatusTip(property->statusTip());
+#ifndef QT_NO_WHATSTHIS
         item->label->setWhatsThis(property->whatsThis());
+#endif // QT_NO_WHATSTHIS
         item->label->setEnabled(property->isEnabled());
     }
     if (item->widgetLabel) {
index 1e523d1..051e2f4 100644 (file)
@@ -579,7 +579,9 @@ void QtTreePropertyBrowserPrivate::updateItem(QTreeWidgetItem *item)
     item->setFirstColumnSpanned(!property->hasValue());
     item->setToolTip(0, property->propertyName());
     item->setStatusTip(0, property->statusTip());
+#ifndef QT_NO_WHATSTHIS
     item->setWhatsThis(0, property->whatsThis());
+#endif // QT_NO_WHATSTHIS
     item->setText(0, property->propertyName());
     bool wasEnabled = item->flags() & Qt::ItemIsEnabled;
     bool isEnabled = wasEnabled;
index c07dbe6..932b0d2 100644 (file)
@@ -32,13 +32,17 @@ PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent)
     // create a ColorButton's
     buttonCentral = new ColorButton(ui->groupCentral);
     buttonCentral->setToolTip(tr("Choose a color"));
+#ifndef QT_NO_WHATSTHIS
     buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role."));
+#endif // QT_NO_WHATSTHIS
     ui->layoutCentral->addWidget(buttonCentral);
     ui->labelCentral->setBuddy(buttonCentral);
 
     buttonEffect = new ColorButton(ui->groupEffect);
     buttonEffect->setToolTip(tr("Choose a color"));
+#ifndef QT_NO_WHATSTHIS
     buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role."));
+#endif // QT_NO_WHATSTHIS
     buttonEffect->setEnabled(false);
     ui->layoutEffect->addWidget(buttonEffect);
     ui->labelEffect->setBuddy(buttonEffect);
index d3d85e4..010984d 100644 (file)
@@ -147,10 +147,12 @@ void tst_QStandardItem::getSetData()
             QString statusTip = QString("statusTip %0").arg(i);
             item.setStatusTip(statusTip);
             QCOMPARE(item.statusTip(), statusTip);
-        
+
+#ifndef QT_NO_WHATSTHIS
             QString whatsThis = QString("whatsThis %0").arg(i);
             item.setWhatsThis(whatsThis);
             QCOMPARE(item.whatsThis(), whatsThis);
+#endif // QT_NO_WHATSTHIS
             
             QSize sizeHint(64*i, 48*i);
             item.setSizeHint(sizeHint);
@@ -182,7 +184,9 @@ void tst_QStandardItem::getSetData()
             QCOMPARE(item.icon(), icon);
             QCOMPARE(item.toolTip(), toolTip);
             QCOMPARE(item.statusTip(), statusTip);
+#ifndef QT_NO_WHATSTHIS
             QCOMPARE(item.whatsThis(), whatsThis);
+#endif // QT_NO_WHATSTHIS
             QCOMPARE(item.sizeHint(), sizeHint);
             QCOMPARE(item.font(), font);
             QCOMPARE(item.textAlignment(), textAlignment);
@@ -194,7 +198,9 @@ void tst_QStandardItem::getSetData()
             QCOMPARE(qvariant_cast<QIcon>(item.data(Qt::DecorationRole)), icon);
             QCOMPARE(qvariant_cast<QString>(item.data(Qt::ToolTipRole)), toolTip);
             QCOMPARE(qvariant_cast<QString>(item.data(Qt::StatusTipRole)), statusTip);
+#ifndef QT_NO_WHATSTHIS
             QCOMPARE(qvariant_cast<QString>(item.data(Qt::WhatsThisRole)), whatsThis);
+#endif // QT_NO_WHATSTHIS
             QCOMPARE(qvariant_cast<QSize>(item.data(Qt::SizeHintRole)), sizeHint);
             QCOMPARE(qvariant_cast<QFont>(item.data(Qt::FontRole)), font);
             QCOMPARE(qvariant_cast<int>(item.data(Qt::TextAlignmentRole)), int(textAlignment));
@@ -864,7 +870,9 @@ void tst_QStandardItem::streamItem()
     item.setText(QLatin1String("text"));
     item.setToolTip(QLatin1String("toolTip"));
     item.setStatusTip(QLatin1String("statusTip"));
+#ifndef QT_NO_WHATSTHIS
     item.setWhatsThis(QLatin1String("whatsThis"));
+#endif // QT_NO_WHATSTHIS
     item.setSizeHint(QSize(64, 48));
     item.setFont(QFont());
     item.setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@@ -884,7 +892,9 @@ void tst_QStandardItem::streamItem()
         QCOMPARE(streamedItem.text(), item.text());
         QCOMPARE(streamedItem.toolTip(), item.toolTip());
         QCOMPARE(streamedItem.statusTip(), item.statusTip());
+#ifndef QT_NO_WHATSTHIS
         QCOMPARE(streamedItem.whatsThis(), item.whatsThis());
+#endif // QT_NO_WHATSTHIS
         QCOMPARE(streamedItem.sizeHint(), item.sizeHint());
         QCOMPARE(streamedItem.font(), item.font());
         QCOMPARE(streamedItem.textAlignment(), item.textAlignment());
@@ -921,7 +931,9 @@ void tst_QStandardItem::clone()
     item.setText(QLatin1String("text"));
     item.setToolTip(QLatin1String("toolTip"));
     item.setStatusTip(QLatin1String("statusTip"));
+#ifndef QT_NO_WHATSTHIS
     item.setWhatsThis(QLatin1String("whatsThis"));
+#endif // QT_NO_WHATSTHIS
     item.setSizeHint(QSize(64, 48));
     item.setFont(QFont());
     item.setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@@ -934,7 +946,9 @@ void tst_QStandardItem::clone()
     QCOMPARE(clone->text(), item.text());
     QCOMPARE(clone->toolTip(), item.toolTip());
     QCOMPARE(clone->statusTip(), item.statusTip());
+#ifndef QT_NO_WHATSTHIS
     QCOMPARE(clone->whatsThis(), item.whatsThis());
+#endif // QT_NO_WHATSTHIS
     QCOMPARE(clone->sizeHint(), item.sizeHint());
     QCOMPARE(clone->font(), item.font());
     QCOMPARE(clone->textAlignment(), item.textAlignment());