Solved Install a package from qt-solutions
-
/plugins/qtsingleapplication/config.pri
?Where exactly did you put that into your project ?
-
I do not have it in my project. It is also not provided but required by common.pri:
exists(config.pri):infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtsingleapplication-uselib
The common.pri file is required by qtsingleapplication.pri:
include(../common.pri)
-
Can you share your .pro file ?
-
Sure I can:
#------------------------------------------------- # # Project created by QtCreator 2017-01-05T07:43:22 # #------------------------------------------------- QT += core gui xml greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = phpPad TEMPLATE = app include(plugins/qtsingleapplication/src/qtsingleapplication.pri) # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += main.cpp\ mainwindow.cpp \ components/codeeditor.cpp \ components/highlighter.cpp \ components/projectmodel.cpp \ dialogs/newproject.cpp \ dialogs/newtabledialog.cpp \ dialogs/preferencedialog.cpp HEADERS += mainwindow.h \ components/codeeditor.h \ components/highlighter.h \ components/projectmodel.h \ dialogs/newproject.h \ dialogs/newtabledialog.h \ dialogs/preferencedialog.h FORMS += mainwindow.ui \ dialogs/newproject.ui \ dialogs/newtabledialog.ui \ dialogs/preferencedialog.ui DISTFILES += \ appIcon/phpPad.rc \ Erungenschaften.txt \ xml/html.xml RESOURCES += \ qrc.qrc ICON = appIcon/phpPad.icns RC_FILE = appIcon/phpPad.rc
I believe the issue is with the client/peer feature. This feature is not relevant for me. Somewhere in the documentation I read the the minimal example is not making use of this feature but it uses the same files. So I don't get how they did it.
-
What did you copy exactly from the QtSolutions module ?
-
Currently I am trying all of this only on Windows.
I downloaded the entire solutions package from github as zip. Extracted it in my Downloads folder and followed the install instruction within the qtsingleapplicaition folder. Then I copied the entire qtsingeapplication folder and pasted it in the plugin folder which is in my root folder. From the qtsingleapplication folder I removed the configure, make, docs and examples. The src and buildlib folder is untouched.
This is the content of my qtsingeapplication folder
buildlib src common.pri qtsingleapplication.pro
-
Where is your project source located on your machine ?
Same question for QtSolution sources. -
On Windows my files are in my standard Windows documents folder. On OS X under User/Programming. The qtsingleapplication folder is in the project folder under plugins. The rest of the QtSolution files is still in my Download folder.
-
AFAIR you should essentially need:
INCLUDEPATH += $$PWD DEPENDPATH += $$PWD QT *= network greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h
-
@SGaist += not *=
:-) -
@jsulm said in Install a package from qt-solutions:
@SGaist += not *=
:-)*=
is perfectly fine. See the docs -
@sierdzio Oh, good to know :-)
Thanks! -
Thanks for all you help and time. I got it working finally. Probably not the most elegant way but it works for me =)
@SGaist your suggestion worked (after I figured out to remove the include statement) but it included the files directly into my project messing up my structure in Creator. Also it gave me an error in my main.cpp on #include <qtsingleapplication.h> no such file
Essentially only the network module was missing.
QT += core gui xml network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = phpPad TEMPLATE = app include(plugins/qtsingleapplication/src/qtsingleapplication.pri)
I am very sure that I tried to include that before with a clean and rebuild. No idea why it is working now.