Qt - Reddit
15 subscribers
302 photos
52 videos
4.3K links
News and discussion for the Qt Framework.

Subreddit: https://www.reddit.com/r/QtFramework

Powered by : @r_channels & @reddit2telegram
Download Telegram
QToolButton::checkStateSet missing in Linux source build of Qt5.15.13?

i've build Qt5.15.13-gpl from source - done that for serveral versions before without any problem- but for a less UI intensive application (im doing this source builds only for silencing TSAN false-positives, normally using systems Qt libs)

i get a linker error that QToolButton::checkStateSet is not defined?

mold: error: undefined symbol: QToolButton::checkStateSet()
>>> referenced by mocscompilation.cpp
>>> ../bin/libgui.a(mocs
compilation.cpp.o)

searching for checkStateSet shows that only the widgets lib implements these

but nm shows no definition for QToolButton::checkStateSet in my self build widgets lib

nm -C libQt5Widgets.so.5.15.13 | grep checkStateSet
00000000005617fe T QAbstractButton::checkStateSet()
0000000000597344 T QCheckBox::checkStateSet()

QToolButton::checkStateSet is missing

but my systems widgets lib contains the definition?

/usr/lib64> nm -DC libQt5Widgets.so.5.15.13 | grep checkStateSet
000000000038eb40 T QToolButton::checkStateSet()
0000000000296a80 T QAbstractButton::checkStateSet()
00000000002a8170 T QCheckBox::checkStateSet()

anyone got an idea?

https://redd.it/1cmdtrz
@qt_reddit
Build tool support for PySide / PyQt


Just interested in how people approach this, typically I just use VSCode or QtCreator to build simple projects. However I now want to automate some of the build process such as running uic, and rcc.

I've tried to use CMake but can't seem to get it to work without a lot of custom scripting (for example the AUTOUIC etc functions need c++ projects), can't see any info on running uic in QtCreator (which would be ideal but python support is really just an after thought).

I could write some Makefiles but this is a little ad-hoc and also confuses the IDE's (and at the end of the day I want a simple process for my students to use and I already teach cmake for C++ dev).

So I guess my questions are what workflows do people use, can you recommend any tools to help, or do you just have a per project script to run uic and rcc?

(I may cross post this in both qt and python subreddits as I'm not sure where it fits best)


https://redd.it/1cmg4ql
@qt_reddit
Thank you

These days I officially finished my first QT Software, it is not a big thing for some of you, but I wanted to thank you for what you are doing for the community 😁😁

https://redd.it/1cmlye4
@qt_reddit
Send QImage from C++ to QML

What is your favourite way to do this? Currently I have a problem in my project to send qimage to qml. On google I see a lots of old answers that seem quite outdated.

What I do: I’m generating 2D rgb image and I want to show this in qml.

https://redd.it/1cmniny
@qt_reddit
cookie support

https://github.com/samirgaire10/com.samirgaire10.chatgpt-plasma6 in github

how do i add cookie support so if i login the data will be there even after shutdown until cookie session expired for now if i restart it will erase the login data

can do pull request on github or code in comment help ;)

also i dont to use c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

https://redd.it/1cmy64z
@qt_reddit
Is there any example about how to dynamically spawn 3D object within Quick3D?

For example I wrote a class with a Q_INVOKABLE method which is called if a button is pressed. I’m able to print some stuff but I don’t know how to spawn a cube. I need to do it in cpp since I have to handle some backend logic

https://redd.it/1cn0gce
@qt_reddit
Best way to draw 2D circuit scheme in qml

Hi there! It’s me again. I recently developed a project that calculates optimal routes in a circuit and now I want to display it in QML. I was considering using Canvas, but perhaps you guys have a better idea for this.

Let’s simplify this project to:

- Displaying blocks with coordinates
- Drawing the circuit path with coordinates of every node
- Defining the circuit size (for example, a matrix of 100x100)

How can I achieve this in QML? I'm sure there are better ways to do this than using Canvas.
I have fully developed backend in C++ for this.

https://redd.it/1cneag0
@qt_reddit
Using QNetworkProxy::setApplicationProxy with QML Image

I got a question. If I want to set the application proxy to Socks5 like this:

QNetworkProxy proxy;
proxy.setType(QNetworkProxy::Socks5Proxy);
QNetworkProxy::setApplicationProxy(proxy);


would I be able to use it for loading image sources in QML or is it not possible?

Image {
source: "https://imgur.com/someimagefile
}


https://redd.it/1cnx753
@qt_reddit
How would I create tab tearoff in PyQt5?

Good day all. I am trying to enable tab tearoff for my QTabWidget, meaning I can drag tabs into seperate windows and then drag them back into the QTabWidget. I know you can probably use the QDockWidget, but this complicates things as the QDockWidget cannot be styled like a QTabWidget. Basically, I want similar functionality to Google Chrome's tabs. Any help or code snippits are appreciated.

https://redd.it/1cnxxs6
@qt_reddit
QVideoSink in Qt6.7

Hi... I was just wondering if it was possible to play a video using QVideoSink in Qt without using the concepts of multimedia concepts in qml i.e Video and VideoOutput because my target device is not supporting multimedia concepts in qml

https://redd.it/1cnwzzl
@qt_reddit
Unable to build my project, ui header not found (Qt6, Clion, Windows)

Hello, recently tried to convert my shell app into a GUI app with Qt, but had some problems at build time.

Currently I get this error:

C:/Users/Albert/Documents/COALAs/monkey-model-kit/src/gui/MonkeyWindow.cpp:9:10: fatal error: uiMonkeyWindow.h: No such file or directory
9 |
#include "uiMonkeyWindow.h"
| ^~~~~~~~~~~~~~~~~~~

Here's what my project directory tree looks like more or less (only kept the code files and removed resources):

https://preview.redd.it/smwzwqcbfgzc1.png?width=972&format=png&auto=webp&s=88c54d1e93fa168501ca30d396f26413ecef8e6a

The Cmakelists looks like this:

cmakeminimumrequired(VERSION 3.28)
project(MonkeyModelKit LANGUAGES CXX)

set(CMAKEPREFIXPATH "C:/Qt/6.6.0/mingw64")
set(CMAKE
AUTOMOC ON)
set(CMAKEAUTORCC ON)
set(CMAKE
AUTOUIC ON)
set(CMAKEAUTOUICSEARCHPATHS ${CMAKECURRENTSOURCEDIR}/gui)
findpackage(Qt6 COMPONENTS
Core
Gui
Widgets
REQUIRED)

set(SOURCES
src/main.cpp
src/StringManipulation.cpp
src/run/MonkeyShell.cpp
src/run/MonkeyManager.cpp
src/run/MonkeyFile.cpp
src/col/MonkeyModel.cpp
src/col/MonkeySession.cpp
src/col/MonkeyCollection.cpp
src/gui/MonkeyWindow.cpp
# Add more source files as needed
)

set(UI
FILES
src/gui/MonkeyWindow.ui
# Add more UI files as needed
)

qt6wrapui(UIHEADERS ${UIFILES})

includedirectories(
include/
include/col
include/run
include/gui
/gui
)

add
executable(MonkeyModelKit WIN32
${SOURCES}
${UIFILES}
${UI
HEADERS}
)
targetincludedirectories(MonkeyModelKit
PRIVATE ${CMAKECURRENTSOURCEDIR}/gui
)

target
linklibraries(MonkeyModelKit PRIVATE Qt6::Widgets)

And the .cpp class:

#include "MonkeyWindow.hpp"
#include "uiMonkeyWindow.h"
MonkeyWindow::MonkeyWindow(QWidget parent) :
QMainWindow(parent), ui(new Ui::MonkeyWindow) {
ui->setupUi(this);
}
MonkeyWindow::~MonkeyWindow() {
delete ui;
}
#include "MonkeyWindow.hpp"
#include "ui_MonkeyWindow.h"

MonkeyWindow::MonkeyWindow(QWidget
parent) :
QMainWindow(parent), ui(new Ui::MonkeyWindow) {
ui->setupUi(this);
}

MonkeyWindow::~MonkeyWindow() {
delete ui;
}


I don't really know what to do right now, its been a few weeks that I simply can not build my project and can not start learning how Qt works at all...

The only way to make it work is to have all the MonkeyWindow files (.cpp, .hpp and .ui) in the same subdirectory and then everything works all fine. I saw somewhere that the new cpp standard says to not separate header files and source files but I find this super messy, is this right (technically would fix my problem but would make working on the proj so hard) ?


Thanks for the help ...

https://redd.it/1co661u
@qt_reddit
Process inside process in cmd?

It’s possible to use the same cmd for a process A and for a process B started inside the process A?

I mean, I want to do programA.exe on a cmd
Program A is a gui Qt app, no console
But inside process A I want to start a process B, a Qt console app, no gui

Is it posible to use the terminal used to start processA to interact with process B?

Kinda messy but is a requirement for work, thanks

https://redd.it/1co8zy0
@qt_reddit
How I can I install the Qt6 text to speech dev packages on Ubuntu 22.04?

I think I could use libqt6texttospeech or qt6-speech-dev on Ubuntu 23+. I've found all the other required dev packages but this one.

https://redd.it/1cobg4e
@qt_reddit
i've done an ASAN build of Qt5.15.13 itself and my example got a leak - but how?

so im working with ASAN, valgrind for some years now and newly with BugInsight - but i recently tested a ASAN built of Qt itself the first time with my current project (15 devs, >1Mio LOC, just nothing trivial)

ASAN is telling me (and BugInsight also) that there is something leaking when using QIcon features

normaly with Qt that means that some owner is missing - and i've already found serveral places were the owner weren't set correctly but this Action is owned and the QIcon seems to be un-owned (found nothing in the docs about owning)

here is the code example

void Mainwindow::createactions()
{
// ASAN said something in the underlaying QIcon::addFile allocated and leaked at end
const QIcon openIcon = QIcon::fromTheme( "document-open", QIcon( ":/images/folderopen" ) );
m
openaction = new QAction( openIcon, tr( "&Open..." ), this );
...
}

and the ASAN finding

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x7f58344b01d8 in operator new(unsigned long) (/lib64/libasan.so.8+0xfc1d8) (BuildId: 183f53e480d86b3f4e532dc084c6a3c77ec09062)
#1 0x7f58312399ba in QIcon::addFile(QString const&, QSize const&, QIcon::Mode, QIcon::State) /home/linux/dev/3rdparty-linux-gcc/qt5
dev/qt5/qtbase/src/gui/image/qicon.cpp:1099
#2 0x7f5831239b3a in QIcon::QIcon(QString const&) /home/linux/dev/3rdparty-linux-gcc/qt5dev/qt5/qtbase/src/gui/image/qicon.cpp:728
#3 0x1214470 in Main
window::createactions() /home/test/example/Mainwindow.cpp:491
#4 0x120e438 in Mainwindow::Mainwindow(htl::Interfacemanager&) /home/test/example/Mainwindow.cpp:99
#5 0x1234f24 in main /home/test/example/main.cpp:76
#6 0x7f582f5731ef in libcstartcallmain (/lib64/libc.so.6+0x2a1ef) (BuildId: 96b8eb5a4407af753cc31c18e7c116279f2eab1f)

the MainWindow is a QMainWindows directly created in main()

and no - the possibility of an false positive is with ASAN near to impossible by design (or i found a bug - different to the valgrind concept that can have false positives by design) - but false negatives (unfound leaks) - thats why im using an ASAN qt built to find more, hopefully most memory related problems

the qt simple application example got not this (but other) leaks: [
https://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html](https://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html) - so it needs to be somthing with the usage

another idea: i've ported that project (\~1Mio LOCs) from Windows to Linux and it could be that the resources are maybe not available like on windows - but should that produce an leak?

\home\linux\dev\3rdparty-linux-gcc\qt5
dev\qt5\qtbase\src\gui\image\qicon.cpp

void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State state)
{
if (fileName.isEmpty())
return;
detach();
if (!d) {

QFileInfo info(fileName);
QString suffix = info.suffix();
#if QTCONFIG(mimetype)
if (suffix.isEmpty())
suffix = QMimeDatabase().mimeTypeForFile(info).preferredSuffix(); // determination from contents
#endif // mimetype
QIconEngine *engine = iconEngineFromSuffix(fileName, suffix);
d = new QIconPrivate(engine ? engine : new QPixmapIconEngine); !!!!!! ASAN tells me that something in this line leaks
}

d->engine->addFile(fileName, size, mode, state);

// Check if a "@Nx" file exists and add it.
QString atNxFileName = qt
findAtNxFile(fileName, qApp->devicePixelRatio());
if (atNxFileName != fileName)
d->engine->addFile(atNxFileName, size, mode, state);
}

https://redd.it/1cokqeg
@qt_reddit
[HELP] Problem when trying to use mapbox with Qt 5.15

Hello.

I have been trying all kinds of different stuff with implementing mapbox plugin in my mobile application. I registered on mapbox, and have an access token, but whenever I try to load the map I get a bunch of these errors:
W libAppName\_x86\_64.so: tile request error "Problem with tile image"

W libAppName\_x86\_64.so: tile request error "Problem with tile image"

W libAppName\_x86\_64.so: tile request error "Problem with tile image"

I am building and running on a simulator. I tried a very simmilar code with osm plugin and I had no issues with the map.

Plugin {
id: mapPlugin
name: "mapbox"

PluginParameter {
name: "mapbox.access_token";
value: "<valid token>"
}
}

Map {
id: mapview
anchors.fill: parent
plugin: mapPlugin
center: QtPositioning.coordinate(41.943243, 21.576327)
zoomLevel: 14
activeMapType: mapview.supportedMapTypes[10]

MapItemView{
model: markerModel
delegate: mapcomponent
}
}

ComboBox{
model:mapview.supportedMapTypes
textRole:"description"
onCurrentIndexChanged: mapview.activeMapType = mapview.supportedMapTypes[currentIndex]
}

Also keep in mind that I get all available map types in the combobox (model from mapview.supportedMapTypes) from mapbox.

I have also tried with a desktop (QML) application only with the map in it and I get the same errors.

https://redd.it/1comzzo
@qt_reddit
Context menu created by QWidget::addAction()

Hello colleagues

I wonder if there is way to actually get context QMenu object created from using QWidget::addAction(someAction) and set Qt::ActionsContextMenu.

I need it to connect a button to close it on click, and for that I need some slot, ideally QMenu::close().

Any hints mates?

https://redd.it/1coq16d
@qt_reddit
is there an available jobs for QtFramwork in job market?

I'm really not an expert but I've learn first pyqt5 for my project in university and it was great and helped me a lot (created a desktop application) ... after that I've switched to pyside6 and still have the same opinion that's it's Great and helpful (this I've created an access controller for cameras ..) amd I've heard about QML and I'm not quite sure what is it and if i have to learn it because when I've searched for job didn't find job for Qt framework developer ... I'll really appreciate any help and thanks in advance

https://redd.it/1cozlhz
@qt_reddit
QComboBox using QDarkStyle with PyQt

I am using QDarkStyle (3.2.3) for my GUI and I am trying to use a QComboBox. The combo box has these blank squares to the left, which are apparently supposed to be where the indicator would go. Is there any way to straight up remove these squares, so the contents of the drop-down menu is just the text and nothing else?

https://redd.it/1cp4594
@qt_reddit
QSystemTrayIcon doesn't receive wheel events on X11

Hello, my little qt tray icon does not receive any wheel event on X11, despite the documentation telling otherwise. I'm trying to make a generic tray icon that can handle user actions like clicks and mouse wheel event.

I tried reimplementing "bool event(QEvent *event)", even installing an event filter, but I'm not receiving any event. Is there something I'm missing? Qt versions I tried are 5.15 and 6.6

https://redd.it/1cpfy28
@qt_reddit
Closed source application on iOS and Android

I'm evaluating using Qt for developing a closed source application for iOS and Android. My revenue is nowhere near justifying buying the commercial license for Qt. However, since my desktop application is developed using Qt, I'd like to stick to it to develop the mobile application.

I've read online that we can comply with the LGPL license of Qt easily on Android, but that on iOS the situation is more difficult since this platform requires static linking. But even if more dificult, we would be able to comply with LGPL by providing the object files to the end user, who would then be able to relink to a modified version of the Qt framework.

This seems a reasonable way to comply with the licensing, but was this already tested in courts? Is there jurisprudence regarding that? Do you know any successful apps that follow this model?

https://redd.it/1cpgtwq
@qt_reddit
QT Business License

Hi
I plan on opening my own small Business with Software development within the next 2-3 years., I already have some customers in different branches which are interested in my knowledge and I would code Softwares for them only. So just my computer and me.

So it is necessary to get a license of QT in the future.

Does anyone have QT Business license? Is it worth it?
Are there differences to the free QT Software?

Rgds and thank you
Kevin




https://redd.it/1cphs8i
@qt_reddit