跳到內容

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k 主題 456.4k 貼文
  • How to restore a regex rule into the json file?

    Unsolved
    3
    0 評價
    3 貼文
    246 瀏覽
    C
    You would need to escape literal double-quotes if they are also present within the regular expressions. Using a JSON package/library, like QJSonDocument, to write the file is the easiest way to ensure that escaping happens where it should (and is reversed on read). Another observation: your email address regex is not allowing for a lot of options. This, for example, is a valid email address, "someone+something@example.com". See this Stackoverflow article for more.
  • auto-scroll flickable to selected item

    Unsolved
    1
    0 評價
    1 貼文
    325 瀏覽
    尚無回覆
  • mysterious warning

    Unsolved
    2
    0 評價
    2 貼文
    209 瀏覽
    Pl45m4P
    @memyselfandqt said in mysterious warning: I know I must modify this file in design. So, I never edit this ui file. But you seem to have deleted something (maybe not intentionally) See https://forum.qt.io/post/566146
  • XPath 2.0 for Qt6

    Unsolved
    3
    0 評價
    3 貼文
    598 瀏覽
    D
    I got it going. Answer is here https://stackoverflow.com/questions/78017906/need-xpath-2-0-c-for-mingw/78028760#78028760
  • Trying to build QtPDF

    Unsolved
    5
    0 評價
    5 貼文
    367 瀏覽
    JoeCFDJ
    @apaczenko1993 Sorry. Qt 5.15.2 seems not having pdf module as default in the installer. I am using 5.15.3 on Ubuntu 22.04 and pdf module can be installed. Qt 6.6.2 has it as default.
  • set qhboxlayout to the bottom of the widget when i resize the window

    Solved qt6.6 c++
    7
    0 評價
    7 貼文
    1k 瀏覽
    JonBJ
    @a_coder As both other responders said, you need a vertical spacer above a widget if you want to push it down.
  • Available OPC UA backend fails to load

    Solved opcua opc client opcviewer example examples
    5
    0 評價
    5 貼文
    2k 瀏覽
    M
    Hi, I faced the same problem, failed to load OPC UA plugin: qt.opcua: Failed to load OPC UA plugin: "open62541" qt.opcua: Available plugins: QList("open62541") Could not create client I solved by putting libcrypto-3-x64.dll in the output build directory. Open62541_backend.dll depends on libcrypto-3-x64.dll, you can check it by using Dependency Walker tool. My env: Qt 6.6.0, MSVC2019 64bit.
  • Drawing QRubberBands with variabe size, but fixed aspect ratio: how to do it?

    Solved qrubberband qrect constraints
    3
    0 評價
    3 貼文
    447 瀏覽
    B
    @jsulm said in Drawing QRubberBands with variabe size, but fixed aspect ratio: how to do it?: rubberBand->setGeometry(QRect(origin, event->pos()).normalized()); Thanks. It is indeed as easy as you indicated! Regards Bertwim
  • qml spinbox editable and validation

    Solved
    3
    0 評價
    3 貼文
    407 瀏覽
    L
    @JoeCFD Yes you are right. I was stay on version 5.12.12. I have just try with version 6.6.1 and the control works has expected. Very surprise this kind of "bug"/"strange behavior" has stay on version 5.12 which was an LTS. Anyway thanks a lot for your answer
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    4 瀏覽
    尚無回覆
  • QLowEnergyController disconnectFromDevice not working

    Unsolved
    2
    0 評價
    2 貼文
    411 瀏覽
    S
    @Slingy Hello Slingy, i am experiencing exact same behaviour. i know that the qt bluetooth api is not entirely compatible with mingw in qt 5.14. but switching to msvc compiler is not an option for me. Did you get any further on this?
  • Application not starting maximized on Mac, when started from script.

    Solved qt6.5 qapplication macos scripting
    8
    0 評價
    8 貼文
    1k 瀏覽
    J
    @Jammin44fm Thanks for everyones input I've traced the issue to a problem with process input, and i'm going to create a more specific issue to address that.
  • How to set the dll path of the main program

    Unsolved
    6
    0 評價
    6 貼文
    1k 瀏覽
    C
    It should also be possible to use Windows application and DLL manifest entries to achieve DLL redirection during program start. This is a dark art AFAICT.
  • Adding QJsonObject to QJsonDocument takes a lot of time

    Unsolved
    4
    0 評價
    4 貼文
    367 瀏覽
    Paul ColbyP
    Hi @MrHandSOme, I calculate by putting qtime in the upper and lower parts. QTime has some overhead (probably very little, but still...). For interest, try this: const quint64 start = QDateTime::currentMSecsSinceEpoch(); QJsonObject rootObj; qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "rootObj"; rootObj[QStringLiteral("a1")]=QStringLiteral("a1obj"); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "a1obj"; rootObj[QStringLiteral("a2")]=QStringLiteral("a2obj"); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "a2obj"; rootObj[QStringLiteral("a3")]=QStringLiteral("a3obj"); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "a3obj"; rootObj[QStringLiteral("a4")]=QStringLiteral("a4obj"); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "a4obj"; rootObj[QStringLiteral("a5")]=QStringLiteral("a5obj"); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "a5obj"; QJsonDocument newDocument(rootObj); qDebug() << (QDateTime::currentMSecsSinceEpoch()-start) << "newDocument"; For me (on Linux though, I don't have Windows handy just at the moment), it shows all of that code executing within a single millisecond, as expected. My output: 0 rootObj 1 a1obj 1 a2obj 1 a3obj 1 a4obj 1 a5obj 1 newDocument If that code is slow for you, show us the output. If it's not slow, then try replacing the various QStringLiteral()'s with your versions one at a time and see if that reveals anything. Cheers.
  • 此主題已被刪除!

    Solved
    3
    0 評價
    3 貼文
    10 瀏覽
  • OpenVR SDK

    Unsolved
    1
    0 評價
    1 貼文
    143 瀏覽
    尚無回覆
  • Setting accessibility label relation for widget

    Solved
    2
    0 評價
    2 貼文
    201 瀏覽
    M
    I have found the answer, or at least what I think is the answer. Providing it here in case anyone else ever has this problem, I don't think it was very obviousm It seems to be to use QLabel.setBuddy(arg) on the label object passing it the widget to be labelled. Making this call gets NVDA to correctly identify the label for the widget.
  • How to add qmldir into cmake file?

    Unsolved
    1
    0 評價
    1 貼文
    185 瀏覽
    尚無回覆
  • [SOLVED] How to detect USB devices

    Unsolved
    10
    0 評價
    10 貼文
    17k 瀏覽
    J
    @McLion Would you currently prefer this approach over Qt D-Bus for it's simplicity?
  • Style-sheet pseudo-state for selected item in QListView?

    Unsolved
    5
    0 評價
    5 貼文
    341 瀏覽
    Pl45m4P
    @Joachim-W said in Style-sheet pseudo-state for selected item in QListView?: As I learned from https://forum.qt.io/topic/154635, and as confirmed by the API Docs (https://doc.qt.io/qt-6/qabstractitemview.html#currentIndex), there is also a "current" item in a QListView. As @JonB said, you are mixing up code "logic" and stylesheet states... They have no direct relation to each other. If I create my own item view and add a function called blaa(), which returns a struct named Blaa, it does not mean you have a property or style selector named MyItemView:blaa to apply any stylesheet to.