Thoughts and tips for a daily coding life

2012/07/27

Aligning widgets in layouts using Designer

July 27, 2012 Posted by Antanas Domarkas No comments
If you want to align widgets inside, for example, QHBoxLayout or QVBoxLayout using Qt Creator designer, just right click on particular widget and choose Layout Alignment

2012/07/22

2012/01/28

Removing unique chars from string in C++

January 28, 2012 Posted by Antanas Domarkas , , No comments
Needed to remove some duplicate char sequences from string and couldn't remember usage for unique function.
Basically got stuck with usage syntax =)

After half an hour of reading and searching got this:

std::string code = "some code wiiiiith dubbbblicate chaaaars";
code.erase(std::unique(code.begin(), code.end()), code.end());

Hope this will help other doomed soul.