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


C++ QMdiSubWindow::widget方法代码示例

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


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

示例1: queryAccessibleInterface

QAccessibleInterface *QAccessibleMdiSubWindow::child(int index) const
{
    QMdiSubWindow *source = mdiSubWindow();
    if (index != 0 || !source->widget())
        return 0;

    return QAccessible::queryAccessibleInterface(source->widget());
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:qaccessiblewidgets.cpp

示例2: setData

bool ChatList::setData(const QModelIndex &index, const QVariant &value, int role)
{
    QMdiSubWindow* chatw = getChatSubWindowByIndex(index);
    if (chatw == NULL)
        return false;

    switch (role)
    {
    default:
    case Qt::DisplayRole:
    case Qt::EditRole:
    case Qt::DecorationRole:
        return false;
    case Qt::CheckStateRole:
    {
        bool visible = chatw->isVisible();
        chatw->widget()->setVisible(!visible);
        chatw->setVisible(!visible);

    }

        return true;
    }



}
开发者ID:pit-le-rouge,项目名称:rolisteam,代码行数:27,代码来源:chatlist.cpp

示例3: run

void LogWindowTest::run()
{
	while (!MainWindow::_instance)
		Sleep(500);
	auto& area = *MainWindow::instance().mdiArea;
	while (area.subWindowList().size() == 0)
		Sleep(1000);
	QMdiSubWindow *window = area.subWindowList().at(0);
		
	//area.setActiveSubWindow(window);
	LogWindow *logView = qobject_cast<LogWindow *>(window->widget());
	QTimer scrollTimer;
//	log_trace(0) << "thread" << currentThreadId();
	connect(this, &LogWindowTest::scrolltable, logView->mainView_.data(), [logView](QModelIndex index) {
//		log_trace(0) << "thread" << currentThreadId();
		logView->mainView_->scrollTo(index);
	});
			
	connect(&scrollTimer, &QTimer::timeout, this, [this, &logView]() {
		auto pos = rand() % 40000;
		auto model = logView->model();
		//QModelIndex index = model->currentIndex();
		auto index = logView->model()->index(pos, 0);
		//model->setCurrentIndex(index);
		emit scrolltable(index);
		//logView->_logView->scrollTo(index);
	});
	scrollTimer.start(100);
	exec();
}
开发者ID:helkatz,项目名称:LogViewer,代码行数:30,代码来源:testing.cpp

示例4: closeEvent

void App::closeEvent(QCloseEvent* e)
{
    /* Accept the close event by default */
    e->accept();

    QListIterator <QMdiSubWindow*> it(
        qobject_cast<QMdiArea*> (centralWidget())->subWindowList());
    while (it.hasNext() == true)
    {
        QLCFixtureEditor* editor;
        QMdiSubWindow* sub;

        sub = it.next();
        Q_ASSERT(sub != NULL);

        editor = static_cast<QLCFixtureEditor*> (sub->widget());
        Q_ASSERT(editor != NULL);

        editor->show();
        editor->setFocus();

        if (editor->close() == false)
        {
            /* Ignore the close event if just one editor refuses */
            e->ignore();
            break;
        }
    }
}
开发者ID:Babbsdrebbler,项目名称:qlcplus,代码行数:29,代码来源:app.cpp

示例5:

Editor *MainWindow::activeEditor()
{
    QMdiSubWindow *subWindow = mdiArea->activeSubWindow();
    if (subWindow)
       return qobject_cast<Editor *>(subWindow->widget());
    return 0;
}
开发者ID:BerndWollenweber,项目名称:PollenCALC,代码行数:7,代码来源:mainwindow.cpp

示例6: resizeSubMDI

void CMainWindow::resizeSubMDI(const QSize &size)
{
   QMdiSubWindow *activeSubWindow = 0;
   QList<QMdiSubWindow *> windowList = m_centralWidget->subWindowList();
   if (windowList.size() > 0)
   {
      activeSubWindow = windowList.last();
      if (0 == activeSubWindow)
      {
         return;
      }
   }
   else
   {
      return;
   }

   CDrawBoardFrame *frame = (CDrawBoardFrame *)activeSubWindow->widget();
   if (0 == frame)
   {
      return;
   }

   frame->setMinimumSize(size);
   activeSubWindow->resize(QSize(size.width() + 14, size.height() + 43));
   frame = 0;
   activeSubWindow = 0;
}
开发者ID:Broentech,项目名称:sdraw,代码行数:28,代码来源:mainWindow.cpp

示例7:

QWidget * MainWindow::get_current_window()
{
    QMdiSubWindow * w = mdi->currentSubWindow();
    if (!w)
        return NULL;
    return w->widget();
}
开发者ID:Dakror,项目名称:voxie,代码行数:7,代码来源:mainwindow.cpp

示例8: applyFilter

void CGMainWindow::applyFilter(BaseFilter* filter)
{
    QMdiSubWindow *active = ui->mdiArea->activeSubWindow();
    if (active != NULL)
    {
        MdiElement* activeElement =
            dynamic_cast<MdiElement*> (active->widget());

        QImage image =  activeElement->pixmap().toImage();
        QImage result;
        if (!activeElement->isRubberBandVisible()) {
            result = filter->process(image);
        } else {
            QRectF selection = activeElement->getSelectionRect();
            QRect boundingRect = QRect(selection.left(), selection.top(), selection.width(), selection.height());
            boundingRect = boundingRect.intersect(image.rect());
            QImage toProcess = image.copy(boundingRect);
            QImage areaResult = filter->process(toProcess);
            result = image;
            for (int i = boundingRect.left(); i < boundingRect.right(); ++i) {
                for (int j = boundingRect.top(); j < boundingRect.bottom(); ++j) {
                    result.setPixel(i, j, areaResult.pixel(i - boundingRect.left(), j - boundingRect.top()));
                }
            }
            activeElement->hideRubberBand();

        }
        QPixmap pixmap = QPixmap::fromImage(result);
        activeElement->setPixmap(pixmap);

    }
}
开发者ID:itumashyk,项目名称:CG2012,代码行数:32,代码来源:cgmainwindow.cpp

示例9: getActiveWindow

// =============================================================================
ITimeTrackingWindow* MainWindow::getActiveWindow() const
{
    QMdiSubWindow *subWindow = mMdiArea->activeSubWindow();
    if (subWindow) {
        return qobject_cast<TimeTrackingWindow*>(subWindow->widget());
    }
    return NULL;
}
开发者ID:2BlackCoffees,项目名称:EasyTimeTracker,代码行数:9,代码来源:mainwindow.cpp

示例10: activePicEdit

PicEditWindow* MainWindow::activePicEdit(){
    QMdiSubWindow* subWindow = mdiArea->activeSubWindow();
    if(subWindow){
        return qobject_cast<PicEditWindow*>(subWindow->widget());
    }else{
        return 0;
    }
}
开发者ID:nop-end,项目名称:qt_picedit,代码行数:8,代码来源:mainwindow.cpp

示例11: remove

void QMdiAreaContainer::remove(int index)
{
    QList<QMdiSubWindow *> subWins = m_mdiArea->subWindowList(QMdiArea::CreationOrder);
    if (index >= 0 && index < subWins.size()) {
        QMdiSubWindow *f = subWins.at(index);
        m_mdiArea->removeSubWindow(f->widget());
        delete f;
    }
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:9,代码来源:qmdiarea_container.cpp

示例12: getCurrentImageWindow

ImageWindow* WindowService::getCurrentImageWindow()
{
    QMdiSubWindow* sw = _mdi->currentSubWindow();

    if(sw != NULL) {
        ImageWindow* imw = dynamic_cast<ImageWindow*>(sw->widget());
        return imw;
    }
    else return NULL;
}
开发者ID:detiq-t,项目名称:detiq-t_old,代码行数:10,代码来源:WindowService.cpp

示例13: showStringsTable

void MainWindow::showStringsTable()
{
    QMdiSubWindow *wnd = mdi->currentSubWindow();

    if (wnd)
    {
        DB2Window *w = (DB2Window*)wnd->widget();
        w->showStringsList();
    }
}
开发者ID:Smitt64,项目名称:WoWSatat,代码行数:10,代码来源:mainwindow.cpp

示例14: SaveImage

void MainWindow::SaveImage()
{
  QMdiSubWindow *win = ui->mdiArea->currentSubWindow();
  if(win != NULL){
    CanvasWidgetContainer *wid = dynamic_cast<CanvasWidgetContainer*>(win->widget());
    if(wid != NULL){
      wid->SaveImage();
    }
  }
}
开发者ID:QtOpenGL,项目名称:bustamanprojects,代码行数:10,代码来源:mainwindow.cpp

示例15: return

ImageTabs*
PidMain::getCurrentImageWindow()
{
    QMdiSubWindow *activeWindow = mdiArea->activeSubWindow();

    if (activeWindow == NULL)
        return NULL;
    else
        return (ImageTabs*)activeWindow->widget();
}
开发者ID:xjunior,项目名称:blind-chameleon,代码行数:10,代码来源:pidmain.cpp


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