I am using Qt Creator 7.0.0 Based on Qt 6.2.3.
In order to use GraphicalEffects we have to use following method described:
https://doc.qt.io/qt-6.2/qtgraphicaleffects5-index.html
Now, if I apply this method I can easily access all its functionalities and write qml file.
When the qml file is ran it produces "Library import requires a version" error.
Related
As the title suggests, I cannot use variants such as llvm, cuda and the auto-differentiable variants with mitsuba 3.
I have checked that they are indeed variants using mitsuba.variants() as well as making sure they are listed in the config file, but when I try to run in jupyter notebook, I get the error that the LLVM dll cannot be found. scalar_rgb and scalar_spectral both work fine.
I built mitsuba directly from the repository, and so it should have included all the necessary dlls.
and below shows the enabled variants in the config file.
Apparently anything GUI-related in terms of components involves XML. I cannot go around actually configuring and building wxWidgets from source because of that. I'm new to wxWidgets.
My current setup is on Win10 with MSVC v141 (Visual Studio 2017) with the latest CMake version (currently 3.21).
Inside the config.cmake of the wxWidgets projects (using latest master branch) I see
wx_get_dependencies(EXTRALIBS_XML xml)
I am also calling CMake with -DwxUSE_XML=ON (among other parameters) but this still leads to:
the XML dependency is nowhere to be found
respectively it's not built
Linking then fails with the following error:
LINK : fatal error LNK1104: cannot open file 'wxxml.lib' [C:\Users\...\CMakeBuilds\ef5b5ada-ee42-7735-988a-ae37c735ccff\build\deps\build\wxwidgets\libs\qa\wxqa.vcxproj]
What library is actually wxWidgets using and how do I trigger it's retrieval and accordingly configuration and building? Since I am adding wxWidgets to my CMake project as an ExternalProject component, I would appreciated something in that line of thought. However any kind of information regarding this issue is more than welcome especially since it will shine light on how to configure other features (if I want them in the future) such as WebView.
The wxxml.lib issue is fixed now. While fixing it I also discovered a bug (of sort) in the build system of wxWidgets.
The reason why it failed to build this library in particular was actually quite simple but due to the lack of knowledge in the dependencies of wxWidgets. I thought that wxWidgets, given it depends on XML so much, has its own XML parser. Well, not really. The wxXML component actually uses and underlying 3rd party dependency called EXPAT, which - as you can see in my question - I have deactivated since it was giving me issues during the build (due to the still present problem of not being able to automatically retrieve dependencies).
What I did was to clone the libexpat repository, add it as an ExternalProject, set the variables for the libraries and include directory and pass them onto my wxWidgets project. But there is a catch...
The expat.cmake file looks as follows:
#############################################################################
# Name: build/cmake/lib/expat.cmake
# Purpose: Use external or internal expat lib
# Author: Tobias Taschner
# Created: 2016-09-21
# Copyright: (c) 2016 wxWidgets development team
# Licence: wxWindows licence
#############################################################################
if(wxUSE_EXPAT STREQUAL "builtin")
# TODO: implement building expat via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxexpat
src/expat/expat/lib/xmlparse.c
src/expat/expat/lib/xmlrole.c
src/expat/expat/lib/xmltok.c
)
set(EXPAT_LIBRARIES wxexpat)
set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib)
elseif(wxUSE_EXPAT)
find_package(EXPAT REQUIRED)
endif()
I would use the *.cmake files of the 3rd party dependencies stored inside <ROOT_OF_WXWIDGETS_PROJECT>/build/cmake/lib to determine which variables I need to set if builtin is selected as the value for the respective library. Since I want to use my own I need sys (e.g. -DwxUSE_EXPAT=sys as a CMAKE_ARGS inside my wxWidgets ExternalProject) and also to pass the headers and libraries accordingly.
Given the file above one would assume that EXPAT_LIBRARIES is required. However after failing to build (yet again) and seeing that the reason was the activated expat build and that it was set as builtin I checked the log in detail and found the following error:
Could NOT find EXPAT (missing: EXPAT_LIBRARY) (found version "2.2.6")
Notice the EXPAT_LIBRARY. After passing it (-DEXPAT_LIBRARY=...) my build was complete. For me this is a bug or simply inconsistency between the dependency cmake file and the rest of the wxWidgets project.
It is important to note that I do not retrieve the external dependency through wxWidgets itself (see config.cmake and more precisely the macro wx_get_dependencies(...)). This solves the problem with a basic configuration and build of wxWidgets but if you don't want to tackle every dependency of wxWidgets on your own (why should you?), I recommend looking for a solution where the dependencies (at least the ones you don't want to deal with) are automatically retrieved, configured and build as builtin.
I'm using Android studio 4.0, coding in Kotlin and I'm still really new at Android development.I need to integrate the Xzing barcode libray. I've copied some code from the tutorial at [https://tutorialwing.com/implement-android-qr-code-scanner-using-zxing-library-in-kotlin/][1]. The tutorial uses the following import statement:
import android.app.Fragment
I've modified a fragment that was generated with the Navigation Drawer Activity template. It uses the androidx fragment import statment:
import androidx.fragment.app.Fragment
The errors it occurs on the following line with the "this" reference:
qrScanIntegrator = IntentIntegrator.forFragment(this)
The error is:
Type mismatch: Required Fragment! found HomeFragment
Changing my import to the older version to the older version is not recommended and if I do I get a lot of other errors.
What can I do to get zxing to work with the androidx fragment?
Thanks
The ZXing library is no longer maintained, and that particular class (IntentIntegrator) only supports android.app.Fragment which is the deprecated Android framework version of the AndroidX Fragment class.
You have a few possible options here:
Fork the ZXing library, and change the android.app.Fragment import to use the androidx.fragment.app.Fragment version instead.
Delegate the IntentIntegrator calls to your Activity instead, and have the results forwarded to your Fragment.
Simply duplicate the Intent initialization code from IntentIntegrator to a helper class of your own. The IntentIntegrator methods are just convenience methods to build an Intent and call startActivityForResult(). You'll still be able to use the IntentIntegrator.parseActivityResult method to interpret the result that comes back.
I would recommend going with option #3.
As a longer term alternative, you may also want to consider looking into Firebase ML Kit since ZXing is no longer maintained.
I am currently working on a Node.JS project written in TypeScript using Node.JS Tools for Visual Studio (NTVS). I have a few classes and enums spread out in 3 or 4 files in my project. I am now trying to use the classes defined in those files from my main app file. From my previous work with Node, I know that I would normally need a require call to import each other file/class if I were working with a text editor and the command-line compiler. But, if I open any TypeScript file in my project and start typing the name of a class defined in a different file, Visual Studio shows IntelliSense autocomplete for the class name and its members. This makes me think that the NTVS and/or TypeScript configuration are automatically making all of my classes available project-wide. But if I click the 'run' button, errors are printed to the console because Node can't find the referenced classes at runtime.
This behavior leads me to believe that IntelliSense isn't actually telling me that the classes are available, just that they exist (which seems odd). If I add a require call to the top of the file, and use that imported value instead of the original class name, Node finds the class and I can use it in my code. But this presents two problems:
I must come up with a new name to use for the variable that I import the class into. If I require() it with the original name, Visual Studio shows errors saying that the identifier is a duplicate, because it seems to believe that the original class is available project-wide.
I don't get the autocomplete or type checking in my usage of the class. This pretty much defeats the purpose of using TypeScript.
So, what's the proper way to do this import? Is there a way to make all my classes available globally? If not, what import statements do I need?
This behavior leads me to believe that IntelliSense isn't actually telling me that the classes are available, just that they exist
unless you have top level import or export statement the file is considered a global module and is available project wide : http://basarat.gitbooks.io/typescript/content/docs/project/modules.html
A global module will not work at runtime in node.js
You should use file level modules using import/export and compile with --module commonjs
I'm attempting to package Mnemosyne, an application that uses PyQt, on Mac OS Lion via Py2app.
I'm getting several errors like the following:
objc[2826]: Class QCocoaView is implemented in both
/Volumes/Bullfrog/patrick/m2/./dist/Mnemosyne.app/Contents/MacOS/../Frameworks/libQtGui.4.dylib
and /opt/local/lib/libQtGui.4.dylib. One of the two will be used.
Which one is undefined.
objc[2826]: Class QCocoaWindow is implemented in both
/Volumes/Bullfrog/patrick/m2/./dist/Mnemosyne.app/Contents/MacOS/../Frameworks/libQtGui.4.dylib
and /opt/local/lib/libQtGui.4.dylib. One of the two will be used.
Which one is undefined.
The first version of the class is the one used in Py2App and is the one that should be used (I am trying to make the app standalone). The second is the system Qt that I installed via MacPorts. What do I have to add to the application to make it use the bundled Qt and not the system Qt?
And also several statements like this:
On Mac OS X, you might be loading two sets of Qt binaries into the
same process. Check that all plugins are compiled against the right Qt
binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of
binaries are being loaded. QObject::moveToThread: Current thread
(0x10246c880) is not the object's thread (0x106985d00). Cannot move to
target thread (0x10246c880)
Honestly I don't really understand how to do what I need to do here just based on this error message (I'm not a coder; I'm just doing my best to package the software).
This article gives a solution: simply add a blank qt.conf file in the application's Content/Resources directory.