diff options
author | Olivier Goffart <[email protected]> | 2010-08-16 19:33:48 +0200 |
---|---|---|
committer | Olivier Goffart <[email protected]> | 2010-08-16 19:33:48 +0200 |
commit | c691e5765800390a7476f3b769d7b686d73f303f (patch) | |
tree | 4f7c075b13d86e4e683afcdf52f5e878e9894085 /src/tools/qml | |
parent | 392f86786d09a6320ac7d9905f201fd297914449 (diff) |
qmlobserver: hide the toolbar and the crumble path with the -frameless
Diffstat (limited to 'src/tools/qml')
-rw-r--r-- | src/tools/qml/qmlobserver/qmlruntime.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/tools/qml/qmlobserver/qmlruntime.cpp b/src/tools/qml/qmlobserver/qmlruntime.cpp index 1353935f978..e37d9881e5f 100644 --- a/src/tools/qml/qmlobserver/qmlruntime.cpp +++ b/src/tools/qml/qmlobserver/qmlruntime.cpp @@ -587,24 +587,28 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) } canvas = new QmlViewer::QDeclarativeDesignView(this); - addToolBar(Qt::TopToolBarArea, canvas->toolbar()); - canvas->toolbar()->setFloatable(false); - canvas->toolbar()->setMovable(false); + if (!(flags & Qt::FramelessWindowHint)) { + addToolBar(Qt::TopToolBarArea, canvas->toolbar()); + canvas->toolbar()->setFloatable(false); + canvas->toolbar()->setMovable(false); + m_crumblePathWidget = new Utils::CrumblePath(this); +#ifndef Q_WS_MAC + QFile file(":/toolbarstyle.css"); + file.open(QFile::ReadOnly); + QString toolbarStylesheet = QLatin1String(file.readAll()); + canvas->toolbar()->setStyleSheet(toolbarStylesheet); + m_crumblePathWidget->setStyleSheet("QWidget { border-bottom: 1px solid black; }"); +#endif + } + - m_crumblePathWidget = new Utils::CrumblePath(this); m_centralWidget = new QWidget(this); QVBoxLayout *layout = new QVBoxLayout(m_centralWidget); layout->setMargin(0); layout->setSpacing(0); - layout->addWidget(m_crumblePathWidget); + if (m_crumblePathWidget) + layout->addWidget(m_crumblePathWidget); -#ifndef Q_WS_MAC - QFile file(":/toolbarstyle.css"); - file.open(QFile::ReadOnly); - QString toolbarStylesheet = QLatin1String(file.readAll()); - canvas->toolbar()->setStyleSheet(toolbarStylesheet); - m_crumblePathWidget->setStyleSheet("QWidget { border-bottom: 1px solid black; }"); -#endif layout->addWidget(canvas); m_centralWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -617,11 +621,13 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) QObject::connect(canvas, SIGNAL(reloadRequested()), this, SLOT(reload())); QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize))); QObject::connect(canvas, SIGNAL(statusChanged(QDeclarativeView::Status)), this, SLOT(statusChanged())); - QObject::connect(canvas, SIGNAL(inspectorContextCleared()), m_crumblePathWidget, SLOT(clear())); - QObject::connect(canvas, SIGNAL(inspectorContextPushed(QString)), m_crumblePathWidget, SLOT(pushElement(QString))); - QObject::connect(canvas, SIGNAL(inspectorContextPopped()), m_crumblePathWidget, SLOT(popElement())); - QObject::connect(m_crumblePathWidget, SIGNAL(elementClicked(int)), canvas, SLOT(setInspectorContext(int))); - QObject::connect(canvas->engine(), SIGNAL(quit()), QCoreApplication::instance (), SLOT(quit())); + if (m_crumblePathWidget) { + QObject::connect(canvas, SIGNAL(inspectorContextCleared()), m_crumblePathWidget, SLOT(clear())); + QObject::connect(canvas, SIGNAL(inspectorContextPushed(QString)), m_crumblePathWidget, SLOT(pushElement(QString))); + QObject::connect(canvas, SIGNAL(inspectorContextPopped()), m_crumblePathWidget, SLOT(popElement())); + QObject::connect(m_crumblePathWidget, SIGNAL(elementClicked(int)), canvas, SLOT(setInspectorContext(int))); + QObject::connect(canvas->engine(), SIGNAL(quit()), QCoreApplication::instance (), SLOT(quit())); + } QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened())); QObject::connect(warningsWidget(), SIGNAL(closed()), this, SLOT(warningsWidgetClosed())); |