Commit 80d6e41a authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

more Qt6 fixes

enable more stuff to actually compile
parent dbdb1410
Pipeline #154889 passed with stage
in 2 minutes and 28 seconds
......@@ -2,9 +2,9 @@ find_package(KF5Wallet ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5Wallet PROPERTIES PURPOSE "Required to build the katesql addon")
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} QUIET)
set_package_properties(Qt5Sql PROPERTIES PURPOSE "Required to build the katesql addon")
set_package_properties(Qt${QT_MAJOR_VERSION}Sql PROPERTIES PURPOSE "Required to build the katesql addon")
if(NOT KF5Wallet_FOUND OR NOT Qt5Sql_FOUND)
if(NOT KF5Wallet_FOUND OR NOT Qt${QT_MAJOR_VERSION}Sql_FOUND)
return()
endif()
......
......@@ -10,7 +10,7 @@ find_package(
set_package_properties(KFGuiAddons PROPERTIES PURPOSE "Required to build the project addon")
set_package_properties(KF5NewStuff PROPERTIES PURPOSE "Required to build the project addon")
if(NOT KF5_FOUND OR NOT Qt5Concurrent_FOUND)
if(NOT KF5_FOUND OR NOT Qt${QT_MAJOR_VERSION}Concurrent_FOUND)
return()
endif()
......
......@@ -146,7 +146,11 @@ std::pair<uint, uint> parseRange(const QString &range)
{
int commaPos = range.indexOf(QLatin1Char(','));
if (commaPos > -1) {
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
return {range.midRef(0, commaPos).toInt(), range.midRef(commaPos + 1).toInt()};
#else
return {QStringView(range).sliced(0, commaPos).toInt(), QStringView(range).sliced(commaPos + 1).toInt()};
#endif
}
return {range.toInt(), 1};
}
......@@ -379,7 +383,7 @@ public:
if (CONFLICT_RE->match(ln).hasMatch())
return -1;
if (ln.startsWith(dest) || ln.startsWith(QLatin1Char(' ')) || ln.isEmpty() || inConflict) {
if (ln.startsWith(QLatin1Char(dest)) || ln.startsWith(QLatin1Char(' ')) || ln.isEmpty() || inConflict) {
if (dest == SRC)
// The -1 accounts for the fact that srcStart is 1-based
// but we need to return 0-based line numbers
......
......@@ -19,10 +19,11 @@
#include <memory>
#include <kateprojectview.h>
class QAction;
class QDir;
class KateProject;
class KateProjectView;
class KateProjectPlugin;
class KateProjectInfoView;
......
......@@ -2,7 +2,7 @@ find_package(Qt${QT_MAJOR_VERSION}Concurrent ${QT_MIN_VERSION} QUIET)
find_package(KF5ItemViews ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5ItemViews PROPERTIES PURPOSE "Required to build the search addon")
if(NOT KF5ItemViews_FOUND OR NOT Qt5Concurrent_FOUND)
if(NOT KF5ItemViews_FOUND OR NOT Qt${QT_MAJOR_VERSION}Concurrent_FOUND)
return()
endif()
......
......@@ -21,6 +21,7 @@ MatchExportDialog::MatchExportDialog(QWidget *parent, QAbstractItemModel *matchM
QAction *exportPatternTextActionForInsertRegexButton =
exportPatternText->addAction(QIcon::fromTheme(QStringLiteral("code-context")), QLineEdit::TrailingPosition);
connect(exportPatternTextActionForInsertRegexButton, &QAction::triggered, this, [this]() {
QMenu menu;
QSet<QAction *> actionList;
......@@ -28,6 +29,8 @@ MatchExportDialog::MatchExportDialog(QWidget *parent, QAbstractItemModel *matchM
auto &&action = menu.exec(QCursor::pos());
KatePluginSearchView::regexHelperActOnAction(action, actionList, exportPatternText);
});
connect(pushButton, &QPushButton::clicked, this, &MatchExportDialog::generateMatchExport);
}
MatchExportDialog::~MatchExportDialog()
......
......@@ -54,22 +54,4 @@
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>MatchExportDialog</receiver>
<slot>generateMatchExport()</slot>
<hints>
<hint type="sourcelabel">
<x>707</x>
<y>22</y>
</hint>
<hint type="destinationlabel">
<x>378</x>
<y>237</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -34,6 +34,7 @@ ResultsTreeView::ResultsTreeView(QWidget *parent)
updateColors(e);
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QStyleOptionViewItem ResultsTreeView::viewOptions() const
{
auto options = QTreeView::viewOptions();
......@@ -43,3 +44,13 @@ QStyleOptionViewItem ResultsTreeView::viewOptions() const
options.palette.setColor(QPalette::WindowText, m_fg);
return options;
}
#else
void ResultsTreeView::initViewItemOption(QStyleOptionViewItem *option) const
{
QTreeView::initViewItemOption(option);
// We set this here so that the "expand triangle" in the treeview
// is always colored in a visible color. This is important for
// styles like fusion, where it can be dark on dark
option->palette.setColor(QPalette::WindowText, m_fg);
}
#endif
......@@ -14,7 +14,12 @@ class ResultsTreeView : public QTreeView
Q_OBJECT
public:
ResultsTreeView(QWidget *parent);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QStyleOptionViewItem viewOptions() const override;
#else
void initViewItemOption(QStyleOptionViewItem *option) const override;
#endif
private:
QColor m_fg;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment