Qt 6 compatibility with CI build
Could this please be merged ? Current Qt6 does not work with the as-is repo ?
This Pull request is quite usefull. I suggest to merge. I was able to run with QT6.
This Pull request is quite usefull. I suggest to merge. I was able to run with QT6.
How did you make it? I am struggling to compile but from QT5 to QT6 it won't work. It looks like a nice project but there ain't any way to take a step forward
This Pull request is quite usefull. I suggest to merge. I was able to run with QT6.
How did you make it? I am struggling to compile but from QT5 to QT6 it won't work. It looks like a nice project but there ain't any way to take a step forward
TBH I changed the project from QT5 -> QT6 by my own. I did this by changes like adding .toString() and changing CMakeLists.txt. Then I noticed the PR which is changing much more than I did.
I was able to run this code:
-
Version: commit dc644d41b68978ab9a5591ba891a223221570e74 (HEAD -> master, origin/master, origin/HEAD) Author: Frank [email protected] Date: Wed Feb 5 22:45:58 2020 +0100
Enhance Qt backward compability. (#34)
-
Qt 6.6.2 GCC 64 BIT
-
I'm attaching diff of my changes (a little different than the PR https://github.com/Megaxela/QCodeEditor/pull/47): diff.txt
Hopefully this will help You.
First of all, thank you for the response and congratulations on what seems to be a very interesting widget.
I managed to compile it by adapting the changes; the two CMakeLists.txt files were compiled successfully.
I'm confused because the example still gives me the problem of not finding the various #include <QCodeEditor> and it doesn't start.
Unfortunately, I usually use qmake for my projects and I don't understand how to integrate the widget, besides the fact that the example project does not find the various includes as mentioned before.
Can anybody explain me what O am doing wrong??
I'm confused because the example still gives me the problem of not finding the various #include and it doesn't start.
I was facing the problem with not finding includes. Remember to use CMakeLists.txt which is outside (this https://github.com/Megaxela/QCodeEditor/blob/master/CMakeLists.txt instead of this: https://github.com/Megaxela/QCodeEditor/blob/master/example/CMakeLists.txt). Also make sure that You have all required additional libraries in QT (use QMaintanance tool).
I forgot to tell You that I'm using Linux (Ubuntu based PopOS).
Well it has been a bit tricky to puzzle things together but I finnaly made it on Windows starting from fork:
https://github.com/l3enQ/QCodeEditor
I loaded the loaded the QCodeEditor (not the example)
From QT Creator I did
-
Build->Run Generator->MinGW generated mypath/build-QCodeEditor-master-Desktop_Qt_6_4_2_MinGW_64_bit-MinSizeRel/qtc_MinGW_Makefiles
-
$> cd mypath/build-QCodeEditor-master-Desktop_Qt_6_4_2_MinGW_64_bit-MinSizeRel/qtc_MinGW_Makefiles $> C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe
This generated a file mypath/build-QCodeEditor-master-Desktop_Qt_6_4_2_MinGW_64_bit-MinSizeRel/qtc_MinGW_Makefiles/libQCodeEditor.a
I setup a new blank application with qMake and just a simple form.
I added it to my qMake .pro by adding a folder to my project called: QCodeEditor and the edited to .pro file like this:
# Specify the path to the directory containing the library
LIBS += -L$$PWD/QCodeEditor/ # my current .pro folder and the newly created QCodeEditor folder
# Link against the library
LIBS += -lQCodeEditor # points to file **libQCodeEditor.a** inside QCodeEditor (folder)
In my MainWindow.cpp file I had to include the headers in this way:
#include <include/internal/QCodeEditor.hpp>
#include <include/internal/QGLSLCompleter.hpp>
#include <include/internal/QLuaCompleter.hpp>
#include <include/internal/QPythonCompleter.hpp>
#include <include/internal/QSyntaxStyle.hpp>
#include <include/internal/QCXXHighlighter.hpp>
#include <include/internal/QGLSLHighlighter.hpp>
#include <include/internal/QXMLHighlighter.hpp>
#include <include/internal/QJSONHighlighter.hpp>
#include <include/internal/QLuaHighlighter.hpp>
#include <include/internal/QPythonHighlighter.hpp>
And also needed to change a bunch of other .hhp files all in the same way by adding include/internal/xxxx.hpp
Finally in my MainWindow i added:
QCodeEditor* m_codeEditor;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
m_codeEditor = new QCodeEditor(ui->CodeEditorWidget); // Here the parent is a QWidget in the main ui to be able to treat the QCodeEditor as a normal QWidget later in my code
QCompleter * PythonCompleter = new QPythonCompleter(this);
m_codeEditor->setCompleter (PythonCompleter);
QPythonHighlighter * Highlighter = new QPythonHighlighter ();
m_codeEditor->setHighlighter(Highlighter);
// more code
}
I am now playing around with all the features....
here is a picture of my final result:
Since there have been no new commits in this project for 5 years, I decided to breathe some life into it. It's forked in my repositories, I rebranded the name to K-Editor to avoid confusion, updated it to Qt to 6.6.3, cleaned up the CMakeLists (separated the library from the example), and added pull requests that appeared in the original QCodeEditor repository. If anyone is interested, feel free to collaborate
Since there have been no new commits in this project for 5 years, I decided to breathe some life into it. It's forked in my repositories, I rebranded the name to K-Editor to avoid confusion, updated it to Qt to 6.6.3, cleaned up the CMakeLists (separated the library from the example), and added pull requests that appeared in the original QCodeEditor repository. If anyone is interested, feel free to collaborate
Here is link: https://github.com/rafal-tarnow/K-Editor
@rafal-tarnow Great job Rafal!