本文整理汇总了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());
}
示例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;
}
}
示例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();
}
示例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;
}
}
}
示例5:
Editor *MainWindow::activeEditor()
{
QMdiSubWindow *subWindow = mdiArea->activeSubWindow();
if (subWindow)
return qobject_cast<Editor *>(subWindow->widget());
return 0;
}
示例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;
}
示例7:
QWidget * MainWindow::get_current_window()
{
QMdiSubWindow * w = mdi->currentSubWindow();
if (!w)
return NULL;
return w->widget();
}
示例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);
}
}
示例9: getActiveWindow
// =============================================================================
ITimeTrackingWindow* MainWindow::getActiveWindow() const
{
QMdiSubWindow *subWindow = mMdiArea->activeSubWindow();
if (subWindow) {
return qobject_cast<TimeTrackingWindow*>(subWindow->widget());
}
return NULL;
}
示例10: activePicEdit
PicEditWindow* MainWindow::activePicEdit(){
QMdiSubWindow* subWindow = mdiArea->activeSubWindow();
if(subWindow){
return qobject_cast<PicEditWindow*>(subWindow->widget());
}else{
return 0;
}
}
示例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;
}
}
示例12: getCurrentImageWindow
ImageWindow* WindowService::getCurrentImageWindow()
{
QMdiSubWindow* sw = _mdi->currentSubWindow();
if(sw != NULL) {
ImageWindow* imw = dynamic_cast<ImageWindow*>(sw->widget());
return imw;
}
else return NULL;
}
示例13: showStringsTable
void MainWindow::showStringsTable()
{
QMdiSubWindow *wnd = mdi->currentSubWindow();
if (wnd)
{
DB2Window *w = (DB2Window*)wnd->widget();
w->showStringsList();
}
}
示例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();
}
}
}
示例15: return
ImageTabs*
PidMain::getCurrentImageWindow()
{
QMdiSubWindow *activeWindow = mdiArea->activeSubWindow();
if (activeWindow == NULL)
return NULL;
else
return (ImageTabs*)activeWindow->widget();
}