Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • Qtcreator can't start on Red Hat Enterprise Linux 9.3

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    T
    @Hanqaqa Thanks, I had the same problem with RHEL 8.9 and Qt Creator 13.0.1
  • QString hex translation errors

    Unsolved
    7
    0 Votes
    7 Posts
    477 Views
    JonBJ
    @Bryan-Kelly said in QString hex translation errors: x32 = binary->int_32[ i ]; // input: 89ABCDE3, 2309737955 s32.setNum( x32, 16 ); // s32 = 89abcde3 z32 = s32.toInt( &b32, 16 ); // z32 = 0, b32 = false In the light of what @Christian-Ehrlicher has just said, can you try this with 0-7 instead of 8-F as the leading hex digit? :) Do ir with e.g. s32 = 79abcde3, what's the result? And, try the original but use uint QString::toUInt(bool *ok = nullptr, int base = 10) const. The variants for 64-bit use Long/ULong.
  • How to read a json file without using the qrc ?

    Unsolved
    3
    0 Votes
    3 Posts
    228 Views
    M
    @nicker-player Simply create a string variable with your json contents in any file you want.
  • How to perform a minimal installation for C++ on Windows

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    S
    Is your goal really to use Qt Creator as an IDE for regular C++ projects? Because you haven't selected any Qt version (if you want to install Qt, don't click the check box for the version directly, but expand and only select the version for MSVC).
  • Deployed program fails to load JPEG

    Solved
    28
    0 Votes
    28 Posts
    7k Views
    D
    Hello from 2024, I believe I had the same issue loading JPEG plugin, while other (GIF ICO) loaded correctly. It is insufficient to have "imageformats" with the "qjpeg(d).dll" in it. You also need to have "jpeg62.dll" in your application folder, i.e. next to other basic "Qt6*.dll". The missing "jpeg62.dll" corresponds to JPEG image codec (https://libjpeg-turbo.org/) that Qt JPEG plugin depends on. I hope that helps.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    3 Posts
    468 Views
    sumanth_sarvepalliS
    @jsulm Thanks!
  • How to find out if a device is on the 'local' network?

    Unsolved
    4
    0 Votes
    4 Posts
    308 Views
    T
    @JonB : yes
  • QT, C++ code not executing powershell script

    Unsolved
    9
    0 Votes
    9 Posts
    889 Views
    C
    @JonB . I will try.
  • Item background color from selection with custom paint() on ItemDelegate issue

    Unsolved
    3
    0 Votes
    3 Posts
    316 Views
    E
    My paint code looks like this: def paint(self, painter: QtGui.QPainter, option: QtWidgets.QStyleOptionViewItem, index: Union[QtCore.QModelIndex, QtCore.QPersistentModelIndex]) -> None: painter.save() model = self.parentObject.model() sourceModel = model.sourceModel() sourceIndex = model.mapToSource(index) item = sourceModel.itemFromIndex(sourceIndex) label = self.getLabel(item) assert label opt = QtWidgets.QStyleOptionButton() opt.initFrom(label) opt.rect = option.rect.adjusted(self.padding, self.padding, -self.padding, -self.padding) opt.icon = label.icon() opt.text = label.text() opt.iconSize = label.iconSize() option.widget.style().drawControl(QtWidgets.QStyle.ControlElement.CE_PushButton, opt, painter, label) painter.restore() Shouldn't the background color for the item already be painted with the correct color? The alternateColor and hover color for the item are properly painted because I get into this function. Only the select color is not painted properly.
  • why is the background not showing when using qstackedlayout?

    Unsolved
    8
    0 Votes
    8 Posts
    644 Views
    Pl45m4P
    @qtenjoyer said in why is the background not showing when using qstackedlayout?: that is, I cannot use stylesheet on classes inherited from qwidget? How can I realize what I want? Your question indicates that you haven't read @Bonnie 's post carefully :) The answer is already there :)) (Follow that link. There's an example how you can do it)
  • VisualStudio - new QObject Class

    Solved
    8
    0 Votes
    8 Posts
    435 Views
    P
    OK, setting compiler switches helped!! #ifndef IEC104_Server_H #define IEC104_Server_H //############################################################################# // TCP Socket //############################################################################# class IEC104_Server : public QObject { Q_OBJECT public: explicit IEC104_Server(QObject* parent = 0);
  • KDE6 CMake - Kate plugin trying to link in wrong path

    Solved
    4
    0 Votes
    4 Posts
    468 Views
    SGaistS
    Thanks for the feedback ! :-)
  • 32-Bit Qt crashes when calling a 32-bit DLL function (char*)

    Unsolved
    5
    0 Votes
    5 Posts
    412 Views
    hskoglundH
    Ok, it was a nice try :-) So compiler is the same but what about the app itself, is it really the same for Qt and Visual Studio? To me it looks like Visual Studio builds a console app without any calls to Qt and the Qt build is for a gui/QML flavored app. I.e. to debug this I think you need to use the same app for both of the build environments.
  • QProcess stuck in Starting state until waitForStarted returns from timeout

    Unsolved
    8
    0 Votes
    8 Posts
    737 Views
    F
    So ehhh, if I comment it out, the helper will start, the systemd user session will start too, as I can see user slices and services starting in the journal. But KDE won't start, so the screen will keep being black. Also there seems to be some weird behavior of sddm. I don't want to investigate this, as it seems not helping.
  • Qml load Offline Map (mapbox, osm and etc)

    Solved
    7
    0 Votes
    7 Posts
    6k Views
    H
    osm_100-<l|h>-<map_id>-<z>-<x>-<y>.<extension> While naming your tiles make sure the map id value is same as the active map type. Here you have given 1 as active map type so make sure map_id is 1.
  • QSlider linked with other QSlider - hints needed

    Solved qslider
    4
    0 Votes
    4 Posts
    541 Views
    MasterBLBM
    @Pl45m4 said in QSlider linked with other QSlider - hints needed: @MasterBLB said in QSlider linked with other QSlider - hints needed: And again, soon after I post here I get stroke of genius, and find solution on my own. Happens almost every time. Rubber Duck Debugging at its best :)) Yepp, though before posting I spent several hours testing different approaches - most interesting finding was that for press and hold lmb on non-handle element of the slider invokes timer events. The most important discovery was: value() returns something an event happens if the event was some kind which affect the value now, just after QSlider::event(), the value() should be different after realizing that the rest was easy.
  • Enable any Client to connect to my localhost and send /receive data from it.

    Solved
    2
    0 Votes
    2 Posts
    449 Views
    sierdzioS
    You are likely behind a router running NAT (Network Address Translation), and also likely your IP address is semi-random (your ISP gives you a new IP address every time your router is restarted or connection drops, etc.). Plus very likely port 12345 is blocked by your router's firewall. In order to make this work you need to have some publicly available, static IP address with network configured to allow communication on port 12345. How exactly to do this depends on your circumstances. Maybe you need to rent a server from some server room, or you can get a static IP from your ISP, or you can use some cloud provider like AWS. There are plenty of options to choose from, please read up on it. This is not a Qt-related issue; every service available on the Internet has to go through this.
  • Why is QSqlField::type() deprecated in Qt6

    Solved
    5
    0 Votes
    5 Posts
    355 Views
    M
    @MasterBLB Thanks.
  • How to prevent Windows from entering in hibernate/sleep mode

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    Chris KawaC
    So what should I use? I need to capture a frame every second and perform some operations If you need the system to stay awake it should be enough to call this once: SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED) Alternatively you can start a timer and call this periodically: SetThreadExecutionState(ES_SYSTEM_REQUIRED) If you also need the display to stay on add ES_DISPLAY_REQUIRED to any of those. What should I do in case of failure? I don't know. It's your app. You could inform the user, close the app, do nothing or anything else you feel like. Up to you.