* Creates a partial, resizable widget overlay over the main window. * * This widget is meant to be used as a dock widget replacement in the * mobile app. In landscape mode, the child widget is placed on the right * side, spanning the full height. In portrait mode, the child is placed * on the top, spanning the full width. */
| 193 | * on the top, spanning the full width. |
| 194 | */ |
| 195 | QSplitter* createDockWidgetSubstitute(MainWindow* window, QWidget* child) |
| 196 | { |
| 197 | auto* splitter = new QSplitter(window); |
| 198 | splitter->setChildrenCollapsible(false); |
| 199 | |
| 200 | auto* placeholder = new QWidget(); |
| 201 | |
| 202 | splitter->setAttribute(Qt::WA_NoSystemBackground, true); |
| 203 | placeholder->setAttribute(Qt::WA_NoSystemBackground, true); |
| 204 | child->setAutoFillBackground(true); |
| 205 | |
| 206 | auto geometry = window->geometry(); |
| 207 | splitter->setGeometry(geometry); |
| 208 | if (geometry.height() > geometry.width()) |
| 209 | { |
| 210 | splitter->setOrientation(Qt::Vertical); |
| 211 | splitter->addWidget(child); |
| 212 | splitter->addWidget(placeholder); |
| 213 | } |
| 214 | else |
| 215 | { |
| 216 | splitter->setOrientation(Qt::Horizontal); |
| 217 | splitter->addWidget(placeholder); |
| 218 | splitter->addWidget(child); |
| 219 | } |
| 220 | |
| 221 | return splitter; |
| 222 | } |
| 223 | |
| 224 | template<class T> |
| 225 | bool containsPathObject(const T& container) |
no test coverage detected