Skip to content
  • 0 Votes
    6 Posts
    234 Views
    I

    @Khamza It is quite hard to tell. The piece of code you pasted has several issues unfortunately, and it would very hard to say what the exact cause it without the whole thing to reproduce.

    I'll say that the most pressing problem in the code is that you are using values that are in document coordinates (which is what the rectangle that QAbstractTextDocumentLayout::blockBoundingRect returns is in) to calculate parameters for a QPainter which works in viewport coordinates. These are not the same, especially when there are scroll bars shown, and in my experience the main cause of issues around scrolling.

    That said, it wouldn't explain the text itself just disappearing when scrolling back up; I'd expect it to just be garbled. First try to comment out your paintEvent to see if text is drawn correctly at the expected positions when scrolling back and forth - perhaps something in the formats isn't right. Otherwise, please post a complete yet minimal project that reproduces the problems you see.

  • 0 Votes
    4 Posts
    77 Views
    JonBJ

    @Khamza
    You are not supposed to just call paintEvent() from somewhere else, it's designed to be called during actual painting. If you override a base paintEvent() you can (and should) indeed call the base implementation from there.

  • 0 Votes
    3 Posts
    117 Views
    M

    @Bonnie Thank you for pointing me in the right direction. I turns out the issue wasn't height, or min-height, but rather an inherited padding, that just happened to make it look like it was expanding to the full height of the QHBoxLayout.

  • 0 Votes
    19 Posts
    709 Views
    Christian EhrlicherC

    @TheoSys said in QT 6.8.0: Comparison of QDateTime is wrong:

    Then it's my fault

    No problem. Datetime with databases is not that easy as it seems so there might still be problems in the drivers even though I spent a lot of time with this 🙂

  • 0 Votes
    8 Posts
    378 Views
    JonBJ

    @SergeyK12
    Are you aware that in a QStandardItemModel you can create a parent-child hierarchy? E.g. start from https://doc.qt.io/qt-6/qstandarditemmodel.html#details and QStandardItemModel::insertRow(int row, const QModelIndex &parent = QModelIndex()) etc.

    So why don't you store your model like that if it's hierarchical?

    Unless you mean you start with a QStandardItemModel which is flat and multi-column like the first one, for whatever reason, and want to display that in the second way. For that yes a proxy like yours would be good.

  • 0 Votes
    4 Posts
    557 Views
    aha_1980A

    The second failure ninja: build stopped: subcommand failed. is a direct successor of the first error.

    Fix the first error, and the second will disappear.

    the file does exist and is in the include directory

    Can you tell us the path to this directory?

    According to the compiler command line, your compiler searches in the following directories:

    -I/Users/jamesmartin/sourceCode/C++/qt/QTCurvesCPP2/build/Desktop_arm_darwin_generic_mach_o_64bit-Debug/QTCurvesCPP2_autogen/include -isystem /Applications/qt/6.7.2/macos/lib/QtCore.framework/Headers -iframework /Applications/qt/6.7.2/macos/lib -isystem /Applications/qt/6.7.2/macos/mkspecs/macx-clang -isystem /Applications/qt/6.7.2/macos/include -isystem /Applications/qt/6.7.2/macos/lib/QtWidgets.framework/Headers -isystem /Applications/qt/6.7.2/macos/lib/QtGui.framework/Headers

    which seems a bit strange to me as it does not have any source directory in the list.

    Can you show your CMakeLists.txt?

  • 0 Votes
    14 Posts
    628 Views
    JonBJ

    @jeremy_k said in Console App how to populate a 10.000*10.000 Grid efficiently?:

    A easy optimization for setting a quadrant or an entire 2d space as a single color is to remove all subtrees of that tree,

    Absolutely. If that's the sort of thing you want to do. Doesn't seem to relate to toggling the state of 100,000 adjacent bits in 5 million.

    it stores all squares that shall be changed in a vector.
    The squares changed can be anywhere in this big map,
    eventually reaching many millions of squares needed to be changed at onces.

    If that is what you need to do, again I'm not sure I see any use of these quadtrees. But only you need the exact situation.

  • MT4 Manager API on QT

    Unsolved General and Desktop
    5
    0 Votes
    5 Posts
    256 Views
    B

    Hi.

    Thank you for the explanation.

    @Pl45m4 said in MT4 Manager API on QT:

    Since the MT4 API is probably incompatible with QTcpSocket by default and you probably need to use the Manager's connect function to make everything that is going on in the background work properly, I don't see why you need to use the Qt socket classes, assuming this MT4 Manager has its own internal socket stuff?!
    I could be wrong, though.

    Yes this is correct. The only thing is that, when i use the MT4 Manager to connect to the server, it always returns "no connection" error, which means, the MT4 Manager can't establish connection to the server, of which the server is online and i have run the C++ program with the same server credentials.

  • 0 Votes
    16 Posts
    1k Views
    M

    Hi @dheerendra

    I think the issue was in NO_PLUGIN as were suggested by @Anumas here:
    https://forum.qt.io/post/802964

    Seems to be working fine with static library now. I marked that message as a solution.

  • 0 Votes
    3 Posts
    234 Views
    Axel SpoerlA

    …and on a side note: Qt 5.15 isn’t ideal to start developing a new app! Much better to start with 6.5!

  • 0 Votes
    1 Posts
    264 Views
    No one has replied
  • 0 Votes
    13 Posts
    890 Views
    B

    @hskoglund Yes. I also have MinGW installed separately on my computer so I could try quickly making another kit with those and see if it works.

    Edit: Changing the version of MinGW in the kit worked! I tried using regular MinGW 64-bit and that made it work perfectly. Thanks so much

  • 0 Votes
    11 Posts
    594 Views
    jsulmJ

    @Kirill-Gusarev See @SimonSchroeder explanation and also read https://doc.qt.io/qt-6/threads-qobject.html

  • 0 Votes
    2 Posts
    244 Views
    JonBJ

    @Broder
    Show where you have added a path something like /usr/include/x86_64-linux-gnu/qt6 (not just /usr/include) to your include paths for cmake.

  • 0 Votes
    5 Posts
    1k 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
    260 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
    560 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
    3k 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
    12 Posts
    1k Views
    E

    @talksik Have you found an elegant way around this? I'm struggling to find a pretty way of sharing single data source object among multiple models in QML.

    This object communicates with QSerialPort so I guess it can't be anything but a singleton. Currently I'm using qmlRegisterSingletonInstance for all of my models which I create in main.cpp passing the data source object pointer to their constructors. It looks sort of messy if you ask me.

    So, any ideas? Thank you!