Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • 0 Votes
    4 Posts
    386 Views
    SGaistS
    The suggestion is to built it in a Linux machine so that you can then use it on your target.
  • Extend QPdfWriter for adding PDF widget annotation field

    Solved
    8
    0 Votes
    8 Posts
    747 Views
    Christian EhrlicherC
    @EelcoPeacs Maybe you can also apply a patch for it? If you won't/can't do it through gerrit then attach it to the bug report.
  • 0 Votes
    3 Posts
    844 Views
    A
    @AlexZhZZ See QTBUG-120196
  • In win compile from command line

    Solved
    18
    0 Votes
    18 Posts
    1k Views
    M
    x64 Native Tools Command Prompt help me. Thank all guys!
  • [C++] Performance travel massive object field data

    Solved
    18
    0 Votes
    18 Posts
    1k Views
    J
    @Sabrac said in [C++] Performance travel massive object field data: I'm facing with bad performance problem. I have a list with ~100k object, each object have ~100 field (each object have differenct field name / properties), The task i need to do is travel each field of each object to detect object's reference. Is there any solution for the best performance without any database? Navigating such a vast list of objects and fields can indeed present performance challenges. Considering the scale, optimizing this task without a database is intricate. However, when seeking solutions that are both efficient and satisfying, much like finding the best breakfast tacos in San Antonio, specialized algorithms or data structures tailored for traversal tasks might offer better performance. Strategies like hash maps or tree-based structures can expedite reference detection across numerous fields within your objects. It's a bit like exploring new eateries—finding the right flavor and combination is key to an enjoyable experience!
  • Qt Image save

    Unsolved
    2
    0 Votes
    2 Posts
    172 Views
    Christian EhrlicherC
    Please provide a minimal, compilable example and post your code as text, not image. How should we know what i.doing() is doing?
  • Clickable links in QListWidget with Rich Text

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    @GayaneAlaverdyan did you check the QLabel implementation as suggested above ?
  • can not update data of qml tableview from QAbstractTableModel

    Solved
    2
    0 Votes
    2 Posts
    313 Views
    JoeCFDJ
    @JoeCFD fixed by calling setData with proper role index.
  • Way to determine utf-8 without BOM encoding

    Unsolved
    10
    0 Votes
    10 Posts
    3k Views
    S
    Have quick look at UTF-8 on Wikipedia: There are certain rules to be followed for something to be a valid UTF-8 character. Bytes that start with 0... are also valid ASCII (ASCII only specifies the first 128 characters; others are use depending on different languages). If you find a byte that starts with 1... you know you got a possible multibyte sequence. However, a multibyte sequence can only start with 110..., 1110..., or 11110... It can not start with 10... because 10... is always the following bytes of a multibyte sequence. 110... means one byte with 10... follows, 1110... is followed by two bytes with 10... and 11110... is followed by three bytes with 10... If this pattern is not met you don't have UTF-8 encoding. In many languages (using the latin alphabet) there will often be just a single letter in the upper range (byte starting with 1...) immediately followed by a regular ASCII character from the lower range (byte starting with 0...) -> invalid UTF-8. This makes it feasible to distinguish between ANSI encodings and UTF-8 based on the byte patterns. This will work for regular text most of the time. Only downside: as long as only ASCII characters are used you cannot distinguish between ANSI or UTF-8 because they will be exactly the same. It is up to you to decide if handling this case always as UTF-8 is alright (only matters if you also write and not just read). Qt also provides some functions that can be (mis-)used: https://stackoverflow.com/questions/18227530/check-if-utf-8-string-is-valid-in-qt . You can either use ConverterState when trying to interpret bytes as UTF-8 or provide the alternative encoding if UTF-8 fails (see comment of accepted answer on StackOverflow).
  • Can't find Qt3DExtras

    Unsolved
    7
    0 Votes
    7 Posts
    681 Views
    J
    @jsulm It seams that installation is failed, I install Qt3D with apt-get: sudo apt install qt3d5-dev but I can't find any dev pkgs of Qt3DExtras.
  • Closing QHttpServer

    Unsolved
    2
    0 Votes
    2 Posts
    322 Views
    Christian EhrlicherC
    @WallPulse But every connection you open has a close() function which you can call.
  • Qt Creator and Scrolling Template Welcome

    Unsolved
    3
    0 Votes
    3 Posts
    316 Views
    1
    @Pl45m4 that is good to know.. but how is that scroll area made?.. is just perfect. there is a lot of items (projects) with animation, i can not get the scroll area work smooth..
  • qfuture_impl.h:180:43: error:

    Unsolved
    3
    0 Votes
    3 Posts
    301 Views
    S
    @sunruh QFuture<void> future = QtConcurrent::run(this, &OperatorWindow::testThreadDoOnThread); which all worked fine under qt5.x
  • How to force light or dark mode in app on macOS or Windows?

    Unsolved
    2
    0 Votes
    2 Posts
    892 Views
    T
    @mjsmithers did you figure out how to explicitly control light or dark mode independent of the system? I'm having the same issue.
  • What is Q_PROPERTY's equivalent to QML default properties?

    Solved
    9
    1 Votes
    9 Posts
    726 Views
    A
    @Asperamanca So I solved this using an undocumented feature: namespace MyModule { class IntWrapper { Q_GADGET QML_VALUE_TYPE(myModule_IntWrapper) Q_PROPERTY(int intValue READ getIntValue WRITE setIntValue) QML_STRUCTURED_VALUE public: Q_INVOKABLE IntWrapper(const int& value); int m_Value = {}; int getValue() const; void setValue(const int& arg); }; } // namespace MyModule EDIT: This is going to be documented in Qt 6.7, see https://bugreports.qt.io/browse/QTBUG-113490?jql=text ~ "QML_STRUCTURED_VALUE"
  • QAudioOutput::setDevice seems not work on mac

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    C
    @Axel-Spoerl What I want to achieve is: keep select the mac mini speaker in audio setting, my program has a build-in audio output menu and user can make selection in my program and the selection will only affect my program and not affect the system audio setting. To achieve this, I use QMediaDevices::audioOutputs to get all output device, then find the usb speaker, call setDevice to QAudioOutput and replay sound file, this works on window and Linux but not work on Mac. I mean the problem is calling setDevice not work, the sound still playing on Mac mini build-in speaker rather than my selection. The quote "When I select the USB device for output, with qt or without qt, it's no problem playing sound." I mean my usb device has no problem, when I select usb device, the sound could play on it, but in this case, when I choose mac mini build-in speaker in my program, the sound still play on usb device. The problem is that QAudioOutput::setDevice not work, it does change the audio output device for QMediaPlayer.
  • Share Files between different Qt Help Project Files

    Unsolved
    2
    0 Votes
    2 Posts
    235 Views
    jeremy_kJ
    The URLs passed to QTextEdit::loadResource() in my project are qthelp://<namespace>/<virtualFolder>/<relative path...>. Based on this, I presume that sharing between namespaces can be accomplished referencing an absolute path including the namespace and virtual folder, or a relative path that ascends the parent hierarchy as appropriate. An alternative is to check for script.js in every request. Edit: QUrl::host() reports the namespace. A relative path using ../ doesn't appear to be an option.
  • Why sometimes the style of a button changes

    Unsolved
    6
    0 Votes
    6 Posts
    530 Views
    C
    @John-Van You are only setting the style sheet set on btn_min but complaining about the changed style of other icons. Perhaps you could post a self-contained, complete example that reproduces the failure. BTW, I'd try removing the half-reference to #btn_max from the style you attached to btn_min.
  • Graphics view

    Solved
    3
    0 Votes
    3 Posts
    306 Views
    W
    @Rockerz As Christian said, it's always a good idea to do basic debugging before you ask other people to take a look. You'll generally get much more useful feedback when you say things like where it's crashing and what sort of crash it is. That said, the QPixmap constructor that takes a const char* doesn't take a filename: https://doc.qt.io/qt-6/qpixmap.html#QPixmap-4 I dunno if that's your issue. But it certainly is one of your issues.
  • WebKit for minGW - how To build?

    Solved
    22
    0 Votes
    22 Posts
    5k Views
    SGaistS
    @8Observer8 Hi, The module has been deprecated and is not supported anymore. You can check this fork of the original reboot project. Its author might be more able to help you.