Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • no member named 'cout' in namespace 'std'

    Solved
    7
    0 Votes
    7 Posts
    9k Views
    S
    @Kopilov Thank you!! Worked for me fine
  • Locating the source of heap corruption (setup and general guidelines)

    Solved
    2
    0 Votes
    2 Posts
    454 Views
    deisikD
    AddressSanitizer is the way to go and debug
  • QT With Cloud Database

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    R
    @CKurdu Thank you very much for the information and for the shared links.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    15 Views
    No one has replied
  • How to obtain the battery design capacity of a laptop?

    Unsolved
    9
    0 Votes
    9 Posts
    503 Views
    Christian EhrlicherC
    Please stop posting images but your code with the proper code tags. Your code prints something to stdout and not to a widget from your former post. What do you expect? That stdout is magically redirected to your widget?
  • from c++ QVector<QVector<QString>> to QML JS array

    Solved
    4
    0 Votes
    4 Posts
    384 Views
    S
    ugh... you guys are right... i was thinking very wrong way of the method... basicaly it looks this way: // 2D array declaration logic QVector<QVector<QString>> CreateTableau(int sizeX, int sizeY) { .... code in initial post return result; } void SAP::materials(QString lageort, QString werk) { ... not important code table_Quantities(tableHandle); } QVector<QVector<QString>> SAP::table_Quantities(RFC_TABLE_HANDLE returnTable) { for (i=0; i<tabLen; i++) { int colLen = 10; if (i==0) { result = CreateTableau(tabLen, colLen); } //by first row we find out how many columns are there, and will declare 2D array accordingly // loop throught columns for (int j = 0; j < colLen; j++) { result[i][j] = something; //qDebug() << result[i][j]; // works fine } } return result; } and when calling it from QML: Component.onCompleted: { let table = []; table = sap.tablePopulate("5506", "6104"); console.log(table.length); // TypeError: Cannot read property 'length' of undefined } then it obviously is undefined when im calling sub method which creates no data unless its called from materials() :D so I need the SAP::materials() declare also as QVector<QVector<QString>> so now it works as expected... Thank you guys
  • [SOLVED]can't open file from qresources

    ressource
    23
    0 Votes
    23 Posts
    10k Views
    E
    I'm Using Qt 6.5.2 and had the same issue and after an hour of digging and testing all your solutions i did some digging on the build folder and i saw this: in <QBuild_Dir>/<cmake_project_name>/<module_name>_qml_module_dir_map.qrc <RCC> <qresource prefix="/"> <file alias="/<<<cmake_project_name>>>"><<<QBuild_Dir>>>/<<<cmake_project_name>>></file> </qresource> </RCC> so there is an alias for the resource! to use the resource on my C++ code i had to add it to the beginning of the resource path like before: ":/assets/img.svg" after ":/<cmake_project_name>/assets/img.svg and it works 👌
  • How douse QPainter, QPaintDevice and QPaintEngine work

    Unsolved
    5
    0 Votes
    5 Posts
    453 Views
    T
    @jeremy_k, yes, this helped a lot. I also saw that the SVG does not use the <line tag, but the <path tag for drawing a line.
  • How can i print a QImage to a thermal printer

    Unsolved
    9
    0 Votes
    9 Posts
    605 Views
    C
    @Mohan-Raj Is there a reason for posting the same problem under two separate accounts? https://forum.qt.io/post/771275 Have you read the (surprisingly informative) manual? Have you sent the commands to put the printer into bit image mode, set bit density, image size, before sending the image data? What arrangement of bits and scanlines does the printer expect? QImage::Format_Mono: "The image is stored using 1-bit per pixel. Bytes are packed with the most significant bit (MSB) first." The format described in the manual is not arranged the same way. What version of Qt are you using? QImage::byteCount() was marked, "This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code."
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Can tableView selection behave as radio button (or other button)

    Unsolved
    4
    0 Votes
    4 Posts
    341 Views
    jsulmJ
    @JacobNovitsky said in Can tableView selection behave as radio button (or other button): there is none under the link you provide There is https://doc.qt.io/qt-6/qtwidgets-itemviews-coloreditorfactory-example.html ("The Color Editor Factory example"). And under "See also" there are some more links to examples...
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Crashes if close MainWindow

    Solved
    7
    0 Votes
    7 Posts
    525 Views
    C
    Crashes on exit are common if you do not have the parent-child hierarchy set up correctly.
  • Make effects on part of a window

    Unsolved
    1
    0 Votes
    1 Posts
    101 Views
    No one has replied
  • How to use curl cmd in c++/qt

    Unsolved
    16
    0 Votes
    16 Posts
    1k Views
    jeremy_kJ
    Rather than continuing to ask for and provide step by step corrections, I suggest using a dummy program in place of curl to show what arguments curl is receiving. #include <cstdio> int main(int argc, char **argv) { for (int i = 0; i < argc; i++) printf("arg %d is '%s'\n", i, argv[i]); }
  • Why it fails to decrypt with OpenSSL

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    lincolnL
    @ChrisW67 Thanks for your answer, by the way I mention that I was testing the QAESEncryption class, and it also gave me a good result. thanks again for your comment
  • macos: [CATransaction synchronize] called within transaction

    Unsolved
    13
    0 Votes
    13 Posts
    3k Views
    S
    @SGaist add tifflib-4.5.1,then problem occurred. why?
  • How to open MainWindow always on top

    Unsolved
    4
    0 Votes
    4 Posts
    486 Views
    CKurduC
    @JacobNovitsky Maybe a silly question but Did you use setWindowFlags(Qt::WindowStaysOnTopHint) ? #include <QApplication> #include <QMainWindow> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow mainWindow; mainWindow.setWindowTitle("Example Top App"); mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint); mainWindow.show(); return app.exec(); } If you are on Linux OS, document also says "Informs the window system that the window should stay on top of all other windows. Note that on some window managers on X11 you also have to pass Qt::X11BypassWindowManagerHint for this flag to work correctly."
  • How to call Registeration-Free COM dll?

    Solved
    36
    0 Votes
    36 Posts
    7k Views
    hskoglundH
    Hi, the XML/manifest for the .exe, you forgot the "X" - suffix, it is necessary for reg-free COM to work, try change the XML to: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"></assemblyIdentity> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity name="DataTypesLibrary.X" version="1.0.0.0" type="win32" language="*" processorArchitecture="*"></assemblyIdentity> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity name="RecipeManagement.X" version="1.0.0.0" type="win32" language="*" processorArchitecture="*"></assemblyIdentity> </dependentAssembly> </dependency> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> </assembly> You already have a DataTypesLibrary.X.manifest file that works the DataTypesLibrary.dll written in C++ I think you should try the same with your C# RecipeManagement.dll, i.e. create a RecipeManagement.X.manifest file with something like this in it: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity name="RecipeManagement.X" version="1.0.0.0" type="win32" processorArchitecture="msil" /> <file name="RecipeManagement.dll"> <clrClass clsid="{B0AFB6EB-67CB-457E-8709-B6384B02558B}" threadingModel="Both" name="RecipeManagement.SystemSettings" runtimeVersion="v4.0.30319" /> <comClass progid="RecipeManagement.SystemSettings" clsid="{B0AFB6EB-67CB-457E-8709-B6384B02558B}" threadingModel = "Apartment" /> </file> </assembly> I'm just guessing, but try first with a separate RecipeManagement.X.manifest file (not embedded in the .dll) with the above contents. Also I don't know if <clrClass> should be inside or outside the <filename XML line, you could try both. Note that you also need the <typelib tlibid=xxx XML inside the <file.. (see my example above for the DataTypesLibrary.X.manifest) but that you can do a later step. About the empty sxstrace trace.txt log file, yes sometimes it doesn't work and gives an empty log file, try logging in/out or rebooting your PC. When it works it will show traces for other ,exe files like edge,exe as well so you'll have to scroll/search for your file. Note: there's a typing error above, here are the commands again: sxstrace trace -logfile:sxstrace sxstrace parse -logfile:sxstrace -outfile:trace.txt