本文整理汇总了C++中QMdiSubWindow::showMaximized方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::showMaximized方法的具体用法?C++ QMdiSubWindow::showMaximized怎么用?C++ QMdiSubWindow::showMaximized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::showMaximized方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_model
void MainWindow::new_model()
{
VoxelEditor * ed = new VoxelEditor(this);
QMdiSubWindow * w = mdi->addSubWindow(ed);
ed->reset();
w->showMaximized();
}
示例2: addMDIWindow
void MWMDIManagerImpl::addMDIWindow(MWMDIWindow* w) {
bool contains = getWindowById(w->getId())!=NULL;
if (contains) {
assert(0); //must never happen
return;
}
w->setParent(mdiArea);
QMdiSubWindow* qw = mdiArea->addSubWindow(w);
qw->setWindowTitle(w->windowTitle());
QIcon icon = w->windowIcon();
if (icon.isNull()) {
icon = QIcon(":/ugene/images/ugene_16.png");
}
qw->setWindowIcon(icon);
//qw->setAttribute(Qt::WA_NativeWindow);
MDIItem* i = new MDIItem(w, qw);
items.append(i);
qw->installEventFilter(this);
uiLog.trace(QString("Adding window: '%1'").arg(w->windowTitle()));
updateState();
emit si_windowAdded(w);
if (items.count() == 1 && defaultIsMaximized) {
qw->showMaximized();
} else {
qw->show();
}
qw->raise();
}
示例3: clone_model
void MainWindow::clone_model()
{
VoxelFile * voxel = get_voxel();
if (voxel == NULL)
return;
VoxelEditor * ed = new VoxelEditor(this);
QMdiSubWindow * w = mdi->addSubWindow(ed);
ed->clone(voxel);
w->showMaximized();
}
示例4: open_model
void MainWindow::open_model()
{
QString name = get_model_name(this, false);
if (name.isEmpty())
return;
VoxelEditor * ed = new VoxelEditor(this);
QMdiSubWindow * w = mdi->addSubWindow(ed);
ed->load(name);
w->showMaximized();
}
示例5: mainAdapterWidget
int mainAdapterWidget(QApplication& a, osg::ArgumentParser& arguments) {
// load the scene.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel) {
std::cerr << arguments[0] << ": No data loaded." << std::endl;
std::cout << "usage: " << arguments[0] << " [--mdi] nodefile" << std::endl;
return 1;
}
std::cout << "Using AdapterWidget - QGLWidget subclassed to integrate with "
"osgViewer using its embedded graphics window support."
<< std::endl;
if (arguments.read("--mdi")) {
std::cout << "Using ViewetQT MDI version" << std::endl;
/*
Following problems are found here:
- miminize causes loaded model to disappear (some problem with Camera
matrix? - clampProjectionMatrix is invalid)
*/
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
QMainWindow* mw = new QMainWindow();
QMdiArea* mdiArea = new QMdiArea(mw);
mw->setCentralWidget(mdiArea);
QMdiSubWindow* subWindow = mdiArea->addSubWindow(viewerWindow);
subWindow->showMaximized();
subWindow->setWindowTitle("New Window");
mw->show();
} else {
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
viewerWindow->show();
}
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
示例6: addEditorWindow
void MainWindow::addEditorWindow() {
_editor = new QsciScintilla;
_luaLexer = new QsciLexerLua;
_editor->setLexer(_luaLexer);
_luaLexer->setFont(QFont("Courier New"));
// symbols
_editor->setMarginType(1, QsciScintilla::SymbolMargin);
_editor->setMarginWidth(1, "xx");
_editor->setMarginSensitivity (1, true);
_editor->markerDefine(QsciScintilla::RightTriangle, BOOKMARK_MARKER);
_editor->setMarkerBackgroundColor(QColor (0,0,232), BOOKMARK_MARKER);
_editor->markerDefine(QsciScintilla::Circle, BREAKPOINT_MARKER);
_editor->setMarkerBackgroundColor(QColor (192,0,0), BREAKPOINT_MARKER);
_editor->markerDefine(QsciScintilla::RightTriangle, DEBUGGER_MARKER);
_editor->setMarkerBackgroundColor(QColor (255,255,0), DEBUGGER_MARKER);
// line numbers
_editor->setMarginsForegroundColor(QColor (96, 96, 96));
_editor->setMarginsBackgroundColor(QColor (232, 232, 220));
_editor->setMarginType(2, QsciScintilla::TextMargin);
_editor->setMarginWidth(2, "xxxx");
_editor->setMarginLineNumbers(2, true);
// other features
_editor->setBraceMatching(QsciScintilla::StrictBraceMatch);
_editor->setAutoIndent(true);
_editor->setIndentationWidth(2);
_editor->setIndentationsUseTabs(false);
_editor->setCaretLineVisible(true);
_editor->setCaretLineBackgroundColor(QColor (248, 248, 248));
_editor->setUtf8(true);
QMdiSubWindow *subWindow = ui->mdiArea->addSubWindow(_editor);
subWindow->setWindowIcon(QIcon("://icons/text-x-generic-template.svg"));
subWindow->showMaximized();
}
示例7: setWidthOfMdiWindow
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::setWidthOfMdiWindow(QWidget* mdiWindowWidget, int newWidth)
{
QMdiSubWindow* mdiWindow = findMdiSubWindow(mdiWindowWidget);
if (mdiWindow)
{
QSize subWindowSize = mdiWindow->size();
subWindowSize.setWidth(std::max(newWidth, 100));
mdiWindow->resize(subWindowSize);
if (mdiWindow->isMaximized())
{
// Set window temporarily to normal state and back to maximized
// to redo layout so the whole window canvas is filled
// Tried to activate layout, did not work as expected
// Tested code:
// m_layout->activate();
// mdiWindow->layout()->activate();
mdiWindow->showNormal();
mdiWindow->showMaximized();
}
}
}
示例8: openPage
void MainWindow::openPage( int type, quint32 accountid )
{
if( type <= 0 )
return;
QUuid id;
PageWidgetMember *tab = NULL;
QString header;
//usual window
if( type != 13 )
{
if( !hList.contains( type, id ) )
{
//create page
tab = createPage( type, accountid, header );
}
else
{
//show page
setPageActive( id, accountid );
return;
}
}
//transactions window
else if( type == 13 && accountid > 0 )
{
if( !hList.trContains( accountid, id ) )
{
tab = createPage( type, accountid, header );
}
else
{
setPageActive( id );
return;
}
}
// -------
// -------
if( tab == NULL )
return;
connect( tab, SIGNAL( closeRequest( const QUuid & ) ), this, SLOT( closePage( const QUuid & ) ) );
connect( tab, SIGNAL( closed( int ) ), this, SLOT( closedPage( int ) ) );
connect( tab, SIGNAL( headerChanged( const QString & ) ), this, SLOT( changeHeader( const QString & ) ) );
//create an empty tab on tabwidget
disconnect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( setPageActive(int) ) );
tabWidget->addTab( new QWidget(), header );
tabWidget->setCurrentIndex( tabWidget->count()-1 );
if( tab->hasIcon() )
tabWidget->setTabIcon( tabWidget->count()-1, *tab->icon() );
connect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( setPageActive(int) ) );
// ----
//create and show window in MDI Area
QMdiSubWindow *subW = new QMdiSubWindow(this);
subW->setWidget( tab );
subW->setWindowTitle( header );
subW->setAttribute( Qt::WA_DeleteOnClose );
mdiArea->addSubWindow( subW );
subW->showMaximized();
subW->show();
// -----
//creating a handler for the tab
Handler *h = new Handler();
h->id = QUuid::createUuid();
h->accountid = accountid;
h->type = type;
h->number = tabWidget->count()-1;
// -----
tab->setHandler( *h );
hList.append( h );
}
示例9: mainAdapterWidget
int mainAdapterWidget(QApplication& a, osg::ArgumentParser& arguments)
{
// load the scene.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments[0] <<": No data loaded." << std::endl;
return 1;
}
std::cout<<"Using AdapterWidget - QGLWidget subclassed to integrate with osgViewer using its embedded graphics window support."<<std::endl;
if (arguments.read("--CompositeViewer"))
{
CompositeViewerQT* viewerWindow = new CompositeViewerQT;
unsigned int width = viewerWindow->width();
unsigned int height = viewerWindow->height();
{
osgViewer::View* view1 = new osgViewer::View;
view1->getCamera()->setGraphicsContext(viewerWindow->getGraphicsWindow());
view1->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width)/static_cast<double>(height/2), 1.0, 1000.0);
view1->getCamera()->setViewport(new osg::Viewport(0,0,width,height/2));
view1->setCameraManipulator(new osgGA::TrackballManipulator);
view1->setSceneData(loadedModel.get());
viewerWindow->addView(view1);
}
{
osgViewer::View* view2 = new osgViewer::View;
view2->getCamera()->setGraphicsContext(viewerWindow->getGraphicsWindow());
view2->getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width)/static_cast<double>(height/2), 1.0, 1000.0);
view2->getCamera()->setViewport(new osg::Viewport(0,height/2,width,height/2));
view2->setCameraManipulator(new osgGA::TrackballManipulator);
view2->setSceneData(loadedModel.get());
viewerWindow->addView(view2);
}
viewerWindow->show();
}
else if (arguments.read("--mdi")) {
std::cout<<"Using ViewetQT MDI version"<<std::endl;
/*
Following problems are found here:
- miminize causes loaded model to disappear (some problem with Camera matrix? - clampProjectionMatrix is invalid)
*/
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
QMainWindow* mw = new QMainWindow();
QMdiArea* mdiArea = new QMdiArea(mw);
mw->setCentralWidget(mdiArea);
QMdiSubWindow *subWindow = mdiArea->addSubWindow(viewerWindow);
subWindow->showMaximized();
subWindow->setWindowTitle("New Window");
mw->show();
} else {
ViewerQT* viewerWindow = new ViewerQT;
viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
viewerWindow->setSceneData(loadedModel.get());
viewerWindow->show();
}
a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
return a.exec();
}