MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / createDockWidgetSubstitute

Function createDockWidgetSubstitute

src/gui/map/map_editor.cpp:195–222  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

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)

Callers 1

createTemplateWindowMethod · 0.85

Calls 2

heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected