SVG path string to QPainterPath?
I can see that elements of SVG path syntax (https://www.w3.org/TR/SVG2/paths.html) look something like methods in QPainterPath - moveTo, lineTo, cubicTo, etc.
I wonder, are there any Qt or probably external tools allowing taking svg path syntax string as input and giving QPainterPath as output? I could not find anything on that topic...
Something that would work similar to this:
// in SomeWidget constructor
...
SomeSvgTool svgPath;
svgPath.loadPath("m408.04 658c5.88 14.34 12.3 22.76 16.39 27.42 3.23 3.68 20.94 20.04 0.53 45.61 12.12-25.04 7.76-39.88-13.92-49.03v53c0.68 21.83-21.75 23.16-27.21 17.35-5.65-5.99 7.67-25.89 24.21-19.35v-75z");
this->notePath = svgPath.render(); //notePath is QPainterPath
...
// In SomeWidget Paint event:
...
painter.translate(noteX, noteY);
painter.fillPath(this->notePath, Qt::black);
painter.restore();
...
Result of SomeWidget draw event (disregard checker pattern) :
​
https://preview.redd.it/ib2wt27qqm5c1.png?width=60&format=png&auto=webp&s=4edacc79e393378d3dde3c150457700ae27bba50
It would be perfect if it would not require to add QT += svg to pro file, as it looks like an overkill for such not-that-complex task, but if it turns out to be the only way, then okay.
https://redd.it/18fqj1q
@qt_reddit
I am creating project (Qt Widgets): Its not making UI file, and giving this error
​
https://preview.redd.it/0lesjaiz6h5c1.png?width=949&format=png&auto=webp&s=314c5b6e32aa97f24afa4ece1787bc8f2332966d
https://redd.it/18f4hzc
@qt_reddit
How to get MenuType contentItem's implicitWidth of customized contentItem?
Hi all,
I am trying to customize contentItem property of MenuType QML.
Here is the code of it: https://pastebin.com/4wyDd4kD
I would like to have implicitWidth and implicitHeight of Menu Type to be dependable of the menu content(listview in this case) and not be fixed as it is right now (line 47, 52).
For some reason, if I have wrapped Listview in an Item, I can't access contentItem.children and contentHeight properties in Listview anymore so line 45 and 51 are not working anymore. If I remove top Item as wrapper (line 38), same lines(45,51) are now working without problem.
I can't simply remove Item wrapper as it is needed for scrollbar to be placed outside the listview in order not to have scrollbar on top of listview content.
I am relatively new to QML, so any help is much appreciated :)
Thanks
​
​
https://redd.it/18ejy0b
@qt_reddit
How can I expose an c++ enum to qml?
I have an enum I would like to expose to qml in order to later compare this enum state in other objects. I added Q\_NAMESPACE and Q\_ENUM\_NS macros to enum file like so:
#include <qnamespace.h>
#include <QObject>
namespace MapComponents
{
Q_NAMESPACE
enum class TileType
{
BLOCK,
WALKABLE,
PATH,
BUILDING,
NONE
};
Q_ENUM_NS(TileType)
}
Then I register it in my main.cpp:
//...
qmlRegisterType<MapComponents::TileType>("tileType", 1, 0, "TileType");
//...
I import MapComponents to my qml file:
import tileType
But when I try to use it in qml it will not access an enum :
//...
if(tileType.TileType.BLOCK === 0){
dosmth()
}
//...
this will result in incomplete qml code execution.
https://redd.it/18d1o5t
@qt_reddit
Is there any chance I've come across a scaling bug in QT (5.15 on Windows)?
Most people who report API bugs have written bad code or don't understand it. This may very well be the case ;-)
https://preview.redd.it/3k46vxuaiw4c1.png?width=1724&format=png&auto=webp&s=4465d18e1d82074711d588a8bcb98f36c9e8294c
So I only see this behaviour on a 4K monitor (200% scaling). Can you see the rh pane is drawn over / amidst the combos of the left pane?
QSplitter* leftPane = new QSplitter(Qt::Vertical, this);
QSplitter* rightPane = new QSplitter(Qt::Vertical, this);
QSplitter* basePane = new QSplitter(Qt::Horizontal, this);
basePane->addWidget(leftPane);
basePane->addWidget(rightPane);
There's 3 widgets on the left in a pane, the lower two have combos. The left pane has
setMinimumWidth (hint size of top widget.width plus + a bit) * scale factor)
and it started going wrong now the hint has increased (so min width of the LH pane has grown). I don't really get that tbh.
Other settings that may / may not count, setStretchFactor, setSizePolicy (fixed, minimum expanding)
One thing that fixed it is setMinWidth on each of the widgets, instead of the whole pane.
What did I leave out? I'm not much of a QT dev ...
https://redd.it/18czvnm
@qt_reddit
7:HptcCredsDialog.cpp-142-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Getting screen geometry.
+0.016 7:HptcCredsDialog.cpp-153-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating centralFrame
+0.016 7:HptcCredsDialog.cpp-163-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating loginArea
+0.016 7:HptcCredsDialog.cpp-172-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating priv->creds
+0.076 7:HptcCredsDialog.cpp-195-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Domain is ''
+0.076 7:HptcCredsDialog.cpp-222-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating button drawer
+0.084 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/show/authorized) = T
+0.084 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/configure/authorized) = T
+0.088 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/locale/authorized) = F
+0.088 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/keyboard/authorized) = T
+0.100 7:ConfigKeyboard.cpp-203-void ConfigKeyboard::retranslateUi() ConfigKeyboard::retranslateUi, lang=en_US
+0.104 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/mouse/authorized) = F
+0.104 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/touchscreen/authorized) = F
+0.108 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/onscreenKeyboard/authorized) = T
+0.112 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/configure/authorized) = T
+0.112 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/info/authorized) = T
+0.116 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/info/authorized) = T
+0.124 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/network/authorized) = T
+0.152 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/network/authorized) = T
+0.156 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/power/authorized) = T
+0.156 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/Power/buttons/power/authorized) = T
+0.156 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/enableSleep) = T
+0.160 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/Power/buttons/sleep/authorized) = T
+0.160 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/sleep/authorized) = T
+0.160 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(tmp/Power/buttons/sleep/hasHardwareSupport) = T
+0.164 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/reboot/authorized) = T
+0.164 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/Power/buttons/reboot/authorized) = T
+0.168 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/poweroff/authorized) = T
+0.168 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/Power/buttons/poweroff/authorized) = T
+0.176 8:Utils.cpp-022-static bool Utils::regKeyEnabled(const QString&, bool) regkey(root/screensaver/buttons/power/authorized) = T
+0.176 7:HptcCredsDialog.cpp-320-void HptcCredsDialog::init(QApplication*, const QString&,
Unclear licensing, accounts, free software or not?
Hello,
I want to contribute to free software that uses Qt for its UIs, and I'm completely lost trying to understand if Qt itself is free or not and how its intellectual property works.
* The website looks like that of a commercial product and sells licenses. At first I thought I would have to pay to contribute to the software I'm trying to help
* There is a free download link for OSS
* The installer requires AN ACCOUNT??? (on Linux)
* There are CLion plugins but they're paid
* There are qt packages in my package manager (apt, so obviously free as in beer, at least), but I guess that's just the libraries and not the GUI editor
How does any of this make sense? This all seems super confusing and really shady if it weren't for the popularity of the framework. Can someone enlighten me?
https://redd.it/18c87lw
@qt_reddit
Qt5 -> Qt6 build from source, libEGL.dll libGLESv2.dll missing after full build?
im currently switching from Qt5 to Qt6 and after doing a full-build of Qt6 i saw that the (software opengl, wrapper?) libEGL.dll and libGLESv2.dll are missing - which are needed for some 3D on a 3d-shitty system
do i miss a configure setting or do i need to provide these dll from external source?
https://redd.it/18b9trw
@qt_reddit
QProgressBar is freezing the main thread
Hello
I'm using asynchronously a QProgressBar to follow the progress of a task on a secondary thread
So from the thread I send a signal which is connected to the slot QProgressBar::set value
The problem is apparently I send so many progresses, the main loop take seconds to update the progress bar (because of calling hundreds of slots)
Do you know a way to solve that ?
https://redd.it/18axq0p
@qt_reddit
Export from QT Design Studio?
I'm really struggling with the lack of documentation for Qt Design Studio. I intended to use it to build the baseline gui for a python project that will do production tracking and production updates.
Building the ui was easy enough, but now I seem to be stuck with this Qt Design Studio project that I can't do anything with. I can't load the QML files directly into python because none of the dependency paths register properly, but I also seem to be having that exact same problem when trying to load the project into Qt Designer.
Can someone help me out with some options here? I really like the look of the UI that Design Studio can generate, but it doesn't do me much good if I can't use it.
https://redd.it/18aooqd
@qt_reddit
How to build Qt5 to universal version ?
Hi guys
I want to build Qt5 to support arm64 and x8664.
How can I do that?
I know Qt6 can build universal version , and it's use cmake.
eg :
./configure -- -DCMAKEOSXARCHITECTURES="x8664;arm64"
Someone help me Thanks a lot.
https://redd.it/18a2ayt
@qt_reddit
Importing QT Design Studio Project into QT Creator or Visual Studio
I've made a figma project that I imported into QT Design Studio but how do I import that Design Studio project into QT Creator or Visual Studio? What type of QT application should I use?
https://redd.it/189e7eu
@qt_reddit
Is remote X11 a second class citizen for performance?
I've been living in a Qt4 world for a long time. Yes, I'm aware that Qt5 has come and gone and now the world has moved onto Qt6.
I was recently working with a corporate app using Qt4 and I thought I should finally look at what the Qt5 world will be like for that application. After a day of grinding through some required changes, I've successfully built with Qt5 and can run the application. Yay!
The runtime model for this application is that it runs on a linux box and it then sends its X11 output to a Windows PC running a relatively recent xming display server.
The Qt4 performance was never great, but it was good enough considering everything. The Qt5 performance is downright awful.
Searching around the interwebs, and I see that this runtime model no longer enjoys the level of performance support that it once did. These specific bug reports and their comments are the ones that stand out for me.
* [https://bugreports.qt.io/browse/QTBUG-56851](https://bugreports.qt.io/browse/QTBUG-56851)
* [https://bugreports.qt.io/browse/QTBUG-55842](https://bugreports.qt.io/browse/QTBUG-55842)
* [https://bugreports.qt.io/browse/QTBUG-50338](https://bugreports.qt.io/browse/QTBUG-50338)
My questions are.
1. Did this situation improve with Qt6? I have yet to find evidence it does. It sounds like this is the new normal.
2. For those who have suffered through this transition for this minority setup, what did you do to live with it?
​
https://redd.it/188l79m
@qt_reddit
Reshaping Widgets
Is it possible to reshape Widgets in Qt. If yes then how? I am trying to shape a QPushButton in the form of a Triangle
https://redd.it/1889d9v
@qt_reddit
Qt signals and slots tutorial for beginners
https://www.youtube.com/watch?v=qmatIzvqyGI
https://redd.it/186qq18
@qt_reddit
How do I use qmltc from the terminal?
I am using qt6 on Windows and I recently found out about qml compilers. Before this I have been using the qrc resource system to use qml in C++, but I want to try and see how it would be if I compiled the qml to C++. I tried using qmltc straight from git bash by doing qmltc src/main.qml
, but I always get the error No resource paths for file: src/main.qml
. What does this mean and how do I fix it?
https://redd.it/18fitzv
@qt_reddit
Unable to use the Qt Charts module
Hello
As the tittle says, I just cannot use the Charts no matter what. I used the maintenance tool to install the library, added Qt += charts and when I try to run, it says that the module cannot be found.
What is thw solution to this?
https://redd.it/18epzxf
@qt_reddit
How can I expose an c++ enum to qml?
I have an enum I would like to expose to qml in order to later compare this enum state in other objects. I added Q\_NAMESPACE and Q\_ENUM\_NS macros to enum file like so:
#include <qnamespace.h>
#include <QObject>
namespace MapComponents
{
Q_NAMESPACE
enum class TileType
{
BLOCK,
WALKABLE,
PATH,
BUILDING,
NONE
};
Q_ENUM_NS(TileType)
}
Then I register it in my main.cpp:
//...
qmlRegisterType<MapComponents::TileType>("tileType", 1, 0, "TileType");
//...
I import MapComponents to my qml file:
import tileType
But when I try to use it in qml it will not access an enum :
//...
if(tileType.TileType.BLOCK === 0){
dosmth()
}
//...
this will result in incomplete qml code execution.
https://redd.it/18d1nxs
@qt_reddit
How can I expose an c++ enum to qml?
I have an enum I would like to expose to qml in order to later compare this enum state in other objects. I added Q\_NAMESPACE and Q\_ENUM\_NS macros to enum file like so:
# include <qnamespace.h>
#include <QObject>
namespace MapComponents
{
Q_NAMESPACE
enum class TileType
{
BLOCK,
WALKABLE,
PATH,
BUILDING,
NONE
};
Q_ENUM_NS(TileType)
}
Then I register it in my main.cpp:
//...
qmlRegisterType<MapComponents::TileType>("tileType", 1, 0, "TileType");
//...
I import MapComponents to my qml file:
import tileType
But when I try to use it in qml it will not access an enum :
//...
if(tileType.TileType.BLOCK === 0){
dosmth()
}
//...
this will result in incomplete qml code execution.
https://redd.it/18d1oil
@qt_reddit
const QString&, bool) 4 buttons are visible.
+0.176 7:HptcCredsDialog.cpp-326-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating login button
+0.176 7:HptcCredsDialog.cpp-337-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Creating cancel button
+0.176 7:HptcCredsDialog.cpp-391-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Adjusting visible and enabled fields.
+0.176 7:Stylesheet.cpp-117-QString Stylesheet::readStylesheet(const QString&) const stylesheet[lock]: reading qss contents of /etc/hptc-zero-login/styles/lock
+0.176 7:Stylesheet.cpp-066-void Stylesheet::revalidate() Reading stylesheet /etc/hptc-zero-login/styles/lock success=1
+0.176 7:Stylesheet.cpp-084-void Stylesheet::revalidate() stylesheet[lock]: bgConfig='/etc/hptc-zero-login/styles/lock/bgConfig.rtf'
+0.176 7:Stylesheet.cpp-097-void Stylesheet::revalidate() stylesheet[lock]: loginConfig='/etc/hptc-zero-login/styles/lock/login.rtf'
+0.176 7:HptcCredsDialog.cpp-513-void HptcCredsDialog::setTheme(const QString&) Stylesheet: /* Apply a specific background color to every common widget type */
QWidget { background-color: rgb(255, 200, 200); } /* Light Red */
QPushButton { background-color: rgb(200, 255, 200); } /* Light Green */
QLabel { background-color: rgb(200, 200, 255); } /* Light Blue */
QLineEdit { background-color: rgb(255, 255, 200); } /* Light Yellow */
QComboBox { background-color: rgb(200, 255, 255); } /* Light Cyan */
QCheckBox { background-color: rgb(255, 200, 255); } /* Light Magenta */
QRadioButton { background-color: rgb(255, 220, 200); } /* Light Orange */
QSlider { background-color: rgb(200, 220, 255); } /* Light Periwinkle */
QScrollBar { background-color: rgb(220, 255, 200); } /* Light Lime */
QGroupBox { background-color: rgb(255, 200, 220); } /* Light Pink */
QTabWidget { background-color: rgb(220, 200, 255); } /* Light Lavender */
QMenuBar { background-color: rgb(200, 220, 220); } /* Light Teal */
QToolBar { background-color: rgb(220, 220, 200); } /* Light Khaki */
QStatusBar { background-color: rgb(220, 200, 200); } /* Light Salmon */
QDialog { background-color: rgb(200, 200, 220); } /* Light Slate */
/* Apply a distinct border to all widgets */
* { border: 2px solid black; }
+0.184 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
+0.208 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
+0.208 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
```
Image of the GUI: https://www.jottacloud.com/share/qm8lqscrfjra
The application is most likely using Qt v5
https://redd.it/18cgk26
@qt_reddit
Reverse engineering: Finding objectName for different UI elements in a closed source application
Hi everyone!
I'm working on customizing the UI of a third-party application (Login and lock dialog on HP Thinpro, a thin client OS based on Ubuntu) and have run into a bit of a snag. Specifically, I'm trying to figure out how to identify the `objectNames` of different UI elements in this closed-source application.
So far, I've managed to style the login dialog box using a Qt stylesheet. However, when attempting to style the lock screen dialog, it seems that my stylesheet isn't being applied. I've confirmed via logs and `strace` that the application does read the `.qss` file, but there's no visible change in the UI.
Below is the diagnostic stylesheet I used in an attempt to spot any changes:
```css
/* Apply a specific background color to every common widget type */
QWidget { background-color: rgb(255, 200, 200); } /* Light Red */
QPushButton { background-color: rgb(200, 255, 200); } /* Light Green */
QLabel { background-color: rgb(200, 200, 255); } /* Light Blue */
QLineEdit { background-color: rgb(255, 255, 200); } /* Light Yellow */
QComboBox { background-color: rgb(200, 255, 255); } /* Light Cyan */
QCheckBox { background-color: rgb(255, 200, 255); } /* Light Magenta */
QRadioButton { background-color: rgb(255, 220, 200); } /* Light Orange */
QSlider { background-color: rgb(200, 220, 255); } /* Light Periwinkle */
QScrollBar { background-color: rgb(220, 255, 200); } /* Light Lime */
QGroupBox { background-color: rgb(255, 200, 220); } /* Light Pink */
QTabWidget { background-color: rgb(220, 200, 255); } /* Light Lavender */
QMenuBar { background-color: rgb(200, 220, 220); } /* Light Teal */
QToolBar { background-color: rgb(220, 220, 200); } /* Light Khaki */
QStatusBar { background-color: rgb(220, 200, 200); } /* Light Salmon */
QDialog { background-color: rgb(200, 200, 220); } /* Light Slate */
/* Apply a distinct border to all widgets */
* { border: 2px solid black; }
```
Despite this approach, I haven't been able to observe any changes in the lock screen UI. Does anyone have experience with reverse-engineering UI elements in Qt for styling purposes or any advice on how I might proceed? Any insights or tips would be greatly appreciated!
Here are the logs I collected displaying that the application does in fact read the stylesheet.
```
+0.156 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
+0.176 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
+0.176 8:HptcCredsDialog.cpp-533-void HptcCredsDialog::retranslateUi() retranslate, locale=en_US
+0.000 Node='libhptc-creds-dialog' L8 Logging starts {Wed 06 Dec 2023 11:44:16 PM CET} p56632 u0/0 g0/42
+0.000 6:HptcCredsDialog.cpp-100-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Loading translations for 'en_US'
+0.004 5:Utils.cpp-026-static bool Utils::regKeyEnabled(const QString&, bool) NO regkey 'root/SCIM/ScimEnabled', fell back to T
+0.004 7:HptcCredsDialog.cpp-103-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Filling out priv.
+0.004 7:HptcCredsDialog.cpp-123-void HptcCredsDialog::init(QApplication*, const QString&, const QString&, bool) Getting DesktopConfig(lock).
+0.004 7:DesktopConfig.cpp-053-DesktopConfig::DesktopConfig(const QString&, QObject*) Parsing desktop-config file '/etc/hptc-zero-login/styles/lock/login.rtf'
+0.004 7:DesktopConfig.cpp-065-DesktopConfig::DesktopConfig(const QString&, QObject*) window-position = 20%x20%
+0.004 7:DesktopConfig.cpp-065-DesktopConfig::DesktopConfig(const QString&, QObject*) button-location = left
+0.004 7:DesktopConfig.cpp-065-DesktopConfig::DesktopConfig(const QString&, QObject*) smartcard-enabled = false
+0.004 7:DesktopConfig.cpp-065-DesktopConfig::DesktopConfig(const QString&, QObject*) title-enabled = true
+0.004 7:DesktopConfig.cpp-065-DesktopConfig::DesktopConfig(const QString&, QObject*) icon-enabled = true
+0.004
How to Build Qt 6.4.0 from Source on Ubuntu Linux (Works with Qt 6.6 as well)
https://www.ics.com/blog/how-build-qt-640-source-ubuntu-linux
https://redd.it/18bikd1
@qt_reddit
Qt with or without a monitor
I have a python app using Qt that, of course, uses a monitor. A use case has developed that the same app needs to run without a monitor. I’ve not run into this requirement before. Can Qt run using some kind of virtual monitor, without a physical monitor? Any advice would be helpful.
Thanks!
Bill
https://redd.it/18b0qof
@qt_reddit
QML Spin box - distance between items
The Spin Box contains items, which are tightly stuck together. I'd like to have a little space between the up indicator, the content item, and the down indicator. Adding padding and margins to these did not work. Adding another rectangle to the spin box is not shown at all.
Is there another way to add some space between the items?
https://redd.it/18aqp6w
@qt_reddit
Windows: build Qt6 from source - should i still use the qt5 git super module?
solved
is the qt5 super module: git://code.qt.io/qt/qt5.git still the base for also building qt6?
​
1. git clone git://code.qt.io/qt/qt5.git
2. cd qt5
3. git checkout v6.6.1
4. perl init-repository --module-subset=default
5. configure ... as usual
is that the same as using the zip from the qt.io?
https://download.qt.io/official\_releases/qt/6.6/6.6.1/single/qt-everywhere-src-6.6.1.zip
https://redd.it/18aluw5
@qt_reddit
UART Rx ISR
Making a Qt application to run on Embedded Linux on a Raspberry Pi. Is there a UART Rx ISR function that is part of the Linux drivers that can call a function whenever a new UART byte is received. I don’t want to use a thread solely for periodically polling the UART buffer if there are no new characters to read.
https://redd.it/189rv1e
@qt_reddit
My Video splash screen not completing?
i have made a simple splash screen that displays a video but only like 2 seconds before my kubuntu desktop starts is there anything to add to the splash.qml to make it wait a few seconds?
https://redd.it/188z1yp
@qt_reddit
Issues with qt 5.15
I use linux mint. I got a folder of the tissue simulation toolkit from my co-worker. The folder contains a lot of .cpp and .h files along with parameter files, .o files, .par files and a cellularpotts.pro file. Its a cell simulation that uses qt and libpng as well as the tst (tissue simulation toolkit). When using qmake and make in my terminal, I can run the simulation perfectly fine. However, when I edit one of the .cpp files in qteditor and then use "make" again, the simulation doesnt function anymore. I've asked my coworker but he doesnt know the solution either. First using qmake and then make doesnt work. using make clean doesnt work.
Im a beginner so I dont know about a lot of things. The version of qt is 5.15.
https://redd.it/188gusp
@qt_reddit
I'm trying to change the colour of cells in a QTableView and running into problems
Apologies in advance, I'm not very experienced with Qt
I have a QTableView, I want some cells to appear "greyed" out if certain conditions are met elsewhere in the table.
I've decided to attempt this by reimplementing the "data" method in my class which inherits from QStandardItemModel
def data(self, index, role):
if role == Qt.BackgroundRole:
if (self.index(index.row(), self.FIELD_ABC).data(Qt.EditRole) != "abc"):
if index.column() in [9,10]:
return QBrush(Qt.grey)
else:
return QBrush(Qt.white)
else:
return QBrush(Qt.white)
else:
return super().data(index, role)
( I know this code is kinda funky, I'm doing a lot of experimenting!)
This achieves what I want, when "abc" is entered into field ABC (which is being done via delegate that provides a QComboBox), the cells at index 9 and 10 appear greyed out, however they only appear greyed out AFTER I click on the table again, I want the cells to appear greyed out automatically after the "abc" is entered into field ABC
**I think I can solve my problem by having my creating a slot that will force a redrawing of the tableview, and attaching it to the datachanged signal of my QStandardItemModel/my QComboBox delegate, but I am unsure how to do this. Does anyone know how I can do so?**
After looking around online, I've seen other people implement this behaviour by using ProxyModels and more delegates, I'd like to avoid this if possible because it seems overcomplicated for my use-case (I'm regretting not just using a QTableWidget honestly, but it's too late now...)
In case it helps, here's the ComboBox delegate
class ComboBoxDelegate(QItemDelegate):
def __init__(self, parent, options: List[str]):
super().__init__()
self.options = options
def createEditor(self, parent, option, index):
combo = QComboBox(parent)
combo.addItems(self.options)
self.connect(combo, QtCore.SIGNAL("currentIndexChanged(int)"),
self, QtCore.SLOT("currentIndexChanged()"))
return combo
def setEditorData(self, editor, index):
editor.blockSignals(True)
try:
editor.setCurrentIndex(index.model().data(index))
except TypeError:
pass
editor.blockSignals(False)
#@QtCore.pyqtSlot()
def currentIndexChanged(self):
self.commitData.emit(self.sender())
def setModelData(self, editor, model, index):
model.setData(index, editor.currentText(),QtCore.Qt.EditRole)
​
https://redd.it/186pybf
@qt_reddit
Create Your Own Snipping Tool in Python and PyQt5 in 10 minutes
https://youtu.be/v4jWEri-uAE
https://redd.it/186jeyw
@qt_reddit