Skip to content
  • 0 Votes
    5 Posts
    2k Views
    W

    @Ronel_qtmaster
    oh i understood what i wasn't getting yeah idk why i did that, thanks!
    onto the next mistake....

  • 0 Votes
    2 Posts
    373 Views
    B

    @ian28 the way you are doing it is how one would implement a new QML component in C++ that would tend to be purely used in QML - i.e. you wouldn't normally interact with it from the C++ side once it is created.

    If you wanted to continue with that sort of approach, it might be better to create the timer in QML and have that update the path of your Image.

    However a better fit might be to expose your "model" via a "singleton instance" (see qmlRegisterSingletonInstance). This is the more modern approach that is advised rather than using the older setContextProperty, but you will probably find more information out there about using setContextProperty. It's not massively different in principle and it might be easier for you to use the older approach in order to get started.

  • 0 Votes
    7 Posts
    693 Views
    JonBJ

    @a_coder
    As both other responders said, you need a vertical spacer above a widget if you want to push it down.

  • 0 Votes
    12 Posts
    4k Views
    S

    hey that is really helpful but
    i want to ask can some one guide me building Quazip and Zlib by Qt creator in build Cmake
    i don't want to download separate Cmake and perform all these commands in it
    i tried to do this and i guess i was partially succesfull

    i got this Msg in my application output while running Zlib
    zlib version 1.3.1 = 0x1310, compile flags = 0x65
    uncompress(): hello, hello!
    gzread(): hello, hello!
    gzgets() after gzseek: hello!
    inflate(): hello, hello!
    large_inflate(): OK
    after inflateSync(): hello, hello!
    inflate with dictionary: hello, hello!

    and i found these files in my build folder = libzlib.dll
    libzlib.dll.a
    and other files
    but when i tried to build Quazip it did not gone as planed i got so many errors
    so can someone pls give its answer too i really appreciate that.

  • 0 Votes
    13 Posts
    2k Views
    A

    Hey @eternal_void , I just got back to using Qt for another project. This is new account (I was @talksik), but here are my findings in a similar post after a ton of research and coming up with a custom solution not really mentioned anywhere: https://forum.qt.io/post/821291

  • 0 Votes
    2 Posts
    1k Views
    K

    You have to re-compile Qt specifically for the simulator via -DQT_UIKIT_SDK=iphonesimulator. Possibly forcing different architecture via -DCMAKE_OSX_ARCHITECTURES=arm64.

  • 0 Votes
    4 Posts
    8k Views
    J

    In C++, you can use the std::ifstream::fail() function to check if there was a failure during file operations. However, to get more detailed error messages, you can use the std::ifstream::rdstate() function in combination with std::strerror() or std::perror().

    Here's an updated version of your code with more detailed error messages:

    #include <iostream> #include <fstream> #include <cstring> void open_file(std::ifstream& ifstream, const std::string& file_name) { ifstream.open(file_name); if (ifstream.fail()) { // Get the error code std::ios_base::iostate state = ifstream.rdstate(); // Check for specific error bits if (state & std::ios_base::eofbit) { std::cout << "End of file reached." << std::endl; } if (state & std::ios_base::failbit) { std::cout << "Non-fatal I/O error occurred." << std::endl; } if (state & std::ios_base::badbit) { std::cout << "Fatal I/O error occurred." << std::endl; } // Print system error message std::perror("Error: "); return; } std::cout << "File was opened successfully!" << std::endl; }

    In this code, we use std::ios_base::iostate to retrieve the error state of the ifstream object. Then, we check specific error bits like std::ios_base::eofbit, std::ios_base::failbit, and std::ios_base::badbit to provide more detailed information about the failure.

    The std::perror() function is used to print the system error message corresponding to the error code. This will give you additional information about what went wrong.

    Remember to include the necessary headers for this code to work:

    #include <iostream> #include <fstream> #include <cstring>
  • Qml application closing issue

    Unsolved QML and Qt Quick
    3
    0 Votes
    3 Posts
    504 Views
    dheerendraD

    As suggested by @JKSH Simple sample code to handled the same

    Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle{ anchors.fill : parent color: "blue" radius : test.val1 } onClosing : { console.log("Window is closed") } }
  • 0 Votes
    3 Posts
    348 Views
    SGaistS

    Hi and welcome to devnet,

    To your last question, yes you should move to CMake. There have been new features added in Qt 6 that will likely be of use for your project but that are only available through cmake.

    As for examples... maybe check some of the KDE's core projects. They already use CMake and some mix QML and C++.

  • 0 Votes
    11 Posts
    1k Views
    O

    @SGaist

    Awesome. Thank you a lot, appreciate the help. I will definitely be looking into this, and if I have any other questions I'll reach out, cheers!

  • 0 Votes
    12 Posts
    4k Views
    J

    @jsulm I used to believe that the only way to create a C++ GUI was through Qt Design Studio, as I had never created anything in C++ other than console programs. I've created a GUI in Python in the past with it. However, I stumbled upon examples in Qt Creator that use .ui files. I'm familiar with this approach, having worked with UI and widgets before. I believe I'll continue using widgets since they don't show any errors when the program is executed.
    I will close this conversation as I no longer require assistance with qml. If I encounter any further issues, I'll post on a forum if I'm unable to resolve them myself. Thank you to everyone who tried to help me.

  • 0 Votes
    7 Posts
    3k Views
    kkoehneK

    @Norzka said in Problems with building qt from source (it doesn't generate lib files):

    D:\Libraries\Qt\6.6.0\Build\plugins\styles\qwindowsvistastyle.lib

    Hang on, why do you expect a .lib file for a plugin, that is supposed not to be linked to (it is loaded at runtime)? There should be a .dll, but not a .lib file.

    Do you (try to) explicitly link against the plugin nevertheless, in your project file? Or do you somehow try a static build (which would require Qt to be built statically, too)?

  • 0 Votes
    14 Posts
    2k Views
    LudoFRL

    @JonB

    Well not against offering you a beer, or two...(or more :-))

    @JonB said in undefined reference - Help first time external header library QT C++ [Linux]:

    At this point have you considered dropping this third-party Borland stuff completely and using Qt's QTcpSocket to do whatever you want from TCP instead? But I'm not offering to change your own source code over from using Borland TCP to Qt's ;-)

    This APi is used for GPIO manipulation from an ethernet GPIO modules :
    787d599f-c9e0-4a81-b147-61a7492b4eee-image.png

    What you say seems really true, cause the documentation about the use with Visual studio c++ do not refer at any moment about any library, only cpp/h files. I will try to use this documentation and use into my *.pro file only the files used into Visual Studio.

    https://www.deditec.de/media/pdf/manual_e_delib.pdf#page=26&zoom=auto,-329,815

    I will made you a feedback of course

  • 0 Votes
    3 Posts
    2k Views
    N

    It looks like it's statically building. When I go into the directory, inside the bin folder there is no dlls, when I do the lib /list some.lib, it shows how .obj files instead of .dll files. Weirdly enough, when I statically compile with the dynamic dll version of QT, it compiles fine, although it still requires the dlls.

  • 0 Votes
    3 Posts
    387 Views
    ScleaverZer0neS

    @jsulm I just thought of that a moment ago and came here to edit the post and read your answer lol. Thanks tho!

  • 0 Votes
    4 Posts
    1k Views
    jsulmJ

    @MEsc said in Error including tesseract Windows 10:

    ./configure -> does not work

    Yes, because you're on Windows.
    Maybe https://tesseract-ocr.github.io/tessdoc/Compiling.html#windows can help.

  • 2 Votes
    3 Posts
    614 Views
    A

    UPDATE: This is a known bug in Qt https://bugreports.qt.io/browse/QTBUG-113616