diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ef6c712a..ecd36e73f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) project(olive-editor VERSION 0.2.0 LANGUAGES CXX) +option(BUILD_QT6 "Build with Qt 6 over 5 (experimental)" OFF) option(BUILD_DOXYGEN "Build Doxygen documentation" OFF) option(BUILD_TESTS "Build unit tests" OFF) option(USE_WERROR "Error on compile warning" OFF) @@ -110,10 +111,14 @@ set(QT_LIBRARIES if (UNIX AND NOT APPLE) list(APPEND QT_LIBRARIES DBus) endif() +if (BUILD_QT6) + set(QT_NAME Qt6) +else() + set(QT_NAME Qt5) +endif() find_package(QT NAMES - Qt6 - Qt5 + ${QT_NAME} REQUIRED COMPONENTS ${QT_LIBRARIES} @@ -251,6 +256,6 @@ add_subdirectory(ext) add_subdirectory(app) if (BUILD_TESTS) -enable_testing() -add_subdirectory(tests) + enable_testing() + add_subdirectory(tests) endif() diff --git a/app/dialog/export/codec/av1section.cpp b/app/dialog/export/codec/av1section.cpp index 8fc5edc44..8c65d1bc6 100644 --- a/app/dialog/export/codec/av1section.cpp +++ b/app/dialog/export/codec/av1section.cpp @@ -39,7 +39,7 @@ AV1Section::AV1Section(int default_crf, QWidget *parent) : CodecSection(parent) { QGridLayout* layout = new QGridLayout(this); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); int row = 0; layout->addWidget(new QLabel(tr("Preset:")), row, 0); @@ -104,7 +104,7 @@ AV1CRFSection::AV1CRFSection(int default_crf, QWidget *parent) : QWidget(parent) { QHBoxLayout* layout = new QHBoxLayout(this); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); crf_slider_ = new QSlider(Qt::Horizontal); crf_slider_->setMinimum(kMinimumCRF); diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt index b813293f5..cc819307a 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt @@ -17,4 +17,5 @@ add_subdirectory(core) set(KDDockWidgets_STATIC ON CACHE INTERNAL "Force KDDockWidgets to build statically") +set(KDDockWidgets_QT6 ${BUILD_QT6} CACHE INTERNAL "Conform KDDockWidgets' Qt 6 setting to ours") add_subdirectory(KDDockWidgets)