86,399 questions
2
votes
1
answer
108
views
QSqlQuery in Qt6: in-place vs prepared
First of all, Qt version is 6.10.0, testing on Arch Linux rolling. I think I've found a bug in Qt but maybe it's just my fault.
My program asks MariaDB database for some data and displays it in ...
5
votes
2
answers
4k
views
How to tell if expression is evaluated at compile time or runtime?
I have a rather big Map object and I want to have a separate list that has the keys sorted. This will be used in many other source files of my poject.
The question is about how do I know when a ...
0
votes
0
answers
27
views
Using stackview with qrc
I have an issue:
qrc:/qt/qml/MyApp/qml/MyApp/Main.qml:11:5: QML StackView: initialItem: qrc:/qml/pages/LoginPage.qml:-1 No such file or directory
File tree
Im strugling to see why it cannot find my ...
0
votes
2
answers
477
views
"mainwindow.cpp" includes the uic file "ui_mainwindow.h", but the user interface file "mainwindow.ui" could not be found in the following directories
Below is my desired folder structure :
MyProject
CMakeLists.txt
include
mainwindow.h
src
mainwindow.cpp
main.cpp
forms
mainwindow.ui
This is my desired folder ...
5
votes
2
answers
113
views
Qt mouseMoveEvent does not work with QColumnView
I have a QColumnView with a QFileSystemModel attached to it, and I am trying to get information on what file is being hovered over in that model view.
I do have mouse tracking enabled, however it ...
Advice
0
votes
2
replies
54
views
Building Qt6 with proprietary codecs for QtWebEngine
If you're a hobbyist programmer like me, perhaps you have had need to build Qt6 from source so that you can include the proprietary codecs needed to play audio and video from web pages loaded through ...
2
votes
3
answers
7k
views
Select a date range using QCalendarWidget in PyQt
I'm using QCalendarWidget in PyQt to find a single date that a user clicks on from a pop-up calendar. I'd like them to be able to select a range of dates- for example, the 12th to the 17th of November ...
1
vote
0
answers
560
views
How to create custom QTcpSocket class in QNetworkAccessManager
How to create custom QTcpSocket class in QNetworkAccessManager?
I want to write a simple client-server application, which will be communicate using HTTP protocol.
It will be a simple http web server ...
1
vote
0
answers
31
views
Connecting DBus signals to Qt
I already know that there are already a lot of questions abuot connecting signals from DBus to Qt. I've checked all of them and still I can't figure out what I'm doing wrong. I'm writing a simple ...
1
vote
0
answers
47
views
An error occurred when registering a C++ class using QML_ELEMENT: QQmlApplicationEngine failed to load component
I wrote a simple example while learning QML and CMake. The main purpose is to demonstrate how to use `qt_add_qml_module` and how to register C++ classes in QML.
the key code is as follows:
**//...
0
votes
0
answers
25
views
Compiling QT with EGLFS on Raspbian Lite (Trixie) for Pi 4
in the past I was able to compile QT with EGLFS on Raspbian Buster. I don't remember exactly how I did it, but it uses FKMS driver. Back then full KMS was not supported on Pi 4.
I read that these days,...
1
vote
0
answers
525
views
openCV's namedWindow embed in Qt's QGraphicsScene? program openCV with Qt
【abstraction】
I am trying to finish a GraphCut segmentation program. Segmentation part is writtern in openCV and GUI part is written in Qt. Segmentation part works just fine. I have a problem in ...
13
votes
2
answers
3k
views
How to reduce the binary size of a Qt Android app
I'm using Qt to build an Android Qt Quick app.
However, the base size is around 27 MB, which is huge for an initial size.
How do I reduce this size?
0
votes
0
answers
72
views
JKQTMathText drawIntoPixmap problem when devicePixelRatio!=1
When using Qt and JKQtMathText to display LaTeX equations in a QLabel, I noticed a strange behaviour in the drawIntoPixmap() method. When the devicePixelRatio is set to one (the default value), the ...
1
vote
2
answers
2k
views
SHIFT-JIS ascii support
I want a clarification about SHIFT-JIS characters set. Is ASCII a subset of SHIFT-JIS character set similar to UTF-8. If a file has mix of SHIFT-JIS and ASCII. how can we read the same using QT ...
5
votes
1
answer
4k
views
FTPS (FTP-SSL) in Qt 4.6
I'm trying to get FTP-SSL to work with Qt 4.6.3. I've already compiled Qt with OpenSSL support. Are there any good resources about FTPS with Qt? It seems that QFtp does not provide SSL support. I ...
1
vote
1
answer
76
views
Show Test Results of QtTest in Jenkins
I have Qt 5.12.12 and Jenkins 2.440.1 on Windows.
In my Jenkinsfile I have:
stage('Test') {
steps {
echo 'Testing...'
bat 'mingw32-make -f Makefile check'
...
Advice
0
votes
3
replies
147
views
How do I draw a line using triangles in OpenGL?
In my code, I useing draw line to draw model selection line and error edge line ,useing draw triangle to draw 3D model.
Using the model's openmesh handle, edges are recorded and drawn.
...
2
votes
1
answer
11k
views
How can I draw an image on a widget with Qt? [closed]
I want to draw an image on a widget. I have no issue with drawing a pie or rectangle but I can't find anything on images.
My code:
void GraphicWidget::paintEvent(QPaintEvent * /* event */)
{
QPainter ...
4
votes
1
answer
20k
views
How do I add a box-shadow to an element in QT?
I tried to do: this->setStyleSheet("-webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 1);") and I get the error: Unknown property -webkit-box-shadow. The same goes for box-shadow and -moz-box-shadow. ...
86
votes
26
answers
243k
views
"qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found."
I'm using Ubuntu 20.04 via Oracle VM Virtual Box and I faced exactly the same error as all other people.
After building Qt6 source code using official Qt manual, I'm trying to run different projects ...
-1
votes
2
answers
469
views
Mouse pointer position when a label is activated
When an object of QLabel subclass is active, how can one find if the mouse pointer is on the label and get its position if it is?
QWidegt::event() can check the event type of QEvent::WindowActivate, ...
Best practices
1
vote
1
replies
67
views
Issue with TextField and TextInput Keyboard on Android in Qt 6.10.0
when user tap on a TextInput or TextField, the Android keyboard opens, but typing doesn’t insert any characters into the input field. They can only delete existing text, and new text cannot be entered....
4
votes
1
answer
68
views
Declare nested QML enum
I have a nested Item where I want to declare an enum. How can I access the enum from the parent Item? I dont want to declare the enum in the outer Item, because it belongs to the nested/inner Item. I ...
2
votes
2
answers
2k
views
How to display a QWebEngineView in Qt mainwindow?
My webview function with the following code in my main.cpp :
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
...
2
votes
1
answer
82
views
TextInput on SpinBox with custom inputMask
I have a SpinBox with a custom TextInput as contentItem. I want it to display a quantity, so it want to display something like "10 / 20 pc." for example. The minimum value is always 1, the ...
1
vote
1
answer
13k
views
'QML Connections: Cannot assign to non-existent Property' despite the opposite being true
So, I checked the following questions, which seemed most similar to my existing problem:
QML: Using cpp signal in QML always results in "Cannot assign to non-existent property"
...
10
votes
3
answers
9k
views
.ico icons not showing up on Windows
I followed the The Qt Resource System guide and the .ico icons appear on Linux.
The icons are not showing up on Windows when I try to run the applicaton from Qt Creator.
I suspect a plugin issue ...
3
votes
1
answer
2k
views
Link CorePrivate from Qt6
I am writing a server using QtHttpServer (from Qt6). It's time to implement chats for the system using web sockets, but it hasn't been added to Qt6 yet. I see two ways out – either use long-pulling ...
0
votes
0
answers
42
views
How to cross-compile a customized QGroundControl (Qt 6.8.3) for Jetson Nano (ARM64) from Ubuntu x86_64
I have been customizing QGroundControl and have successfully built it for my Ubuntu system (x86_64 architecture) using Qt 6.8.3. I utilized the provided shell scripts and Dockerfiles located in the ...
0
votes
0
answers
42
views
QT Installer Framework: Add virtual components to installation
What I want to achieve:
I have created a custom page right before ComponentSelectionPage. On this page the user have to provide a key for the installation. Depending on provided key the ...
0
votes
1
answer
767
views
Qt - QPSQL Driver not loaded: Windows
I have been trying to connect to a remote SQL database with Qt 6.5.2, using QtSql which came included with Qt. The SQLite driver (already installed) won't allow me to connect to a remote SQL database, ...
1
vote
0
answers
64
views
OpenCV-Python with PyQt5: Qt platform plugin "xcb" error and cv2.imshow not working on Linux
I'm trying to use OpenCV with PyQt5 on Linux, but encountering Qt compatibility issues. When I install opencv-python, I get Qt platform plugin errors that prevent the application from starting. When I ...
-1
votes
1
answer
123
views
How to fix resources.qrc not loading images
I'm trying to load images from my resources.qrc but it doesn't seem to work. For instance:
cardVN1->setImage("://vn1.jpg");// The set image function is user-defined passing a QString
...
1
vote
0
answers
59
views
QComboBox popup not visible when placed in an overlay over QVTKOpenGLNativeWidget in fullscreen on Windows
I'm embedding a VTK rendering widget inside a Qt 6 app using QVTKOpenGLNativeWidget.
The window contains a QVTKOpenGLNativeWidget used for 3D rendering, wrapped inside a QFrame.
On top of it, a ...
1
vote
0
answers
44
views
Extra "pyside" and "qt" in SRC_URI
I'm getting some strange behavior in my Yocto build of PySide6. I've cloned the meta-qt6 layer (release 6.8) and I want to install PySide6. I found that I was getting a bunch of do_fetch errors ...
-1
votes
1
answer
3k
views
module PySide6 not found
I'm currently working with the PySide6 module.(vscode) But for some reason it doesn't work anymore,it worked before but it doesn't now. When I try to run my project this is the error I get:
...
1
vote
1
answer
11k
views
What is the path to Qt, and path to Qt's configure file on Ubuntu
I am following this documentation for deployment. It need me to specify /path/to/Qt and /path/to/Qt/configure. I am unable to find the path to Qt on my machine.
I am using Ubuntu 17 and I installed ...
2
votes
1
answer
14k
views
Setting compiler right for meson
I am trying to build a basic Qt Application with the Meson Build System on my Mac (using macOS Sierra), following the tutorial on http://mesonbuild.com/samples.html.
My meson.build file looks like ...
0
votes
0
answers
42
views
Halcon Roi drawing mode cant be terminated
when i try to use halcon api drawing roi in qt,i must use left click to end drawing.If i directly close the viewer of drawing roi,the whole program gonna be forzened,cause the drawing isnt ended.I ...
16
votes
6
answers
17k
views
Clickable hyperlink in QTextEdit
I want to use QTextEdit (in read-only mode) to show a clickable hyperlink, I used to do
QTextEdit *textEdit = new QTextEdit;
QTextCursor cursor(textEdit->document());
textEdit->setTextCursor(...
1
vote
3
answers
141
views
Pass QString in Lambda Function
I want to pass a QString into a lambda slot-function to modify it further. Unfortunately the QString goes out of scope before reaching the slot, so I cannot append text. How can I ensure that the ...
-1
votes
1
answer
2k
views
Calculating distance and speed using gps coordinates using qt c++
I am attempting to convert the first code snippet at:
Calculate distance between 2 GPS coordinates
// var R = 6371; // km
// var dLat = (lat2-lat1).toRad();
// var dLon = (lon2-lon1)....
4
votes
1
answer
15k
views
Full & complete uninstall QT Creator
Question:
How to uninstall QT Creator from Linux machine?
I have a corrupted install on a Debian Jessie machine. I have tried reinstalling, fixing, etc. and with no luck. I was advised to uninstall ...
31
votes
4
answers
25k
views
How to solve Qt Creators variable-"<not accessible>" behavior?
I have the same problem as described in Variables in Locals and Expressions not accessible in QT Creator but I want to find a way how to "repair" Qt Creator showing default composite types like std::...
0
votes
1
answer
1k
views
How to change the audio output device of QMediaPlayer in PySide2/PyQt5
How can I set the audio output of a QMediaPlayer to a specific output in Windows 7 and later?
This was really easy in PySide (using Phonon) but I can't find a way to do it in PySide2.
There are some ...
Best practices
1
vote
6
replies
225
views
Base class and derived classes in Qt
I'm building a Qt wrapper for RtMidi. As starting point I created two separate classes QMidiOut and QMidiIn that wrap RtMidiOut and RtMidiIn.
I don't want to duplicate code for the common methods (e.g....
0
votes
0
answers
91
views
How do I use Openssl 3 with Qt 5.15.19?
I have an application that still uses Openssl 1.1.1w. I need to update that to an OpenSsl 3 version. Switching to Qt6 seems like the best way to do that, however due to the nature of the codebase we ...
6
votes
2
answers
12k
views
Gradlew throws java.net.SocketException
So I created a Qt project for Android, but whenever I try to build it I get that exception. I even tried to run the gradlew file in the command line with the same results. Wherever I look online it ...
2
votes
1
answer
1k
views
Get hold of milliseconds since unix epoch in QML at every frame
I need to pass the current time as milliseconds since unix epoch to a fragment shader in QML.
I noticed that there is a built in shader uniform var called qt_Timestamp in the custom particle examples,...