本文整理汇总了C++中QDockWidget::raise方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::raise方法的具体用法?C++ QDockWidget::raise怎么用?C++ QDockWidget::raise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::raise方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDockWindows
void MainWindow::createDockWindows()
{
// Engine debug
QDockWidget* engineDebugDock = new QDockWidget(tr("Engine Debug"), this);
m_engineDebugLog = new PlainTextLog(engineDebugDock);
connect(m_engineDebugLog, SIGNAL(saveLogToFileRequest()), this,
SLOT(saveLogToFile()));
engineDebugDock->setWidget(m_engineDebugLog);
addDockWidget(Qt::BottomDockWidgetArea, engineDebugDock);
// Move list
QDockWidget* moveListDock = new QDockWidget(tr("Moves"), this);
moveListDock->setWidget(m_moveList);
addDockWidget(Qt::RightDockWidgetArea, moveListDock);
// Tags
QDockWidget* tagsDock = new QDockWidget(tr("Tags"), this);
QTreeView* tagsView = new QTreeView(tagsDock);
tagsView->setModel(m_tagsModel);
tagsView->setAlternatingRowColors(true);
tagsView->setRootIsDecorated(false);
tagsDock->setWidget(tagsView);
addDockWidget(Qt::RightDockWidgetArea, tagsDock);
tabifyDockWidget(moveListDock, tagsDock);
moveListDock->raise();
// Add toggle view actions to the View menu
m_viewMenu->addAction(moveListDock->toggleViewAction());
m_viewMenu->addAction(tagsDock->toggleViewAction());
m_viewMenu->addAction(engineDebugDock->toggleViewAction());
}
示例2: onDockActionTriggered
void FancyMainWindow::onDockActionTriggered()
{
QDockWidget *dw = qobject_cast<QDockWidget *>(sender()->parent());
if (dw) {
if (dw->isVisible())
dw->raise();
}
}
示例3: showDialog
void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg)
{
// only one dialog at a time
assert(!ActiveDialog || ActiveDialog==dlg);
Gui::DockWnd::CombiView* pcCombiView = qobject_cast<Gui::DockWnd::CombiView*>
(Gui::DockWindowManager::instance()->getDockWindow("Combo View"));
// should return the pointer to combo view
if (pcCombiView) {
pcCombiView->showDialog(dlg);
// make sure that the combo view is shown
QDockWidget* dw = qobject_cast<QDockWidget*>(pcCombiView->parentWidget());
if (dw) {
dw->setVisible(true);
dw->toggleViewAction()->setVisible(true);
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
}
if (ActiveDialog == dlg)
return; // dialog is already defined
ActiveDialog = dlg;
connect(dlg, SIGNAL(destroyed()), this, SLOT(closedDialog()));
}
// not all workbenches have the combo view enabled
else if (!_taskPanel) {
QDockWidget* dw = new QDockWidget();
dw->setWindowTitle(tr("Task panel"));
dw->setFeatures(QDockWidget::DockWidgetMovable);
_taskPanel = new Gui::TaskView::TaskView(dw);
dw->setWidget(_taskPanel);
_taskPanel->showDialog(dlg);
getMainWindow()->addDockWidget(Qt::LeftDockWidgetArea, dw);
connect(dlg, SIGNAL(destroyed()), dw, SLOT(deleteLater()));
// if we have the normal tree view available then just tabify with it
QWidget* treeView = Gui::DockWindowManager::instance()->getDockWindow("Tree view");
QDockWidget* par = treeView ? qobject_cast<QDockWidget*>(treeView->parent()) : 0;
if (par && par->isVisible()) {
getMainWindow()->tabifyDockWidget(par, dw);
qApp->processEvents(); // make sure that the task panel is tabified now
dw->show();
dw->raise();
}
}
}
示例4: appIcon
//.........这里部分代码省略.........
QByteArray iconArray = helpEngineWrapper.applicationIcon();
if (iconArray.size() > 0) {
QPixmap pix;
pix.loadFromData(iconArray);
QIcon appIcon(pix);
qApp->setWindowIcon(appIcon);
} else {
QIcon appIcon(QLatin1String(":/trolltech/assistant/images/assistant-128.png"));
qApp->setWindowIcon(appIcon);
}
QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar"));
toolBar->setObjectName(QLatin1String("Bookmark Toolbar"));
bookMarkManager->setBookmarksToolbar(toolBar);
// Show the widget here, otherwise the restore geometry and state won't work
// on x11.
show();
toolBar->hide();
toolBarMenu()->addAction(toolBar->toggleViewAction());
QByteArray ba(helpEngineWrapper.mainWindow());
if (!ba.isEmpty())
restoreState(ba);
ba = helpEngineWrapper.mainWindowGeometry();
if (!ba.isEmpty()) {
restoreGeometry(ba);
} else {
tabifyDockWidget(contentDock, indexDock);
tabifyDockWidget(indexDock, bookmarkDock);
tabifyDockWidget(bookmarkDock, searchDock);
contentDock->raise();
const QRect screen = QApplication::desktop()->screenGeometry();
resize(4*screen.width()/5, 4*screen.height()/5);
}
if (!helpEngineWrapper.hasFontSettings()) {
helpEngineWrapper.setUseAppFont(false);
helpEngineWrapper.setUseBrowserFont(false);
helpEngineWrapper.setAppFont(qApp->font());
helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin);
helpEngineWrapper.setBrowserFont(qApp->font());
helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin);
} else {
updateApplicationFont();
}
updateAboutMenuText();
QTimer::singleShot(0, this, SLOT(insertLastPages()));
if (m_cmdLine->enableRemoteControl())
(void)new RemoteControl(this);
if (m_cmdLine->contents() == CmdLineParser::Show)
showContents();
else if (m_cmdLine->contents() == CmdLineParser::Hide)
hideContents();
if (m_cmdLine->index() == CmdLineParser::Show)
showIndex();
else if (m_cmdLine->index() == CmdLineParser::Hide)
hideIndex();
if (m_cmdLine->bookmarks() == CmdLineParser::Show)
示例5: QMainWindow
PDFViewer::PDFViewer(const QString & pdf_doc, QWidget *parent, Qt::WindowFlags flags) :
QMainWindow(parent, flags)
{
QtPDF::PDFDocumentWidget *docWidget = new QtPDF::PDFDocumentWidget(this);
connect(this, SIGNAL(switchInterfaceLocale(QLocale)), docWidget, SLOT(switchInterfaceLocale(QLocale)));
#ifdef USE_MUPDF
docWidget->setDefaultBackend(QString::fromLatin1("mupdf"));
#elif USE_POPPLERQT
docWidget->setDefaultBackend(QString::fromLatin1("poppler-qt"));
#else
#error At least one backend is required
#endif
if (!pdf_doc.isEmpty() && docWidget)
docWidget->load(pdf_doc);
docWidget->goFirst();
_counter = new PageCounter(this->statusBar());
_zoomWdgt = new ZoomTracker(this);
_search = new SearchLineEdit(this);
_toolBar = new QToolBar(this);
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/document-open.png")), tr("Open..."), this, SLOT(open()));
_toolBar->addSeparator();
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoomin.png")), tr("Zoom In"), docWidget, SLOT(zoomIn()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoomout.png")), tr("Zoom Out"), docWidget, SLOT(zoomOut()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoom-fitwidth.png")), tr("Fit to Width"), docWidget, SLOT(zoomFitWidth()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoom-fitwindow.png")), tr("Fit to Window"), docWidget, SLOT(zoomFitWindow()));
_toolBar->addSeparator();
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/pagemode-single.png")), tr("Single Page Mode"), docWidget, SLOT(setSinglePageMode()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/pagemode-continuous.png")), tr("One Column Continuous Page Mode"), docWidget, SLOT(setOneColContPageMode()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/pagemode-twocols.png")), tr("Two Columns Continuous Page Mode"), docWidget, SLOT(setTwoColContPageMode()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/pagemode-present.png")), tr("Presentation Mode"), docWidget, SLOT(setPresentationMode()));
// TODO: fullscreen mode for presentations
_toolBar->addSeparator();
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoom.png")), tr("Magnify"), docWidget, SLOT(setMouseModeMagnifyingGlass()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/hand.png")), tr("Pan"), docWidget, SLOT(setMouseModeMove()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/zoom-select.png")), tr("Marquee Zoom"), docWidget, SLOT(setMouseModeMarqueeZoom()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/measure.png")), tr("Measure"), docWidget, SLOT(setMouseModeMeasure()));
_toolBar->addAction(QIcon(QString::fromUtf8(":/QtPDF/icons/select-text.png")), tr("Select"), docWidget, SLOT(setMouseModeSelect()));
_counter->setLastPage(docWidget->lastPage());
connect(docWidget, SIGNAL(changedPage(int)), _counter, SLOT(setCurrentPage(int)));
connect(docWidget, SIGNAL(changedZoom(qreal)), _zoomWdgt, SLOT(setZoom(qreal)));
connect(docWidget, SIGNAL(requestOpenUrl(const QUrl)), this, SLOT(openUrl(const QUrl)));
connect(docWidget, SIGNAL(requestOpenPdf(QString, QtPDF::PDFDestination, bool)), this, SLOT(openPdf(QString, QtPDF::PDFDestination, bool)));
connect(docWidget, SIGNAL(contextClick(const int, const QPointF)), this, SLOT(syncFromPdf(const int, const QPointF)));
connect(docWidget, SIGNAL(searchProgressChanged(int, int)), this, SLOT(searchProgressChanged(int, int)));
connect(docWidget, SIGNAL(changedDocument(const QWeakPointer<QtPDF::Backend::Document>)), this, SLOT(documentChanged(const QWeakPointer<QtPDF::Backend::Document>)));
_toolBar->addSeparator();
#ifdef DEBUG
// FIXME: Remove this
_toolBar->addAction(QString::fromUtf8("en"), this, SLOT(setEnglishLocale()));
_toolBar->addAction(QString::fromUtf8("de"), this, SLOT(setGermanLocale()));
_toolBar->addSeparator();
#endif
_toolBar->addWidget(_search);
connect(_search, SIGNAL(searchRequested(QString)), docWidget, SLOT(search(QString)));
connect(_search, SIGNAL(gotoNextResult()), docWidget, SLOT(nextSearchResult()));
connect(_search, SIGNAL(gotoPreviousResult()), docWidget, SLOT(previousSearchResult()));
connect(_search, SIGNAL(searchCleared()), docWidget, SLOT(clearSearchResults()));
statusBar()->addPermanentWidget(_counter);
statusBar()->addWidget(_zoomWdgt);
addToolBar(_toolBar);
setCentralWidget(docWidget);
QDockWidget * toc = docWidget->dockWidget(QtPDF::PDFDocumentView::Dock_TableOfContents, this);
addDockWidget(Qt::LeftDockWidgetArea, toc);
tabifyDockWidget(toc, docWidget->dockWidget(QtPDF::PDFDocumentView::Dock_MetaData, this));
tabifyDockWidget(toc, docWidget->dockWidget(QtPDF::PDFDocumentView::Dock_Fonts, this));
tabifyDockWidget(toc, docWidget->dockWidget(QtPDF::PDFDocumentView::Dock_Permissions, this));
tabifyDockWidget(toc, docWidget->dockWidget(QtPDF::PDFDocumentView::Dock_Annotations, this));
toc->raise();
QShortcut * goPrevViewRect = new QShortcut(QKeySequence(tr("Alt+Left")), this);
connect(goPrevViewRect, SIGNAL(activated()), docWidget, SLOT(goPrevViewRect()));
}
示例6: setupUi
//.........这里部分代码省略.........
searchTable->verticalHeader()->setVisible(false);
//searchTable->horizontalHeader()->setVisible(false);
searchTable->horizontalHeader()->setHighlightSections(false);
searchTable->horizontalHeader()->setStretchLastSection(true);
//install delagate on third column
SaagharItemDelegate *searchDelegate = new SaagharItemDelegate(searchTable, searchTable->style(), phrase);
searchTable->setItemDelegateForColumn(2, searchDelegate);
connect(this, SIGNAL(searchFiltered(const QString &)), searchDelegate, SLOT(keywordChanged(const QString &)) );
//searchTable->setItemDelegateForColumn(2, new SaagharItemDelegate(searchTable, searchTable->style(), phrase));
searchTableGridLayout->addWidget(searchTable, 0, 0, 1, 1);
// QVBoxLayout *searchNavVerticalLayout = new QVBoxLayout();
// searchNavVerticalLayout->setSpacing(6);
// searchNavVerticalLayout->setObjectName(QString::fromUtf8("searchNavVerticalLayout"));
searchNextPage = new QToolButton(searchResultContents);
searchNextPage->setObjectName(QString::fromUtf8("searchNextPage"));
searchNextPage->setStyleSheet("QToolButton { border: none; padding: 0px; }");
actSearchNextPage = new QAction(searchResultContents);
searchNextPage->setDefaultAction(actSearchNextPage);
connect(searchNextPage, SIGNAL(triggered(QAction *)), this, SLOT(searchPageNavigationClicked(QAction *)));
searchNextPage->setEnabled(false);
searchNextPage->hide();
//searchNavVerticalLayout->addWidget(searchNextPage);
searchPreviousPage = new QToolButton(searchResultContents);
searchPreviousPage->setObjectName(QString::fromUtf8("searchPreviousPage"));
searchPreviousPage->setStyleSheet("QToolButton { border: none; padding: 0px; }");
actSearchPreviousPage = new QAction(searchResultContents);
searchPreviousPage->setDefaultAction(actSearchPreviousPage);
if (qmw->layoutDirection() == Qt::LeftToRight)
{
actSearchPreviousPage->setIcon(QIcon(iconThemePath+"/previous.png"));
actSearchNextPage->setIcon(QIcon(iconThemePath+"/next.png"));
}
else
{
actSearchPreviousPage->setIcon(QIcon(iconThemePath+"/next.png"));
actSearchNextPage->setIcon(QIcon(iconThemePath+"/previous.png"));
}
connect(searchPreviousPage, SIGNAL(triggered(QAction *)), this, SLOT(searchPageNavigationClicked(QAction *)));
searchPreviousPage->setEnabled(false);
searchPreviousPage->hide();
// searchNavVerticalLayout->addWidget(searchPreviousPage);
//QSpacerItem *searchNavVerticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
//searchNavVerticalLayout->addItem(searchNavVerticalSpacer);
// if (moreThanOnePage)
// horizontalLayout->addLayout(searchNavVerticalLayout);
filterHorizontalLayout->addWidget(searchPreviousPage);
filterHorizontalLayout->addWidget(searchNextPage);
filterHorizontalLayout->addWidget(pageLabel, 0, Qt::AlignRight|Qt::AlignCenter);
searchTableGridLayout->addLayout(filterHorizontalLayout, 1, 0, 1, 1);
horizontalLayout->addLayout(searchTableGridLayout);
searchGridLayout->addLayout(horizontalLayout, 0, 0, 1, 1);
/****************************/
QDockWidget *tmpDockWidget = 0;
QObjectList mainWindowChildren = qmw->children();
for (int i=0; i < mainWindowChildren.size(); ++i)
{
tmpDockWidget = qobject_cast<QDockWidget *>(mainWindowChildren.at(i));
if (tmpDockWidget)
{
if (mainWindowChildren.at(i)->objectName() == "searchResultWidget_old")
break;
}
}
/****************************************/
searchResultWidget->setWidget(searchResultContents);
qmw->addDockWidget(Qt::LeftDockWidgetArea, searchResultWidget);
if (tmpDockWidget && tmpDockWidget->objectName() == "searchResultWidget_old") //there is another search results dock-widget present
qmw->tabifyDockWidget(tmpDockWidget, searchResultWidget);
searchResultWidget->setObjectName("searchResultWidget_old");
searchResultWidget->show();
searchResultWidget->raise();
}
示例7: visibilityChanged
void tst_QDockWidget::visibilityChanged()
{
QMainWindow mw;
QDockWidget dw;
QSignalSpy spy(&dw, SIGNAL(visibilityChanged(bool)));
mw.addDockWidget(Qt::LeftDockWidgetArea, &dw);
mw.show();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
spy.clear();
dw.hide();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
spy.clear();
dw.hide();
QCOMPARE(spy.count(), 0);
dw.show();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
spy.clear();
dw.show();
QCOMPARE(spy.count(), 0);
QDockWidget dw2;
mw.tabifyDockWidget(&dw, &dw2);
dw2.show();
dw2.raise();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
spy.clear();
dw2.hide();
qApp->processEvents();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
spy.clear();
dw2.show();
dw2.raise();
qApp->processEvents();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
spy.clear();
dw.raise();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
spy.clear();
dw.raise();
QCOMPARE(spy.count(), 0);
dw2.raise();
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), false);
spy.clear();
dw2.raise();
QCOMPARE(spy.count(), 0);
mw.addDockWidget(Qt::RightDockWidgetArea, &dw2);
QTest::qWait(200);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
}
示例8: initUserInterfaceWidgets
void VolumeViewer::initUserInterfaceWidgets()
{
// Create a toolbar at the top of the window.
QToolBar *toolbar = addToolBar("toolbar");
// Add preferences widget and callback.
PreferencesDialog *preferencesDialog = new PreferencesDialog(this, boundingBox);
QAction *showPreferencesAction = new QAction("Preferences", this);
connect(showPreferencesAction, SIGNAL(triggered()), preferencesDialog, SLOT(show()));
toolbar->addAction(showPreferencesAction);
// Add the "auto rotate" widget and callback.
autoRotateAction = new QAction("Auto rotate", this);
autoRotateAction->setCheckable(true);
connect(autoRotateAction, SIGNAL(toggled(bool)), this, SLOT(autoRotate(bool)));
toolbar->addAction(autoRotateAction);
// Add the "next timestep" widget and callback.
QAction *nextTimeStepAction = new QAction("Next timestep", this);
connect(nextTimeStepAction, SIGNAL(triggered()), this, SLOT(nextTimeStep()));
toolbar->addAction(nextTimeStepAction);
// Add the "play timesteps" widget and callback.
QAction *playTimeStepsAction = new QAction("Play timesteps", this);
playTimeStepsAction->setCheckable(true);
connect(playTimeStepsAction, SIGNAL(toggled(bool)), this, SLOT(playTimeSteps(bool)));
toolbar->addAction(playTimeStepsAction);
// Connect the "play timesteps" timer.
connect(&playTimeStepsTimer, SIGNAL(timeout()), this, SLOT(nextTimeStep()));
// Add the "add geometry" widget and callback.
QAction *addGeometryAction = new QAction("Add geometry", this);
connect(addGeometryAction, SIGNAL(triggered()), this, SLOT(addGeometry()));
toolbar->addAction(addGeometryAction);
// Add the "screenshot" widget and callback.
QAction *screenshotAction = new QAction("Screenshot", this);
connect(screenshotAction, SIGNAL(triggered()), this, SLOT(screenshot()));
toolbar->addAction(screenshotAction);
// Create the transfer function editor dock widget, this widget modifies the transfer function directly.
QDockWidget *transferFunctionEditorDockWidget = new QDockWidget("Transfer Function", this);
transferFunctionEditor = new TransferFunctionEditor(transferFunction);
transferFunctionEditorDockWidget->setWidget(transferFunctionEditor);
connect(transferFunctionEditor, SIGNAL(committed()), this, SLOT(commitVolumes()));
connect(transferFunctionEditor, SIGNAL(committed()), this, SLOT(render()));
addDockWidget(Qt::LeftDockWidgetArea, transferFunctionEditorDockWidget);
// Set the transfer function editor widget to its minimum allowed height, to leave room for other dock widgets.
transferFunctionEditor->setMaximumHeight(transferFunctionEditor->minimumSize().height());
// Create slice editor dock widget.
QDockWidget *sliceEditorDockWidget = new QDockWidget("Slices", this);
sliceEditor = new SliceEditor(boundingBox);
sliceEditorDockWidget->setWidget(sliceEditor);
connect(sliceEditor, SIGNAL(slicesChanged(std::vector<SliceParameters>)), this, SLOT(setSlices(std::vector<SliceParameters>)));
addDockWidget(Qt::LeftDockWidgetArea, sliceEditorDockWidget);
// Create isosurface editor dock widget.
QDockWidget *isosurfaceEditorDockWidget = new QDockWidget("Isosurfaces", this);
isosurfaceEditor = new IsosurfaceEditor();
isosurfaceEditorDockWidget->setWidget(isosurfaceEditor);
connect(isosurfaceEditor, SIGNAL(isovaluesChanged(std::vector<float>)), this, SLOT(setIsovalues(std::vector<float>)));
addDockWidget(Qt::LeftDockWidgetArea, isosurfaceEditorDockWidget);
// Create the light editor dock widget, this widget modifies the light directly.
QDockWidget *lightEditorDockWidget = new QDockWidget("Lights", this);
LightEditor *lightEditor = new LightEditor(ambientLight, directionalLight);
lightEditorDockWidget->setWidget(lightEditor);
connect(lightEditor, SIGNAL(lightsChanged()), this, SLOT(render()));
addDockWidget(Qt::LeftDockWidgetArea, lightEditorDockWidget);
// Create the probe dock widget.
QDockWidget *probeDockWidget = new QDockWidget("Probe", this);
probeWidget = new ProbeWidget(this);
probeDockWidget->setWidget(probeWidget);
addDockWidget(Qt::LeftDockWidgetArea, probeDockWidget);
// Tabify dock widgets.
tabifyDockWidget(transferFunctionEditorDockWidget, sliceEditorDockWidget);
tabifyDockWidget(transferFunctionEditorDockWidget, isosurfaceEditorDockWidget);
tabifyDockWidget(transferFunctionEditorDockWidget, lightEditorDockWidget);
tabifyDockWidget(transferFunctionEditorDockWidget, probeDockWidget);
// Tabs on top.
setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
// Default to showing transfer function tab widget.
transferFunctionEditorDockWidget->raise();
// Add the current OSPRay object file label to the bottom status bar.
statusBar()->addWidget(¤tFilenameInfoLabel);
}
示例9: pixmap
//.........这里部分代码省略.........
m_pointView, SLOT(toggleDrawCursor()));
connect(drawAxes, SIGNAL(triggered()),
m_pointView, SLOT(toggleDrawAxes()));
connect(drawGrid, SIGNAL(triggered()),
m_pointView, SLOT(toggleDrawGrid()));
connect(drawAnnotations, SIGNAL(triggered()),
m_pointView, SLOT(toggleDrawAnnotations()));
connect(trackballMode, SIGNAL(triggered()),
m_pointView, SLOT(toggleCameraMode()));
connect(m_geometries, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(geometryRowsInserted(QModelIndex,int,int)));
//--------------------------------------------------
// Docked widgets
// Shader parameters UI
QDockWidget* shaderParamsDock = new QDockWidget(tr("Shader Parameters"), this);
shaderParamsDock->setFeatures(QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetClosable);
QWidget* shaderParamsUI = new QWidget(shaderParamsDock);
shaderParamsDock->setWidget(shaderParamsUI);
m_pointView->setShaderParamsUIWidget(shaderParamsUI);
// Shader editor UI
QDockWidget* shaderEditorDock = new QDockWidget(tr("Shader Editor"), this);
shaderEditorDock->setFeatures(QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetFloatable);
QWidget* shaderEditorUI = new QWidget(shaderEditorDock);
m_shaderEditor = new ShaderEditor(shaderEditorUI);
QGridLayout* shaderEditorLayout = new QGridLayout(shaderEditorUI);
shaderEditorLayout->setContentsMargins(2,2,2,2);
shaderEditorLayout->addWidget(m_shaderEditor, 0, 0, 1, 1);
connect(editShaderAct, SIGNAL(triggered()), shaderEditorDock, SLOT(show()));
shaderEditorDock->setWidget(shaderEditorUI);
shaderMenu->addAction(m_shaderEditor->compileAction());
connect(m_shaderEditor->compileAction(), SIGNAL(triggered()),
this, SLOT(compileShaderFile()));
// TODO: check if this is needed - test shader update functionality
//connect(m_shaderEditor, SIGNAL(sendShader(QString)),
// &m_pointView->shaderProgram(), SLOT(setShader(QString)));
// Log viewer UI
QDockWidget* logDock = new QDockWidget(tr("Log"), this);
logDock->setFeatures(QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetClosable);
QWidget* logUI = new QWidget(logDock);
m_logTextView = new LogViewer(logUI);
m_logTextView->setReadOnly(true);
m_logTextView->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);
m_logTextView->connectLogger(&g_logger); // connect to global logger
m_progressBar = new QProgressBar(logUI);
m_progressBar->setRange(0,100);
m_progressBar->setValue(0);
m_progressBar->hide();
connect(m_fileLoader, SIGNAL(loadStepStarted(QString)),
this, SLOT(setProgressBarText(QString)));
connect(m_fileLoader, SIGNAL(loadProgress(int)),
m_progressBar, SLOT(setValue(int)));
connect(m_fileLoader, SIGNAL(resetProgress()),
m_progressBar, SLOT(hide()));
QVBoxLayout* logUILayout = new QVBoxLayout(logUI);
//logUILayout->setContentsMargins(2,2,2,2);
logUILayout->addWidget(m_logTextView);
logUILayout->addWidget(m_progressBar);
//m_logTextView->setLineWrapMode(QPlainTextEdit::NoWrap);
logDock->setWidget(logUI);
// Data set list UI
QDockWidget* dataSetDock = new QDockWidget(tr("Data Sets"), this);
dataSetDock->setFeatures(QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetFloatable);
DataSetUI* dataSetUI = new DataSetUI(this);
dataSetDock->setWidget(dataSetUI);
QAbstractItemView* dataSetOverview = dataSetUI->view();
dataSetOverview->setModel(m_geometries);
connect(dataSetOverview, SIGNAL(doubleClicked(const QModelIndex&)),
m_pointView, SLOT(centerOnGeometry(const QModelIndex&)));
m_pointView->setSelectionModel(dataSetOverview->selectionModel());
// Set up docked widgets
addDockWidget(Qt::RightDockWidgetArea, shaderParamsDock);
addDockWidget(Qt::LeftDockWidgetArea, shaderEditorDock);
addDockWidget(Qt::RightDockWidgetArea, logDock);
addDockWidget(Qt::RightDockWidgetArea, dataSetDock);
tabifyDockWidget(logDock, dataSetDock);
logDock->raise();
shaderEditorDock->setVisible(false);
// Add dock widget toggles to view menu
viewMenu->addSeparator();
viewMenu->addAction(shaderParamsDock->toggleViewAction());
viewMenu->addAction(logDock->toggleViewAction());
viewMenu->addAction(dataSetDock->toggleViewAction());
// Create custom hook events from CLI at runtime
m_hookManager = new HookManager(this);
}
示例10: ui_companion_qt_init
//.........这里部分代码省略.........
thumbnailWidget->layout()->addWidget(thumbnail);
thumbnail2Widget->layout()->addWidget(thumbnail2);
thumbnail3Widget->layout()->addWidget(thumbnail3);
thumbnailDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART), mainwindow);
thumbnailDock->setObjectName("thumbnailDock");
thumbnailDock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnailDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART));
thumbnailDock->setWidget(thumbnailWidget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnailDock->property("default_area").toInt()), thumbnailDock);
thumbnail2Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN), mainwindow);
thumbnail2Dock->setObjectName("thumbnail2Dock");
thumbnail2Dock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnail2Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN));
thumbnail2Dock->setWidget(thumbnail2Widget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail2Dock->property("default_area").toInt()), thumbnail2Dock);
thumbnail3Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT), mainwindow);
thumbnail3Dock->setObjectName("thumbnail3Dock");
thumbnail3Dock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnail3Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT));
thumbnail3Dock->setWidget(thumbnail3Widget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail3Dock->property("default_area").toInt()), thumbnail3Dock);
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail2Dock);
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail3Dock);
/* when tabifying the dock widgets, the last tab added is selected by default, so we need to re-select the first tab */
thumbnailDock->raise();
coreSelectionWidget = new QWidget();
coreSelectionWidget->setLayout(new QVBoxLayout());
launchWithComboBox = mainwindow->launchWithComboBox();
launchWithWidgetLayout = new QVBoxLayout();
launchWithWidget = new QWidget();
launchWithWidget->setLayout(launchWithWidgetLayout);
coreComboBoxLayout = new QHBoxLayout();
mainwindow->runPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
mainwindow->stopPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
mainwindow->startCorePushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
coreComboBoxLayout->addWidget(launchWithComboBox);
coreComboBoxLayout->addWidget(mainwindow->startCorePushButton());
coreComboBoxLayout->addWidget(mainwindow->coreInfoPushButton());
coreComboBoxLayout->addWidget(mainwindow->runPushButton());
coreComboBoxLayout->addWidget(mainwindow->stopPushButton());
mainwindow->stopPushButton()->hide();
coreComboBoxLayout->setStretchFactor(launchWithComboBox, 1);
launchWithWidgetLayout->addLayout(coreComboBoxLayout);
coreSelectionWidget->layout()->addWidget(launchWithWidget);
coreSelectionWidget->layout()->addItem(new QSpacerItem(20, browserAndPlaylistTabWidget->height(), QSizePolicy::Minimum, QSizePolicy::Expanding));
示例11: ui_companion_qt_init
//.........这里部分代码省略.........
thumbnailWidget->layout()->addWidget(thumbnail);
thumbnail2Widget->layout()->addWidget(thumbnail2);
thumbnail3Widget->layout()->addWidget(thumbnail3);
thumbnailDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART), mainwindow);
thumbnailDock->setObjectName("thumbnailDock");
thumbnailDock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnailDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART));
thumbnailDock->setWidget(thumbnailWidget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnailDock->property("default_area").toInt()), thumbnailDock);
thumbnail2Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN), mainwindow);
thumbnail2Dock->setObjectName("thumbnail2Dock");
thumbnail2Dock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnail2Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN));
thumbnail2Dock->setWidget(thumbnail2Widget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail2Dock->property("default_area").toInt()), thumbnail2Dock);
thumbnail3Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT), mainwindow);
thumbnail3Dock->setObjectName("thumbnail3Dock");
thumbnail3Dock->setProperty("default_area", Qt::RightDockWidgetArea);
thumbnail3Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT));
thumbnail3Dock->setWidget(thumbnail3Widget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail3Dock->property("default_area").toInt()), thumbnail3Dock);
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail2Dock);
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail3Dock);
/* when tabifying the dock widgets, the last tab added is selected by default, so we need to re-select the first tab */
thumbnailDock->raise();
coreSelectionWidget = new QWidget();
coreSelectionWidget->setLayout(new QVBoxLayout());
launchWithComboBox = mainwindow->launchWithComboBox();
launchWithWidgetLayout = new QVBoxLayout();
launchWithWidget = new QWidget();
launchWithWidget->setLayout(launchWithWidgetLayout);
coreComboBoxLayout = new QHBoxLayout();
mainwindow->runPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
mainwindow->stopPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
mainwindow->startCorePushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
coreComboBoxLayout->addWidget(launchWithComboBox);
coreComboBoxLayout->addWidget(mainwindow->startCorePushButton());
coreComboBoxLayout->addWidget(mainwindow->coreInfoPushButton());
coreComboBoxLayout->addWidget(mainwindow->runPushButton());
coreComboBoxLayout->addWidget(mainwindow->stopPushButton());
mainwindow->stopPushButton()->hide();
coreComboBoxLayout->setStretchFactor(launchWithComboBox, 1);
launchWithWidgetLayout->addLayout(coreComboBoxLayout);
coreSelectionWidget->layout()->addWidget(launchWithWidget);
coreSelectionWidget->layout()->addItem(new QSpacerItem(20, browserAndPlaylistTabWidget->height(), QSizePolicy::Minimum, QSizePolicy::Expanding));