cvuchener / dfhack-qt Goto Github PK
View Code? Open in Web Editor NEWQt plugins for DFHack
License: GNU Lesser General Public License v3.0
Qt plugins for DFHack
License: GNU Lesser General Public License v3.0
I got the error below while compiling: https://github.com/ragundo/DwarfExplorer
Reference: ragundo/DwarfExplorer#1
I got this error while compiling with cmake (v 3.10.2, Linux):
CMake Error at plugins/DwarfExplorer/dfhack-qt/CMakeLists.txt:4 (target_include_directories):
Cannot specify include directories for imported target "dfhack-qt-common".
Was an error with the https://github.com/cvuchener/dfhack-qt/blob/58225d74672e1f870cc9b23c8a4c747900d7f3df/CMakeLists.txt file:
target_include_directories(dfhack-qt-common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
gave that error. But fixed it with some searching and changing it to this line:
set_property(TARGET dfhack-qt-common APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
Also one small compile warning:
../plugins/DwarfExplorer/dfhack-qt/qapplication/LogFilterProxyModel.cpp:104:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ok && type >= 0 && type < accepted_types.size() && !accepted_types[type])
~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Hi there.
Short story.For my plugin, I need to hook up on DFHack onpluginupdate signal.
Long history. I want to change the Dwarf Fortress window to a specific coordinate every time the user selects a structure that contains a df::coord field.
If you call the dfhack methods to do that, it will not work because a CoreSuspender is already active, so the call doesn't have any effect until the CoreSuspender is resumed and the render thread updates the screen.
I've tried to call the dfhack methods, resume the CoreSuspender and sleep my thread a few milliseconds for render to update. Then I suspend again. This sometimes work, sometimes crashes.
The solution is to set the parameters, resume the CoreSuspender and use onpluginupdate to do the work
The problem is that this signal should be implemented in your main.cpp (where the Qt application is created), but I can't figure out how to implement that method using data from my plugin.
I tried to use global variables, but the linker complains.
How to do that?. Is it possible to implement some signal slot between your main.cpp and my plugin?
Thanks in advance
Hi.
Right now I can deploy my plugin dwarfexplorer in windows.
Now, I'm trying to do the same in linux (Ubuntu 18.04).The machine is not a development machine, just a clean ubuntu virtual machine.
I downloaded the LNP for linux, Dwarf Fortress and dfhack works ok.
Now, I put the compiled plugins (your qapplication.plugin.so
and my dwarfexplorer.plugin.so
) in the plugins
directory of dfhack.
I run dfhack, and logically dfhack doesn't load the plugins because is missing the required Qt5 libraries.
I know that linux doesn't work like windows. Even if you put the required .so files and the platforms
Qt5 directory in the same directory as Dwarf Fortress, it will not work because of the rpath.
Fortunatelly, dfhack in linux is launched by a script that sets LD_LIBRARY_PATH, so, if you put the Qt5 libraries in the directory libs
of Dwarf Fortress, dfhack can load boths plugins.
The problem is that as soon as I type enable qapplication
, dfhack crashes with a core dump.
I was thinking that the problem is with the platforms
Qt directory, so I put a copy of the directory in several places (hack/libs
libs
etc with no luck. I always get a core dump.
Have you tried to deploy your plugin in a linux machine?. What can I do?.
PD: Of course, in my development machine everything works.
Hi again
I'd like to use QML for my next project.
Do you think that is possible?.
I've tried to use QQuickWidget inside a QMainWindow but without success.
I'd like to have one solution that would be the same for all dfhat-qt plugins
Thanks in advance
Windows 10 - Qt 5.12.3
using qt5_add_resources works !!
There's hope that DFHack maintainer lethosor would try qapplications in MacOS as you requested in the forums.
As last resort , I have a MacOS VM, but my knowledge of Macs is zero :(. Anyway I could try it.
Again, thanks for your wonderful framework!.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.