Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Draw QImage on top of another with QPainter?

    Solved
    3
    0 Votes
    3 Posts
    866 Views
    M
    @ChrisW67 said in Draw QImage on top of another with QPainter?: The best I can tell from the tangled code, when you create a new layer QImage you do not fill it. It therefore contains whatever rubbish was in memory and you paint with that. Thanks! Problem solved!
  • Compare single QString against many, evaluate to true if it matches any

    Unsolved
    8
    0 Votes
    8 Posts
    648 Views
    Kent-DorfmanK
    if using a static or pre-loaded list of strings then create a map and compare your input string against the map keys using map::find(). Your search times will generally be much shorter. the general mechanism here is to use a binary search of a sorted list to determine if your input string is found.
  • How to achieve the visual effects like this picture.

    Solved
    5
    0 Votes
    5 Posts
    311 Views
    Bruce.ZhangB
    @ChrisW67 Thanks for your reply.
  • QMediaPlay stream does not wokk

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    B
    Sorry - that was the wrong link I used that to get the connect information The following link refers to a stream https://stackoverflow.com/questions/30507317/how-do-i-play-a-stream-with-qmediaplayer
  • QT Creator - creating a QGraphicsVideoItem

    Unsolved
    7
    0 Votes
    7 Posts
    546 Views
    L
    Many thanks, I'll give it a shot.
  • Switching between multiple pages

    Unsolved
    3
    0 Votes
    3 Posts
    4k Views
    L
    @JonB Thanks a lot for your response, Its clear now.
  • Delete an entry in json file based on field "Name"

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    AxelViennaA
    I think this topic should be marked solved. It is clear that to delete an object by its key, you have to know both the key and its position in the JSON tree. If you don’t, you have to recurse through the JSON tree until you find what you want to delete. If there is no way to know or find the object of desire, nothing can be done with it at all. Order, btw, does not matter here. This is the beauty of proper recursion.
  • connectSlotsByName can not be trusted?

    Solved
    4
    0 Votes
    4 Posts
    443 Views
    mrjjM
    Hi Nope, it can't be trusted. :) You can obtain the same auto connect using FindChildren and lambdas.
  • Detecting clicks on QTreeView icons.

    Solved
    6
    0 Votes
    6 Posts
    611 Views
    S
    @mrjj Thank you very much for your kind help.
  • Crash under nearly identical build circumstances as working version (AUR)

    Solved
    2
    0 Votes
    2 Posts
    227 Views
    C
    The release-mode binary does not produce a particularly useful stack trace. It looks like your code crashes before you even get out of main(). Is a QApplication the first thing your create in main()? Build a debug version and reproduce the error. The stack trace should identify the last line of your code that ran, which will usually be in the general area of the root cause of the crash.
  • building ODBC plugin on Linux

    Solved
    11
    0 Votes
    11 Posts
    8k Views
    L
    @hskoglund said in building ODBC plugin on Linux: @wxzxg1804 Hi, just emailed you, I've uploaded a 5.13.0 version in the same place, here hi,i have the same problem with Mr bdfyy. But the "http://tungware.com/qsql_odbc.cpp" become 404 not found. Could you give me the Patch qsql_odbc.cpp? Thanks a lot! E_Mail:liweixxxx1990@163.com.
  • Windows & Mingwx64 no QtCoreD.dlls ?

    Unsolved mingw
    4
    0 Votes
    4 Posts
    734 Views
    C
    There are no debug libraries in the binary folder containing the runtime used by Qt Creator (i.e. ...\Qt\Tools\QtCreator\bin. There should be under the folder for each Qt library version you have installed, and these are the libraries that your program should be built against/link to. I would guess the path should be ...\Qt\6.1.2\mingw32\lib and ...\bin (no Windows install in front of me).
  • QObject::connect error / Make sure '...' is registered using qRegisterMetaType()

    Unsolved
    3
    0 Votes
    3 Posts
    517 Views
    Pl45m4P
    @makopo As @Christian-Ehrlicher said above, you need to register the complete type (in your case CComPtr<IDeckLinkVideoFrame>).
  • One method to handle all menu items?

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    JonBJ
    @Publicnamer said in One method to handle all menu items?: putting it all in a lambda would be unseemly Absolutely! You can write a multiline lambda as big as you like, but I keep them to one line, calling some other method to do big stuff but with whatever extra parameters I need from any variables where the connect() appears. Just curious what is the checked parameter for? I omitted it and things work fine. You obviously have never noticed, but the QAction::triggered signal actually passes this: void QAction::triggered(bool checked = false): If the action is checkable, checked is true if the action is checked, or false if the action is unchecked. I only put it in in case you were using it, to match the original signal signature. Here I could have omitted it, and I received the parameter in my lambda but didn't actually bother to pass it onto onMenu(). I too would probably have left it out here.
  • Why is preferred size ignored in QMainWindow (Qt5)?

    Unsolved
    2
    0 Votes
    2 Posts
    488 Views
    MitsuriouM
    Hello, I'm not sure these are the best practises but please try to: Remove the calls related to the size policy. The window will be taking the less needed space, by default, If I'm not mistaken. And, or, remove the explicit call to setGeometry() to let default values being applied; And, or, call adjustSize() just before calling show().
  • array of structs?

    Solved
    2
    0 Votes
    2 Posts
    393 Views
    mrjjM
    Hi Both QVector<MyStruct*> QVector<MyStruct> are allowed. If MyStruct is QObject based (has as the parent) then only pointer to it, can be used. If MyStruct is simply a c++ struct then both QVector , QList, and all containers that are known to man, will work. That said, nothing wrong in using std::vector and friends. So something else must be up with the code if it did not work for you. Please show definition of MyStruct if you want help to find out.
  • Where is QLayout property leftMargin

    Unsolved
    3
    0 Votes
    3 Posts
    572 Views
    A.v.OA
    @ChrisW67 said in Where is QLayout property leftMargin: No, not a mistake, a design choice. QRect and QLayout are different beasts. There is also no requirement for a one-to-one mapping between the UI file XML and properties. It seems just inconsequent having ui-file have properties on an QObject that does not exist in the code. By the way, I'm not using the ui-file to be compiled but using QFormBuilder with some of work-arounds to load/create modify and save ui-files from the Concept Application I'm working on. That is why I'm missing the properties on the layout object. [image: 770b3b61-9489-44dd-8422-40d6c542c54a.png]
  • Modbus RTU more than one response for multi reg reads.

    Unsolved
    5
    0 Votes
    5 Posts
    668 Views
    A
    @J-Hilk Ok, that's concerning. I'll try it and report. Thanks for the feedback.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • 0 Votes
    3 Posts
    451 Views
    nicmoraisN
    Nevermind: fixed with QNetworkRequest::setAttribute(QNetworkRequest::Http2AllowedAttribute, false); Thank you for your attention.