WSortFilterProxyModel and std::regex
Added by Mark Travis over 1 year ago
Just pointing out something confusing and I'm not sure if it's supposed to work like the example or if the example is wrong.
So, in the example, there is a line that says:
proxy->setFilterRegExp("Wt::.*");
However, when I implemented it, I had to do the following:
std::unique_ptr<std::regex> test = std::make_unique<std::regex>("Wt::.*");
proxyModel->setFilterRegExp(std::move(test));
Is the example wrong? Or is there a bug in the implementation that won't let you code the pattern directly?
I plan on creating an input area for the user to type in the filtering text to a WLineEdit object, then pass that to the FilterRegExp pointer.