qt5 | Qt5 super module
kandi X-RAY | qt5 Summary
kandi X-RAY | qt5 Summary
Qt5 super module
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of qt5
qt5 Key Features
qt5 Examples and Code Snippets
Community Discussions
Trending Discussions on qt5
QUESTION
I am trying to write a simple qml application with language translations using CMake and although the application runs, it never shows translations. I'm on a Linux platform with CMake version 3.22.2 and Qt version 3.15.2 Here is the directory structure:
...ANSWER
Answered 2022-Apr-01 at 16:09That's pretty badly documented stuff which works magically with ready-made example using dedicated qmake configuration parameter embed_translations
. I advice you to take a look into the original example's build dir where .qm files and a special qrc file qmake_qmake_qm_files.qrc
get generated.
You don't need to use QTranslator
unless you want to support dynamic language switch. At startup, QML runtime automatically loads a translation file qml_.qm (qml_xx_XX.qm where xx is ISO639 and XX is optional ISO 3166 code) from the i18n
subdirectory of the root QML file, based on the system language, if it finds one.
You need to get your .qm files to qrc:/qml/i18n/
folder because your main qml file is in qrc:/qml/
.
With CMake
you can do it as follows:
Add a new qrc file, e.g. cmake_qm_files.qrc to your project
QUESTION
I'm trying to create a project in Qt with an QOpenGLWidget
and CMake as a building tool. The problem is that it does not compile and I don't know why.
ANSWER
Answered 2022-Mar-19 at 21:50In Qt6 QOpenGLWidget
was moved to a new module named OpenGLWidgets
.
To make your program work you need to add OpenGLWidgets
to your find_package
command and Qt6::OpenGLWidgets
to your target_link_libraries
command.
QUESTION
I'm trying to solve an issue in a Qt5 application that's caused by a touchscreen driver I wrote a couple years ago. The problem being that my touchscreen driver generates mouse press events to simulate touch behavior. This was because at the time I wrote it, my team was using an outdated Linux OS that didn't have a native touch driver.
The problem is that when I touch the +/- buttons (the scroll buttons that increase/decrease the slider by a single tick, or cause it to rapidly scroll if held), the slider rapidly slides up/down as if I had clicked and held the button. This is because my driver uses QApplication::postEvent()
to dispatch the mouse event from a separate thread, and the delay in between touch and release is just long enough for it to register a click-and-hold type event, though the release event doesn't stop the sliding.
I would rewrite the application to use the now available native touch driver, but it doesn't offer enough control to be able to do what my driver does (my driver can generate left, right, or middle mouse events, whereas the native driver only provides left).
I tried rewriting the driver to use QApplication::sendEvent()
instead, but that was causing a segmentation fault that I couldn't figure out the cause of.
So is there a way I can disable the "click-and-hold" type behavior on the QSlider itself? So that I can still tap the buttons, but they'll only increase/decrease by a single tick at a time?
EDIT: Here's an example of how I'm generating the "touch" events via my driver.
...ANSWER
Answered 2022-Mar-17 at 08:29A minimal example to generate mouse press/release events that are correctly handled by QSlider
is:
QUESTION
I use Qt5. I did not find any documentation on how to enable PKCE when using QOAuth2AuthorizationCodeFlow.
If so, please provide the link. If there is no support, how can this feature be added to it?
I added code_challenge
and code_challenge_method
, but it is not enough. I don't know what the next step is.
ANSWER
Answered 2022-Mar-15 at 12:34TL;DR Yes, and you are using it.
Reading the new flow you notice there are three new parameters used by PKCE, code_verifier
, code_challenge
and code_challenge_method
.
These are used in your code, so you are using PKCE already.
QUESTION
I am writing a WebCam Gui, which is supposed to take pictures and manipulate with WebCam parameters. After the video stream is activated on the main GUI window, an additional window can be opened to change the WebCamera parameters Screenshot 1, Screenshot 2.
I am using Qthread to stream on QLabel. Also, I was able to set the initial camera parameters on the camera properties' changing window. My problem is changing the Exposure parameter by using a slider on the sub-window and seeing results in real-time on the main window.
Please see the code.
...ANSWER
Answered 2022-Mar-07 at 17:05I admit I don't know why this worked, but changing the connect to a lambda function did the trick.
QUESTION
I'm using Qt5 and I am trying to do this:
...ANSWER
Answered 2022-Feb-27 at 13:32OP's issue is caused by using setCentralWidget(nullptr);
.
QMainWindow::setCentralWiget():
Sets the given widget to be the main window's central widget.
Note: QMainWindow takes ownership of the widget pointer and deletes it at the appropriate time.
(Emphasis mine.)
Hence, for
QUESTION
I tried to build and run a Qt5 (5.15.2) application on macOS (10.15.7) using Bazel 5.0.0. Unfortunately, I run into some problems. The building part seems to work, but not the run part.
I installed Qt5 on my machine using Homebrew:
...ANSWER
Answered 2022-Feb-16 at 17:13I followed your steps with Mac OSX 10.15.7, Qt (installed by homebrew) 5.15.1 and both bazel 4.2.2-homebrew and 5.0.0-homebrew and initially I could not build the project from git:
* 3fe5f6c - (4 weeks ago) Add macOS support — Vertexwahn (HEAD -> add-macos-support, origin/add-macos-support)
This is the result that I get when building:
QUESTION
How do you get CMake to compile conditionally with Qt4.8 or Qt5? In other words, if Qt5 is available then compile with Qt5. Otherwise if Qt4.8 is available use that.
In my CMake, I have:
...ANSWER
Answered 2022-Feb-15 at 20:06Automatically selecting an available version of Qt is fairly easy with the NAME
option of the find_package command. The problem is that Qt4 and Qt5 have different names for the same modules.
QUESTION
Already referred below old posts, but its solution of installing websocket
s didn't work in my Ubuntu 21.10.
- Project ERROR: Unknown module(s) in QT: websockets
- Project ERROR: Unknown module(s) in QT: webkitwidgets
This could be probably due to my Qt is 6.2, while the available library is from Qt5, viz. libqt5websockets5-dev
.
How to install websocket module properly for the Qt6, to fix below error?
...Project ERROR: Unknown module(s) in QT: websockets
ANSWER
Answered 2022-Feb-10 at 18:45When installing Qt via Qt Maintenance Tool, just go to Additional Libraries and check QtWebSockets. It is available in Qt 6.2.x versions.
QUESTION
I am learning the intrincacies of unique_ptr.
I have a working example of a std::unordered_map that holds std:string and std::unique_ptr.
But I can't make unique_ptr examples with Qt's QString and QHash work. They won't compile mentioning errors like use of deleted function.
How can I make the two last examples work?
Edit 1In case this info is relevant, I am using gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0.
Example 1 (working): unordered_map and string unordered_map_string.h ...ANSWER
Answered 2022-Jan-29 at 20:52Example 2 does not compile because std::unordered_map
requires its key type to be "hashable": by default, it will use the std::hash
template. You can make it work by writing a specialisation for QString
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install qt5
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page