Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qvector
    Log in to post

    • UNSOLVED Qt6Core Assert fail on array copy...
      General and Desktop • qvector qsharedpointer • • Dariusz  

      5
      0
      Votes
      5
      Posts
      78
      Views

      Provide a minimal, compilable example where it crashes - everything else is just guessing.
    • UNSOLVED How to create a multi-dimensional QVector variable in header file with correct size?
      General and Desktop • qvector qvector3d • • CJha  

      13
      0
      Votes
      13
      Posts
      613
      Views

      @J-Hilk Thanks, yes I could do that as well.
    • UNSOLVED How to write entire QVector to a binary file?
      General and Desktop • qvector qdatastream binary format • • CJha  

      46
      0
      Votes
      46
      Posts
      2121
      Views

      @CJha said in How to write entire QVector to a binary file?: If it's a copy then I assume it is always going to be the data No, because Qt containers use copy-on-write. See https://doc.qt.io/qt-5/implicit-sharing.html
    • UNSOLVED How to dynamically store address of a QVector in another QVector?
      General and Desktop • qvector pointers • • CJha  

      9
      0
      Votes
      9
      Posts
      200
      Views

      @Christian-Ehrlicher Thanks! That saves a lot of trouble for me :)
    • UNSOLVED QPainter drawRects without draging a line behind
      Game Development • qt5 qpainter qvector game qrectf • • Mquaza  

      2
      0
      Votes
      2
      Posts
      224
      Views

      @Mquaza said in QPainter drawRects without draging a line behind: How do you make it so, that 2 rectangles are moving across the scene? I would say change their coordinates?
    • UNSOLVED Access QVector<type> from QML
      QML and Qt Quick • qvector qml qtquick • • romain.donze  

      3
      0
      Votes
      3
      Posts
      337
      Views

      @raven-worx Thank you for this answer. In fact I already found this example but wouldn't this be a problem if my Person class is in a vector?
    • SOLVED How author is saving the RAM in HugeMap?
      General and Desktop • c++ qt creator qvector qmap ram • • Yash001  

      3
      0
      Votes
      3
      Posts
      187
      Views

      @SGaist Thank you.
    • SOLVED What should I do to solve this error in Qvector?
      General and Desktop • qvector qcoreapplicatio qt5.12.3 • • Yash001  

      22
      0
      Votes
      22
      Posts
      1314
      Views

      @JonB said in What should I do to solve this error in Qvector?: if you are saying that a properly-compiled 64-bit now bombs out in the same way as 32-bit at what we think is only half a gig of so of memory on a machine with plenty of free RAM, earlier I was doing mistake while creating 64 bit application version. I am using visual studio while creating 64 bit application I was just copied all setting of 32 bit application, So That in Solution platform it was showing x64 but it was creating 32 bit executable file. I created 64 bit application version, which is save very large amount of data in RAM.
    • SOLVED which container (Qvector or QList) is good to use for insert, delete, and access the last element.
      General and Desktop • c++ qlist qvector datastructures • • Yash001  

      5
      0
      Votes
      5
      Posts
      233
      Views

      @Yash001 said in which container (Qvector or QList) is good to use for insert, delete, and access the last element.: I am adding data point at last position of container, and only accessing the last element of container. So which is better container? It's what we call Last In First Out ( LIFO) queue. So QStack seems an obvious candidate. QStack inherits from QVector.
    • SOLVED Nested QVector problem
      General and Desktop • qvector nest • • pauledd  

      9
      0
      Votes
      9
      Posts
      264
      Views

      @mrjj good catch ^^
    • SOLVED Segmentation fault while saving data into QVector
      General and Desktop • qvector beaglebone segmentation qt5.13 • • Ketank16  

      5
      0
      Votes
      5
      Posts
      475
      Views

      @mrjj Thank you for your tip. Its great help for a QT and C++ beginner. I'll try to implement the logic you mentioned.
    • SOLVED QVector assignment operator ?
      General and Desktop • qvector • • Dariusz  

      10
      0
      Votes
      10
      Posts
      790
      Views

      @SGaist does the same as copy at the end. I did not trust vec=vec. So I ended up doing it "Manually". Will try to go back to native c++ calls/overload/ once I know I dont have other bugs influencing the source...
    • UNSOLVED Qaudiooutput Double values
      General and Desktop • qbytearray qvector qaudiooutput qbuffer • • Sareban  

      1
      0
      Votes
      1
      Posts
      192
      Views

      No one has replied

    • SOLVED QVector Assert Debug - "asize >= 0 && asize <= aalloc"
      General and Desktop • debug qvector assert allocation • • Secant  

      7
      0
      Votes
      7
      Posts
      1961
      Views

      @kshegunov @mrjj Thanks for your explanation. Finally I figured out that the problem lay in the signal QGraphicsScene::changed I used. I learned about this signal in an OpenGL example in Qt. By using it I was trying to update my wave soon after its last update, however this signal could also be triggered by changing axis range or window resize, which would probably cause the crash for I didn't consider thread safety and synchronization under this condition. So I defined a custom signal function and now the problem is solved.
    • UNSOLVED Returning C++ references from more programming interfaces?
      General and Desktop • qvector qstandarditem api software design references • • elfring  

      27
      0
      Votes
      27
      Posts
      3012
      Views

      @elfring said in Returning C++ references from more programming interfaces?: For example, why should Qt provide extensions that break encapsulation and increase the risk of errors? I suggest to use algorithms which can work together with container classes at more source code places. You did not address any of the concerns. You only added suggestions. That is not acceptable. You must only submit ideas/proposals that don't break encapsulation.
    • SOLVED Unsorted QVector
      General and Desktop • qvector sorting • • sayan275  

      11
      0
      Votes
      11
      Posts
      2471
      Views

      I got it done by the below code QFileInfoList filelistinfo = dir.entryInfoList(); for(const QFileInfo &fileinfo: filelistinfo) imagePath.push_back(fileinfo.absoluteFilePath()); std::sort(imagePath.begin(), imagePath.end(), [](const QString & a, const QString & b) -> bool { return QFileInfo(a).baseName().toInt() < QFileInfo(b).baseName().toInt(); }); qDebug()<<imagePath;
    • SOLVED QVector::append() and copy-constructor
      General and Desktop • qvector copy-constructo • • dream_captain  

      8
      0
      Votes
      8
      Posts
      5887
      Views

      Related issue: https://bugreports.qt.io/browse/QTBUG-49250
    • UNSOLVED QDatastream should read a QVector from File.
      General and Desktop • qvector qdatastream load • • KonradMD  

      5
      0
      Votes
      5
      Posts
      2360
      Views

      Thanks @karlheinzreichel Originaly I have data called Sample, to save it I save it as a QVector<double> const Value. for(int iSamples=0;iSamples<_pSampleProcessing->getRawDataVector().size();iSamples++) { xDataVector.append(_pSampleProcessing->getRawDataVector().at(iSamples).getX()); yDataVector.append(_pSampleProcessing->getRawDataVector().at(iSamples).getY()); } I dont think so, because If it would be overloaded I might get an error, because I tried it to save it as a Sample before. So saving as a double seems possible.
    • SOLVED Populate a QTableWidget with QTreeViews
      General and Desktop • qtablewidget qtreeview qvector setcellwidget • • Patou355  

      13
      0
      Votes
      13
      Posts
      2920
      Views

      Hello guys. Thanks for your answerS. The "error" was simple, stupid. In fact the _manageOrderedTable is an instance of a class called ManageOrderedTable which inherits from QTableWidget. In this class, there's a method called fillAll and I called setColumnCount() from there. Bad idea. When I call this method from upon the for loop, everything is fine. I don't understand why. I could understand if setColumnCount() were called too late, but in this case I should have a segfault, trying to call a cell that doesn't exist. Well, I don't really understand why but now it works... Tank you for your help, Patrick.
    • UNSOLVED Convert QByteArray to QVector<qreal>
      General and Desktop • qbytearray qvector convert qreal • • Moldy  

      2
      0
      Votes
      2
      Posts
      4016
      Views

      that is wrong way of doing it try this: QByteArray bytesArray QDataStream out(&bytesArray ,QIODevice::WriteOnly); out << someVector; //saves it //////////////////////////////////////////////////////////////////// QDataStream in(bytesArray); QVector<qreal> otherVector; in >> otherVector; //load Please note that qreal is only 99.9% safe when saving to stream and sending it around to programs built with other versions of Qt. use QVector<double> instead
    • QWebChannel.JS and QVector
      QtWebEngine • qvector qwebengine qwebchannel qwebchannel.js • • cr0_  

      1
      0
      Votes
      1
      Posts
      789
      Views

      No one has replied

    • SOLVED QVector remove behaviour
      General and Desktop • qvector remove • • QT-static-prgm  

      3
      1
      Votes
      3
      Posts
      4137
      Views

      Hi When you insert pointers in Qvector, all it ever will delete is the pointer as it would be unsafe for it to delete the object pointed too as it is outside the vector. If you declare it as not pointer QVector<SellInfo> Then the SellInfo struct lives in the vector and will be deleted when QVec is. Deleting a SellInfo would never delete "box" as it will not call box destructor. (its a pointer) A good rule is that you bring into the world with new, should be removed with delete. But in Qt, many of the Wigets takes ownership of childs and you do not need to call delete on them.
    • Getting error when trying to access 2D QVector's elements.
      General and Desktop • error qvector • • borasemiz  

      3
      0
      Votes
      3
      Posts
      1025
      Views

      @SGaist Thank you :) This solved my problem.
    • Index out of range with QVector
      General and Desktop • qvector • • ealione  

      1
      0
      Votes
      1
      Posts
      583
      Views

      No one has replied

    • QGraphicsItem::collidingItems([...]) and QGraphicsScene::collidingItems([...])
      General and Desktop • qgraphicsscene qgraphicsitem qvector • • nicolas565  

      3
      0
      Votes
      3
      Posts
      1679
      Views

      Thanks. Fixed. How just got rid of that damn pointer.
    • QGraphicsItem::collidingItems([...]) and QGraphicsScene::collidingItems([...])causes runtime error.
      Game Development • qgraphicsscene qgraphicsitem qvector • • nicolas565  

      4
      0
      Votes
      4
      Posts
      2293
      Views

      Ok fixed.
    • SOLVED How to insert unique values from QFile into QMap?
      General and Desktop • qfile qvector qmap qpair • • WDR_937  

      7
      0
      Votes
      7
      Posts
      3631
      Views

      @Wieland OK... So, you're replacing all the next lines in the string list to spaces and then splitting the strings by spaces. That's pretty neat. Thank you very much. This solution works perfectly for me. I upvoted all your answers. Thank you, Wieland.