Water ... that adapts itself to the flow, that breaks everything like a sword
Little Big Adventure: Preview 6
Get link
Facebook
X
Pinterest
Email
Other Apps
-
Tym razem wyszła trochę dłuższa prezentacja ale wydaje mi się, że nie powinno wam się nudzić oglądając ja :] więc nie będę już przeciągać oto pokaz nr. 6 :
So like always start with problem description: I have some pool of command represented as enumerator. Each of command can have unique data that size can be different. I wanted to create system that allow me in easy way iterate over them and execute. After some time I created this implementation: template<ECommands::enum cmd> bool execCommandTemp(ECommands::ENUM a_cmd, void* a_data) { if (a_cmd == cmd) { SCommand<cmd>::execute((SCommand ::SData*)a_data); return false; } return execCommandTemp<(ECommands::ENUM)(cmd+1)>(a_cmd, a_data); } template<> bool execCommandTemp<ECommands::WRAP>(ECommands::ENUM a_cmd, void* a_data) { return true; } bool execCommand( ECommands::ENUM a_cmd, void* a_data ) { return execCommandTemp<(ECommands::ENUM)0>(a_cmd, a_data); } where SCommand look in example such a way: template <> st...
Another very specific issue that I encountered while working on tooling for White Rabbit Engine. This one cost me three evenings to figure out :( For a while in the tooling, we are using a multi-process approach: Hub (Qt application) <-> Client (Qt application) Hub is the main process using QT. Inside it, we have QMainWindow to which we embed the client window. The code to do that is very simple: auto clientWindow = QWindow::fromWinId(clientWindowsId); auto widget = QWidget::createWindowContainer( clientWindow , this); setCenterWidget(widget); You can find this example almost everywhere. The problem I encountered was that my client window had keyboard input only once when a window was created. If I lost focus nothing related to the keyboard worked. Neither shortcuts, neither textboxes, nothing. While investigating I noticed that QWidget::createWindowContainer internally created QWindowContainer that never received QEvent::FocusIn which I assumed was a prob...
Comments
Post a Comment