Skip to content

Commit 5b3e4ff

Browse files
committed
Update for Qt6
1 parent dd1c869 commit 5b3e4ff

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Source: custom-toolbox
22
Section: admin
33
Priority: optional
44
Maintainer: Adrian <adrian@mxlinux.org>
5-
Build-Depends: debhelper (>=10), qtbase5-dev, qttools5-dev-tools
5+
Build-Depends: debhelper (>=10), qt6-base-dev, qt6-base-dev-tools, qt6-tools-dev, qt6-tools-dev-tools
66
Standards-Version: 3.9.8
77
Vcs-Git: git://github.com/AdrianTM/custom-toolbox
88

debian/rules

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/usr/bin/make -f
2-
export QT_SELECT=5
2+
export QT_SELECT=6
33

44
QMAKE_OPTS = DEFINES+=NO_DEBUG_ON_CONSOLE
5-
MAKE_OPTS = QMAKE=qmake-qt5 LRELEASE=lrelease-qt5 QMAKE_OPTS="$(QMAKE_OPTS)"
5+
MAKE_OPTS = QMAKE=qmake6 QMAKE_OPTS="$(QMAKE_OPTS)"
6+
7+
override_dh_auto_configure:
8+
qmake6
69

710
override_dh_auto_clean:
811
dh_auto_clean
912
rm -f src/translations/*.qm
1013

1114
override_dh_auto_build:
12-
lrelease translations/*.ts
15+
/usr/lib/qt6/bin/lrelease translations/*.ts
1316
head -n1 debian/changelog | sed -e "s/.*(\([^(]*\)).*/const QString VERSION {\"\1\"};/" > version.h
1417
dh_auto_build -- $(MAKE_OPTS)
1518

flatbutton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void FlatButton::leaveEvent(QEvent *e)
4343
QPushButton::leaveEvent(e);
4444
}
4545

46-
void FlatButton::enterEvent(QEvent *e)
46+
void FlatButton::enterEvent(QEnterEvent *e)
4747
{
4848
// setFlat(false);
4949
setStyleSheet("QPushButton { text-align:left; text-decoration:underline}; QToolTip { text-decoration: none; }");

flatbutton.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
**********************************************************************/
2222
#pragma once
2323

24+
#include <QEnterEvent>
25+
#include <QEvent>
2426
#include <QPushButton>
2527

2628
class QEvent;
@@ -35,6 +37,6 @@ class FlatButton : public QPushButton
3537
void setIconSize(QSize);
3638

3739
protected:
38-
void enterEvent(QEvent *e) override;
39-
void leaveEvent(QEvent *e) override;
40+
void enterEvent(QEnterEvent *e);
41+
void leaveEvent(QEvent *e);
4042
};

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ int main(int argc, char *argv[])
5050
QApplication::setOrganizationName("MX-Linux");
5151

5252
QTranslator qtTran;
53-
if (qtTran.load("qt_", QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
53+
if (qtTran.load("qt_" + QLocale::system().name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
5454
QApplication::installTranslator(&qtTran);
5555
}
5656

5757
QTranslator qtBaseTran;
58-
if (qtBaseTran.load("qtbase_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
58+
if (qtBaseTran.load("qtbase_" + QLocale::system().name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
5959
QApplication::installTranslator(&qtBaseTran);
6060
}
6161

mainwindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,11 @@ void MainWindow::readFile(const QString &file_name)
543543
setWindowTitle(name);
544544
ui->commentLabel->setText(comment);
545545

546-
const auto lines = text.splitRef('\n');
546+
const auto lines = text.split('\n');
547547
QRegularExpression skipPattern("^(Name|Comment|#|$).*");
548-
for (const QStringRef &line : lines) {
548+
for (const QString &line : lines) {
549549
if (!skipPattern.match(line).hasMatch()) {
550-
processLine(line.toString());
550+
processLine(line);
551551
}
552552
}
553553
}

0 commit comments

Comments
 (0)