当前位置: 首页>>代码示例>>C++>>正文


C++ DockWindow::attach方法代码示例

本文整理汇总了C++中DockWindow::attach方法的典型用法代码示例。如果您正苦于以下问题:C++ DockWindow::attach方法的具体用法?C++ DockWindow::attach怎么用?C++ DockWindow::attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DockWindow的用法示例。


在下文中一共展示了DockWindow::attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createWidget

QWidget* SpectralLibraryMatchResults::createWidget()
{
   mpTabWidget = new QTabWidget(getDockWindow()->getWidget());
   mpTabWidget->setTabPosition(QTabWidget::South);
   mpTabWidget->setTabShape(QTabWidget::Rounded);
   mpTabWidget->setMinimumHeight(100);

   // dockwindow should exist so attach to it
   DockWindow* pWindow = getDockWindow();
   if (pWindow != NULL)
   {

      pWindow->attach(SIGNAL_NAME(DockWindow, AboutToShowContextMenu),
         Slot(this, &SpectralLibraryMatchResults::updateContextMenu));

      // Connect to the session explorer now that the window has been created
      if (mpExplorer.get() == NULL)
      {
         Service<SessionExplorer> pExplorer;
         mpExplorer.reset(pExplorer.get());
      }

      // set location of the results window
#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : Replace this block when public method to locate DockWindow is available. (rforehan)")
      QMainWindow* pMainWindow = dynamic_cast<QMainWindow*>(Service<DesktopServices>()->getMainWidget());
      if (pMainWindow != NULL)
      {
         pMainWindow->addDockWidget(Qt::LeftDockWidgetArea, dynamic_cast<QDockWidget*>(pWindow), Qt::Vertical);
      }     
   }

   return mpTabWidget;
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:33,代码来源:SpectralLibraryMatchResults.cpp

示例2: createWidget

QWidget* RangeProfilePlotManager::createWidget()
{
   DockWindow* pWindow = getDockWindow();
   VERIFYRV(pWindow, NULL);
   pWindow->attach(SIGNAL_NAME(Window, SessionItemDropped), Slot(this, &RangeProfilePlotManager::dropSessionItem));
   pWindow->enableSessionItemDrops(this);
   if (!Service<SessionManager>()->isSessionLoading())
   {
      mpPlot = Service<DesktopServices>()->createPlotWidget(getName(), CARTESIAN_PLOT);
   }
   if (mpPlot == NULL)
   {
      return NULL;
   }
   mpView = mpPlot->getPlot();
#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : If a SHALLOW_SELECTION selection mode is added " \
                                              "to plot view (OPTICKS-528), mpView should use it (tclarke)")
   mpMode = (mpView == NULL) ? NULL : mpView->getMouseMode("SelectionMode");
   if (mpMode == NULL)
   {
      return NULL;
   }
   mpView->getWidget()->installEventFilter(this);
   mpPlot->attach(SIGNAL_NAME(PlotWidget, AboutToShowContextMenu),
      Slot(this, &RangeProfilePlotManager::updateContextMenu));
   mpView->enableMouseMode(mpMode, true);
   mpView->setMouseMode(mpMode);

   return mpPlot->getWidget();
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:30,代码来源:RangeProfilePlotManager.cpp


注:本文中的DockWindow::attach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。