kdablabs / kdtoolbox Goto Github PK
View Code? Open in Web Editor NEWKDAB's collection of miscellaneous useful C++ classes and stuff
License: Other
KDAB's collection of miscellaneous useful C++ classes and stuff
License: Other
source data changes, in particular for roles other than the sort role, are not forwarded (SortProxyModel::handleDataChanged), thus having a SortProxyModel in the stack makes you "lose" updates.
In a customer project using SPM, I just implemented it using linear search to do the mapping:
int minRow = std::numeric_limits<int>::max();
int maxRow = -1;
for (int sourceRow = topLeft.row(); sourceRow <= bottomRight.row(); ++sourceRow) {
auto it = std::find(m_rowMap.cbegin(), m_rowMap.cend(), sourceRow);
Q_ASSERT(it != m_rowMap.cend());
const auto proxyRow = static_cast<int>(std::distance(m_rowMap.cbegin(), it));
minRow = std::min(minRow, proxyRow);
maxRow = std::max(maxRow, proxyRow);
}
Q_ASSERT(minRow <= maxRow);
emit dataChanged(index(minRow, 0), index(maxRow, 0), roles);
That does the job for my use case, but generic solution probably should use something more efficient.
DepthFirstIterator
copy constructor is not copying value of m_atEnd
. That probably is not intentional, right? It leads to incorrect behavior (e.g. omitting the very last node when iterating) if using copied iterator.
When calling updateData with an empty targetContainer and a source container with 2 or more elements, the resulting targetContainer only ends up with 1 element.
While using rowMoved for data changes is cool, using it for completely reordering may be a bit much. So, we should be able to disable that.
If the source model of SortProxyModel starts out empty, inserts don't get inserted into the rowMap. This is because sortproxymodel.cpp line 355 checks if the curIt is the end iterator of m_rowMap, but that is always the case if the list is empty.
Start example TabWindow. Take Tab1 to separate window. Take Tab2 and move it to the Tab1 to attach. App crashes
The 2 last insertRange_imp function alternatives need a default constructible type to be selected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.