Merge "Improve support for QT_ADDITIONAL_PACKAGES_PREFIX_PATH"
This commit is contained in:
commit
4a037e86d4
@ -46,6 +46,10 @@ if(APPLE AND (NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/macos")
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/macos")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(QT_ADDITIONAL_PACKAGES_PREFIX_PATH "" CACHE STRING "Additional directories where find(Qt6 ...) components are searched")
|
||||||
|
file(TO_CMAKE_PATH "${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}" _qt_additional_packages_prefix_path)
|
||||||
|
file(TO_CMAKE_PATH "$ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH}" _qt_additional_packages_prefix_path_env)
|
||||||
|
|
||||||
# Find required dependencies, if any.
|
# Find required dependencies, if any.
|
||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake")
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake")
|
||||||
@ -68,7 +72,8 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS})
|
|||||||
${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_REQUIRED}
|
${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_REQUIRED}
|
||||||
PATHS
|
PATHS
|
||||||
${_qt_cmake_dir}
|
${_qt_cmake_dir}
|
||||||
${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
|
${_qt_additional_packages_prefix_path}
|
||||||
|
${_qt_additional_packages_prefix_path_env}
|
||||||
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
||||||
${__qt_use_no_default_path_for_qt_packages}
|
${__qt_use_no_default_path_for_qt_packages}
|
||||||
)
|
)
|
||||||
|
@ -8,7 +8,8 @@ endif()
|
|||||||
find_dependency(@INSTALL_CMAKE_NAMESPACE@ @PROJECT_VERSION@
|
find_dependency(@INSTALL_CMAKE_NAMESPACE@ @PROJECT_VERSION@
|
||||||
PATHS
|
PATHS
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/.."
|
"${CMAKE_CURRENT_LIST_DIR}/.."
|
||||||
${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
|
${_qt_additional_packages_prefix_path}
|
||||||
|
${_qt_additional_packages_prefix_path_env}
|
||||||
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
||||||
${__qt_use_no_default_path_for_qt_packages}
|
${__qt_use_no_default_path_for_qt_packages}
|
||||||
)
|
)
|
||||||
@ -86,7 +87,8 @@ foreach(_target_dep ${_target_deps})
|
|||||||
find_dependency(${pkg} ${version}
|
find_dependency(${pkg} ${version}
|
||||||
PATHS
|
PATHS
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/.."
|
"${CMAKE_CURRENT_LIST_DIR}/.."
|
||||||
${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
|
${_qt_additional_packages_prefix_path}
|
||||||
|
${_qt_additional_packages_prefix_path_env}
|
||||||
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
||||||
${__qt_use_no_default_path_for_qt_packages}
|
${__qt_use_no_default_path_for_qt_packages}
|
||||||
)
|
)
|
||||||
|
@ -42,7 +42,8 @@ foreach(_target_dep ${_target_deps})
|
|||||||
find_dependency(${pkg} ${version}
|
find_dependency(${pkg} ${version}
|
||||||
PATHS
|
PATHS
|
||||||
@find_dependency_paths@
|
@find_dependency_paths@
|
||||||
${QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
|
${_qt_additional_packages_prefix_path}
|
||||||
|
${_qt_additional_packages_prefix_path_env}
|
||||||
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
||||||
${__qt_use_no_default_path_for_qt_packages}
|
${__qt_use_no_default_path_for_qt_packages}
|
||||||
)
|
)
|
||||||
|
@ -134,8 +134,8 @@ public:
|
|||||||
virtual ~tst_QDoubleSpinBox();
|
virtual ~tst_QDoubleSpinBox();
|
||||||
public slots:
|
public slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void cleanupTestCase();
|
|
||||||
void init();
|
void init();
|
||||||
|
void cleanup();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void germanTest();
|
void germanTest();
|
||||||
@ -213,7 +213,6 @@ public slots:
|
|||||||
private:
|
private:
|
||||||
QStringList actualTexts;
|
QStringList actualTexts;
|
||||||
QList<double> actualValues;
|
QList<double> actualValues;
|
||||||
QWidget *testFocusWidget;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<double> DoubleList;
|
typedef QList<double> DoubleList;
|
||||||
@ -257,20 +256,8 @@ tst_QDoubleSpinBox::~tst_QDoubleSpinBox()
|
|||||||
|
|
||||||
void tst_QDoubleSpinBox::initTestCase()
|
void tst_QDoubleSpinBox::initTestCase()
|
||||||
{
|
{
|
||||||
testFocusWidget = new QWidget(0);
|
|
||||||
testFocusWidget->resize(200, 100);
|
|
||||||
testFocusWidget->show();
|
|
||||||
|
|
||||||
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
|
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
|
||||||
QSKIP("Wayland: This fails. Figure out why.");
|
QSKIP("Wayland: This fails. Figure out why.");
|
||||||
|
|
||||||
QVERIFY(QTest::qWaitForWindowActive(testFocusWidget));
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_QDoubleSpinBox::cleanupTestCase()
|
|
||||||
{
|
|
||||||
delete testFocusWidget;
|
|
||||||
testFocusWidget = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDoubleSpinBox::init()
|
void tst_QDoubleSpinBox::init()
|
||||||
@ -278,6 +265,11 @@ void tst_QDoubleSpinBox::init()
|
|||||||
QLocale::setDefault(QLocale(QLocale::C));
|
QLocale::setDefault(QLocale(QLocale::C));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QDoubleSpinBox::cleanup()
|
||||||
|
{
|
||||||
|
QTRY_VERIFY(QApplication::topLevelWidgets().isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QDoubleSpinBox::setValue_data()
|
void tst_QDoubleSpinBox::setValue_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<double>("val");
|
QTest::addColumn<double>("val");
|
||||||
@ -878,15 +870,16 @@ void tst_QDoubleSpinBox::setReadOnly()
|
|||||||
|
|
||||||
void tst_QDoubleSpinBox::editingFinished()
|
void tst_QDoubleSpinBox::editingFinished()
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout(testFocusWidget);
|
QWidget testFocusWidget(nullptr);
|
||||||
QDoubleSpinBox *box = new QDoubleSpinBox(testFocusWidget);
|
QVBoxLayout *layout = new QVBoxLayout(&testFocusWidget);
|
||||||
|
QDoubleSpinBox *box = new QDoubleSpinBox(&testFocusWidget);
|
||||||
layout->addWidget(box);
|
layout->addWidget(box);
|
||||||
QDoubleSpinBox *box2 = new QDoubleSpinBox(testFocusWidget);
|
QDoubleSpinBox *box2 = new QDoubleSpinBox(&testFocusWidget);
|
||||||
layout->addWidget(box2);
|
layout->addWidget(box2);
|
||||||
|
|
||||||
testFocusWidget->show();
|
testFocusWidget.show();
|
||||||
testFocusWidget->activateWindow();
|
testFocusWidget.activateWindow();
|
||||||
QVERIFY(QTest::qWaitForWindowActive(testFocusWidget));
|
QVERIFY(QTest::qWaitForWindowActive(&testFocusWidget));
|
||||||
box->setFocus();
|
box->setFocus();
|
||||||
QTRY_VERIFY(box->hasFocus());
|
QTRY_VERIFY(box->hasFocus());
|
||||||
|
|
||||||
@ -925,14 +918,9 @@ void tst_QDoubleSpinBox::editingFinished()
|
|||||||
QTest::keyClick(box2, Qt::Key_Return);
|
QTest::keyClick(box2, Qt::Key_Return);
|
||||||
QCOMPARE(editingFinishedSpy1.count(), 4);
|
QCOMPARE(editingFinishedSpy1.count(), 4);
|
||||||
QCOMPARE(editingFinishedSpy2.count(), 3);
|
QCOMPARE(editingFinishedSpy2.count(), 3);
|
||||||
testFocusWidget->hide();
|
testFocusWidget.hide();
|
||||||
QCOMPARE(editingFinishedSpy1.count(), 4);
|
QCOMPARE(editingFinishedSpy1.count(), 4);
|
||||||
QCOMPARE(editingFinishedSpy2.count(), 4);
|
QCOMPARE(editingFinishedSpy2.count(), 4);
|
||||||
|
|
||||||
// On some platforms this is our root window
|
|
||||||
// we need to show it again otherwise subsequent
|
|
||||||
// tests will fail
|
|
||||||
testFocusWidget->show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDoubleSpinBox::removeAll()
|
void tst_QDoubleSpinBox::removeAll()
|
||||||
@ -1111,15 +1099,15 @@ public:
|
|||||||
|
|
||||||
void tst_QDoubleSpinBox::task224497_fltMax()
|
void tst_QDoubleSpinBox::task224497_fltMax()
|
||||||
{
|
{
|
||||||
task224497_fltMax_DoubleSpinBox *dspin = new task224497_fltMax_DoubleSpinBox;
|
task224497_fltMax_DoubleSpinBox dspin;
|
||||||
dspin->setMinimum(3);
|
dspin.setMinimum(3);
|
||||||
dspin->setMaximum(FLT_MAX);
|
dspin.setMaximum(FLT_MAX);
|
||||||
dspin->show();
|
dspin.show();
|
||||||
QVERIFY(QTest::qWaitForWindowActive(dspin));
|
QVERIFY(QTest::qWaitForWindowActive(&dspin));
|
||||||
dspin->lineEdit()->selectAll();
|
dspin.lineEdit()->selectAll();
|
||||||
QTest::keyClick(dspin->lineEdit(), Qt::Key_Delete);
|
QTest::keyClick(dspin.lineEdit(), Qt::Key_Delete);
|
||||||
QTest::keyClick(dspin->lineEdit(), Qt::Key_1);
|
QTest::keyClick(dspin.lineEdit(), Qt::Key_1);
|
||||||
QCOMPARE(dspin->cleanText(), QLatin1String("1"));
|
QCOMPARE(dspin.cleanText(), QLatin1String("1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDoubleSpinBox::task221221()
|
void tst_QDoubleSpinBox::task221221()
|
||||||
|
@ -1376,6 +1376,8 @@ void tst_QMenu::QTBUG_89082_actionTipsHide()
|
|||||||
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||||
menu->popup(widget.geometry().topRight() + QPoint(50, 0));
|
menu->popup(widget.geometry().topRight() + QPoint(50, 0));
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(menu));
|
QVERIFY(QTest::qWaitForWindowExposed(menu));
|
||||||
|
auto menuWindow = menu->windowHandle();
|
||||||
|
QVERIFY(menuWindow != nullptr);
|
||||||
|
|
||||||
auto actionZero = menu->actions().at(0);
|
auto actionZero = menu->actions().at(0);
|
||||||
auto actionOne = menu->actions().at(1);
|
auto actionOne = menu->actions().at(1);
|
||||||
@ -1389,12 +1391,12 @@ void tst_QMenu::QTBUG_89082_actionTipsHide()
|
|||||||
const QRect submenuRect5 = menu->actionGeometry(actionFive);
|
const QRect submenuRect5 = menu->actionGeometry(actionFive);
|
||||||
const QPoint submenuPos5(submenuRect5.topLeft() + QPoint(10, 3));
|
const QPoint submenuPos5(submenuRect5.topLeft() + QPoint(10, 3));
|
||||||
|
|
||||||
QTest::mouseMove(menu, submenuPos1);
|
QTest::mouseMove(menuWindow, submenuPos1);
|
||||||
QTest::mouseMove(menu, submenuPos0); //show the tip
|
QTest::mouseMove(menuWindow, submenuPos0); //show the tip
|
||||||
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), tipFullName, 1000);
|
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), tipFullName, 1000);
|
||||||
|
|
||||||
//Move to the fifth action without prompting
|
//Move to the fifth action without prompting
|
||||||
QTest::mouseMove(menu, submenuPos5);
|
QTest::mouseMove(menuWindow, submenuPos5);
|
||||||
//The previous tip was hidden, but now is a new tip to get text, So there should be no content
|
//The previous tip was hidden, but now is a new tip to get text, So there should be no content
|
||||||
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), QString(), 1000);
|
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), QString(), 1000);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user