Thanks, but setText would have different result
B << "one" << "two";
for(auto & a : B) A.append(a);
A.show();
QTextEdit A;
QStringList B;
B << "one" << "two";
for(auto & a : B) A.append(a);
A.show();
To copy to clipboard, switch view to plain text mode
will show
"one"
"two"
but A.setText will show
"two"
Besides, I would like to move the data of B into A but not copy
something similar to
std::vector<std::string> A;
std::string B("one");
A.push_back(std::move(B)); //move the resource of B into A
std::vector<std::string> A;
std::string B("one");
A.push_back(std::move(B)); //move the resource of B into A
To copy to clipboard, switch view to plain text mode
How could I move the resource to the QTextEdit?Thanks
Without rvalue reference in the old time, I would do something like this
std::list<std::string> A;
//A.push_back.... blah blah blah
std::vector<std::string> B(A.size());
//for loop
B.swap(A[i]);
std::list<std::string> A;
//A.push_back.... blah blah blah
std::vector<std::string> B(A.size());
//for loop
B.swap(A[i]);
To copy to clipboard, switch view to plain text mode
Could I apply the same way on QTextEdit?Or there are better way?Thanks
Bookmarks