diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index c85c3c1ed..54b28ba98 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -6,8 +6,8 @@ add_subdirectory(GreaseMonkey) add_subdirectory(MouseGestures) add_subdirectory(PIM) add_subdirectory(StatusBarIcons) -## TODO QT6 ## add_subdirectory(TabManager) -## TODO QT6 ## add_subdirectory(VerticalTabs) +add_subdirectory(TabManager) +add_subdirectory(VerticalTabs) if (GNOME_KEYRING_FOUND) add_subdirectory(GnomeKeyringPasswords) diff --git a/src/plugins/TabManager/tabmanagerdelegate.cpp b/src/plugins/TabManager/tabmanagerdelegate.cpp index 1b9e58e86..02a2e9411 100644 --- a/src/plugins/TabManager/tabmanagerdelegate.cpp +++ b/src/plugins/TabManager/tabmanagerdelegate.cpp @@ -97,7 +97,7 @@ void TabManagerDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op opt2.state |= QStyle::State_On; break; } - style->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w); + style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt2, painter, w); } // draw the icon @@ -244,7 +244,11 @@ void TabManagerDelegate::viewItemDrawText(QPainter *p, const QStyleOptionViewIte highlightParts << highlightedPart; } +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) textLayout.setAdditionalFormats(highlightParts); +#else + textLayout.setFormats(highlightParts); +#endif } } diff --git a/src/plugins/TabManager/tabmanagerwidget.cpp b/src/plugins/TabManager/tabmanagerwidget.cpp index e67694449..efea3e479 100644 --- a/src/plugins/TabManager/tabmanagerwidget.cpp +++ b/src/plugins/TabManager/tabmanagerwidget.cpp @@ -44,6 +44,10 @@ #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#include +#endif + TLDExtractor* TabManagerWidget::s_tldExtractor = 0; @@ -124,7 +128,11 @@ QString TabManagerWidget::domainFromUrl(const QUrl &url, bool useHostName) return urlString.append(appendString); } +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) if (useHostName || host.contains(QRegExp(R"(^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)"))) { +#else + if (useHostName || QRegExp(R"(^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)").indexIn(host) >= 0) { +#endif if (host.startsWith("www.", Qt::CaseInsensitive)) { host.remove(0, 4); } @@ -758,7 +766,7 @@ TabItem::TabItem(QTreeWidget* treeWidget, bool supportDrag, bool isTab, QTreeWid , m_webTab(0) , m_isTab(isTab) { - Qt::ItemFlags flgs = flags() | (parent ? Qt::ItemIsUserCheckable : Qt::ItemIsUserCheckable | Qt::ItemIsTristate); + Qt::ItemFlags flgs = flags() | (parent ? Qt::ItemIsUserCheckable : Qt::ItemIsUserCheckable | Qt::ItemIsAutoTristate); if (supportDrag) { if (isTab) { diff --git a/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp b/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp index 475d1dddf..e0d214013 100644 --- a/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp +++ b/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp @@ -27,6 +27,8 @@ #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include +#else +#include #endif #include #include diff --git a/src/plugins/TabManager/tldextractor/tldextractor.cpp b/src/plugins/TabManager/tldextractor/tldextractor.cpp index a9b4e52b0..6b449eb57 100644 --- a/src/plugins/TabManager/tldextractor/tldextractor.cpp +++ b/src/plugins/TabManager/tldextractor/tldextractor.cpp @@ -23,6 +23,10 @@ #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#include +#endif + TLDExtractor* TLDExtractor::s_instance = 0; TLDExtractor::TLDExtractor(QObject* parent) @@ -384,7 +388,11 @@ bool TLDExtractor::test() continue; } +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) line.indexOf(testRegExp); +#else + testRegExp.indexIn(line); +#endif const QString hostName = testRegExp.cap(2); const QString registrableName = testRegExp.cap(4); diff --git a/src/plugins/VerticalTabs/tablistview.cpp b/src/plugins/VerticalTabs/tablistview.cpp index e075bda5c..db6e570f3 100644 --- a/src/plugins/VerticalTabs/tablistview.cpp +++ b/src/plugins/VerticalTabs/tablistview.cpp @@ -240,5 +240,11 @@ void TabListView::updateVisibility() void TabListView::updateHeight() { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) setFixedHeight(m_delegate->sizeHint(viewOptions(), QModelIndex()).height()); +#else + QStyleOptionViewItem option; + initViewItemOption(&option); + setFixedHeight(m_delegate->sizeHint(option, QModelIndex()).height()); +#endif }