Ejemplo n.º 1
0
void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  // that method is called every time the main window recives a key event.
  // we then switch on the key value and set the camera in the GLWindow
  switch (_event->key())
  {
  // escape key to quit
  case Qt::Key_Escape : QGuiApplication::exit(EXIT_SUCCESS); break;
  // toggle colour tippling
  case Qt::Key_Q : m_SPHSolverCUDA->toggleColorStippling(); break;
  // turn on wirframe rendering
  case Qt::Key_W : glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
  // turn off wire frame
  case Qt::Key_S : glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
  // show full screen
  case Qt::Key_F : showFullScreen(); break;
  // show windowed
  case Qt::Key_N : showNormal(); break;
  // update simulation by one step
  case Qt::Key_E : m_SPHSolverCUDA->update(); break;
  // toggle update automatically
  case Qt::Key_Space : m_update = !m_update; break;
  case Qt::Key_Minus : m_particleDrawer->setParticleSize(m_particleDrawer->getParticleSize()-0.01f); break;
  case Qt::Key_Plus : m_particleDrawer->setParticleSize(m_particleDrawer->getParticleSize()+0.01f); break;
  default : break;
  }
  // finally update the GLWindow and re-draw
  //if (isExposed())
    update();
}
Ejemplo n.º 2
0
void TopWin::setFullscreen(bool val)
{
	if (val)
		showFullScreen();
	else
		showNormal();
}
Ejemplo n.º 3
0
void MainWindow::on_actionFullscreen_triggered()
{
	if(isFullScreen())
		showNormal();
	else
		showFullScreen();
}
Ejemplo n.º 4
0
void MyGLWidget::keyPressEvent(QKeyEvent *e)
{
    switch (e->key()) {
    case Qt::Key_F:
        fullscreen = !fullscreen;
        if (fullscreen) {
            showFullScreen();
        } else {
            resize(640, 480);
            showNormal();
        }
        break;
    case Qt::Key_Escape:
        QMessageBox::StandardButton reply;
        reply = QMessageBox::question(NULL, "NeHe",
                           "Do you want to exit?",
                           QMessageBox::Yes | QMessageBox::No,
                           QMessageBox::Yes);
        if (reply == QMessageBox::Yes) {
                qApp->quit();
        }
        break;
    default:
        QGLWidget::keyPressEvent(e);
        break;
    }
}
Ejemplo n.º 5
0
void MyGLWidget::keyPressEvent(QKeyEvent *event)
{
    switch(event->key())
    {
        case Qt::Key_F2:
        {
            m_show_full_screen = !m_show_full_screen;
            if(m_show_full_screen)
            {
                showFullScreen();
            }
            else
            {
                showNormal();
            }
            updateGL();
            break;
        }
        case Qt::Key_Escape:
        {
            qApp->exit();
            break;
        }
    }
}
Ejemplo n.º 6
0
/** builds all Actions for the menu is only used when the ui is not implemented in qml*/
void CoreEngine::buildActions()
{
    /*this creates the action in the menubar
      the tr() function is used for translation in internationalized apps
    */
    this->open_action = new QAction(tr("&Open"),this);
    this->open_action->setShortcut(QKeySequence::Open);
    this->connect(this->open_action , SIGNAL(triggered()), this, SLOT(open()));

    this->exit_action = new QAction(tr("&Exit"),this);
    this->exit_action->setShortcut(QKeySequence::Quit);
    this->connect(this->exit_action, SIGNAL(triggered()), this, SLOT(close()));

    this->show_file_info = new QAction(tr("Show &Info"),this);
    this->connect(this->show_file_info, SIGNAL(triggered()), this, SLOT(showInfo()));

    this->close_file_info = new QAction(tr("Close &Info"),this);
    this->connect(this->close_file_info, SIGNAL(triggered()), this, SLOT(closeInfo()));

    /*the aboutQT() function is a build in dialog*/
    this->about_qt_qction = new QAction(tr("About &Qt"), this);
    this->connect(this->about_qt_qction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    this->show_fullsreen = new QAction(tr("Show &Fullscreen"),this);
    this->connect(this->show_fullsreen, SIGNAL(triggered()), this, SLOT(showFullScreen()));

    this->close_fullsreen = new QAction(tr("Close &Fullscreen"),this);
    this->connect(this->close_fullsreen, SIGNAL(triggered()), this, SLOT(showNormal()));
}
Ejemplo n.º 7
0
	//! Toggle on/off full screen
	void ThymioVPLStandalone::toggleFullScreen()
	{
		if (isFullScreen())
			showNormal();
		else
			showFullScreen();
	}
Ejemplo n.º 8
0
	void ChallengeApplication::fullScreenStateChanged(bool fullScreen)
	{
		if (fullScreen)
			showFullScreen();
		else
			showNormal();
	}
Ejemplo n.º 9
0
void StelMainView::setFullScreen(bool b)
{
	if (b)
		showFullScreen();
	else
		showNormal();
}
Ejemplo n.º 10
0
// Apply button clicked
void MainWindow::applyBtnClicked()
{
#ifdef Q_WS_MAEMO_5
    showFullScreen();
#endif
    ui->stack->setCurrentWidget(ui->applyPage);
}
Ejemplo n.º 11
0
void MainWindow::doShowFullScreen() {
	const int screen = QApplication::desktop()->screenNumber(this);

	w_->setFullMode(true);
	doSetWindowSize(QSize(-1, -1)); 

	// If the window is outside the screen it will be moved to the primary screen by Qt.
	{
		const QRect &rect = QApplication::desktop()->screenGeometry(screen);
		QPoint p(pos());

		if (p.x() > rect.right())
			p.setX(rect.right());
		else if (p.x() < rect.left())
			p.setX(rect.left());

		if (p.y() > rect.bottom())
			p.setY(rect.bottom());
		else if (p.y() < rect.top())
			p.setY(rect.top());

		if (p != pos())
			move(p);
	}

	showFullScreen();
	correctFullScreenGeometry();
#ifdef Q_WS_MAC // work around annoying random non-updating OpenGL on Mac OS X after full screen.
	centralWidget()->hide();
	centralWidget()->show();
#endif
	w_->parentExclusiveEvent(hasFocus());
}
Ejemplo n.º 12
0
void FramelessMainWindow::toggleMaximize()
{
    const bool willGoNormal = isMaximized() || isFullScreen();
    m_control->fullscreenButton()->setChecked( !willGoNormal );
    if ( willGoNormal ) showNormal();
    else isPlayerShown() ? showFullScreen() : showMaximized();
}
Ejemplo n.º 13
0
void Player::setFullScreen()
{
    if (is_fullscreen)
    {
        showNormal();
        is_fullscreen = false;

        //show hidden widgets
        ui->titleBar->show();
        //show borders
        leftBorder->show();
        rightBorder->show();
        bottomBorder->show();

        ui->toolBar->show();
        ui->netButton->setEnabled(true);
    }
    else
    {
        showFullScreen();
        is_fullscreen = true;
        //hide other widgets
        ui->titleBar->hide();
        ui->toolBar->hide();
        ui->netButton->setEnabled(false);
        //hide borders
        leftBorder->hide();
        rightBorder->hide();
        bottomBorder->hide();
        //set auto-hide toolbar
        toolbar_visible = false;
        toolbar_pos_y = QApplication::desktop()->height() - ui->toolBar->height() / 2;
    }
}
Ejemplo n.º 14
0
fluid_menu::fluid_menu(osman *oss)
{
    pictureFlowWidget = new PictureFlow();
    pictureFlowWidget->setFocus();
    addWidget(pictureFlowWidget);
    setCurrentWidget(pictureFlowWidget);
    pictureFlowWidget->setFocus();
    QRect screen_size = QApplication::desktop()->screenGeometry();
    introAni.setInterval(250);
    this->oss=oss;
    QObject::connect(&introAni,SIGNAL(timeout()),this,SLOT(aniSlide()));
    QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(showThat(int)));
	QObject::connect(oss,SIGNAL(showMenu()),this,SLOT(showFullScreen()));
	QObject::connect(oss,SIGNAL(showMenu()),oss,SLOT(hide()));
    h = screen_size.height() * SIZING_FACTOR_HEIGHT;
    w = screen_size.width() * SIZING_FACTOR_WIDTH;

    const int hh = qMin(h, w);
    const int ww = hh;
    pictureFlowWidget->setSlideSize(QSize(ww, hh));
    addIntroItems();
    populatePictureFlow();
    pictureFlowWidget->setCurrentSlide(0);
    pictureFlowWidget->isIntroRunning=true;
    introAni.start();
 

}
Ejemplo n.º 15
0
void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  // this method is called every time the main window recives a key event.
  // we then switch on the key value and set the camera in the GLWindow
  switch (_event->key())
  {
  // escape key to quite
  case Qt::Key_Escape : QGuiApplication::exit(EXIT_SUCCESS); break;
  // show full screen
  case Qt::Key_F : showFullScreen(); break;
  // show windowed
  case Qt::Key_N : showNormal(); break;
  case Qt::Key_Q : changeWeight(Weights::POSE1,Direction::DOWN); break;
  case Qt::Key_W : changeWeight(Weights::POSE1,Direction::UP); break;

  case Qt::Key_A : changeWeight(Weights::POSE2,Direction::DOWN); break;
  case Qt::Key_S : changeWeight(Weights::POSE2,Direction::UP); break;
  case Qt::Key_Space : toggleAnimation(); break;
  case Qt::Key_Z : punchLeft(); break;
  case Qt::Key_X : punchRight(); break;

  default : break;
  }
  // finally update the GLWindow and re-draw
    update();
}
Ejemplo n.º 16
0
void RegionGrab::init()
{
  m_pixmap = m_grabber->grabFullScreen();

  QDesktopWidget *desktop = QApplication::desktop();
  QRect rect;

  if (desktop->screenCount() > 1) {
    for (int i = 0; i < desktop->screenCount(); ++i) {
      if (rect.isNull())
        rect = desktop->screenGeometry(i);
      else
        rect = rect.united(desktop->screenGeometry(i));
    }
  }
  else
    rect = QRect(QPoint(0, 0), m_pixmap.size());

  resize(rect.size());
  move(rect.topLeft());
  setCursor(Qt::CrossCursor);

# ifdef Q_OS_MAC
  showFullScreen();
# else
  show();
# endif

  raise();
  activateWindow();
  setFocus();
}
Ejemplo n.º 17
0
void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  // this method is called every time the main window recives a key event.
  // we then switch on the key value and set the camera in the GLWindow
  switch (_event->key())
  {
  // escape key to quite
  case Qt::Key_Escape : QGuiApplication::exit(EXIT_SUCCESS); break;
  // turn on wirframe rendering
  case Qt::Key_W : glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
  // turn off wire frame
  case Qt::Key_S : glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
  // show full screen
  case Qt::Key_F : showFullScreen(); break;
  // show windowed
  case Qt::Key_N : showNormal(); break;
  case Qt::Key_Left : m_lightPosition.m_x-=0.5; break;
  case Qt::Key_Right : m_lightPosition.m_x+=0.5; break;
  case Qt::Key_Up : m_lightPosition.m_y+=0.5; break;
  case Qt::Key_Down : m_lightPosition.m_y-=0.5; break;
  case Qt::Key_I : m_lightPosition.m_z-=0.5; break;
  case Qt::Key_O : m_lightPosition.m_z+=0.5; break;

  default : break;
  }
  // finally update the GLWindow and re-draw
  //if (isExposed())
    update();
}
Ejemplo n.º 18
0
void MainWindow::fullScreenMode(bool mode)
{
    isFullScreenMouse = mode;
    if(mode)
    {

        _toolbar->hide();
        menuBar()->hide();
        //setWindowFlags(Qt::FramelessWindowHint);
        //showMaximized();
        showFullScreen();
        grabKeyboard();

    }
    else
    {

        _toolbar->show();
        menuBar()->show();
        //	setWindowFlags((Qt::WindowFlags)(~Qt::FramelessWindowHint));
        showNormal();
        releaseKeyboard();
    }
    show();
}
Ejemplo n.º 19
0
void NGLScene::keyPressEvent(QKeyEvent *_event)
{
  // this method is called every time the main window recives a key event.
  // we then switch on the key value and set the camera in the GLWindow
  switch (_event->key())
  {
  // escape key to quite
  case Qt::Key_Escape : QGuiApplication::exit(EXIT_SUCCESS); break;
  // turn on wirframe rendering
  case Qt::Key_W : glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
  // turn off wire frame
  case Qt::Key_S : glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
  // show full screen
  case Qt::Key_F : showFullScreen(); break;
  // show windowed
  case Qt::Key_N : showNormal(); break;
  case Qt::Key_B : m_showBBox^=true; break;
  case Qt::Key_P : m_showBSphere^=true; break;

  default : break;
  }
  // finally update the GLWindow and re-draw
  //if (isExposed())
    renderLater();
}
MainWindow::MainWindow()
    : m_glViewer(new Viewer)
    , m_settings(new ProgramSettings)
{
    setMinimumSize(800, 500);

    //J'adore ce petit bout de code...je veux ca en poster...well done max :P
    if (m_settings->isFullscreen())
        showFullScreen();

    setCentralWidget(m_glViewer);

    createActions();
    createMenus();
    createToolBars();
    createStatusBar();
    createDocks();

    connect(m_glViewer, SIGNAL(sigMsg(QString)), m_logWidget, SLOT(slotMsg(QString)));

    m_infos->setViewerPointer(m_glViewer);
    connect(m_glViewer, SIGNAL(drawFinished(bool)), m_infos, SLOT(refreshBox(bool)));

    // Originalement pour savoir si un document a été modifié. Changer pour voir si simulation en cours.
    // connect(textEdit->document(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified()));
    setCurrentFile("");
}
Ejemplo n.º 21
0
void MainForm::initSettings()
{
    workingDir = QDir::homePath();
    if (!workingDir.endsWith("/"))
        workingDir += '/';
    QDir d(workingDir + ".config");
    if (d.exists()) workingDir += ".config/";
    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
    workingDir = env.value("XDG_CONFIG_HOME", workingDir);
    if (!workingDir.endsWith("/"))
        workingDir += '/';
    workingDir += "yagf/";
    QDir dir(workingDir);
    if (!dir.exists())
        dir.mkdir(workingDir);
    settings.readSettings(workingDir);
    settings.writeSettings();
    if (settings.getFullScreen())
        showFullScreen();
    else {
        move(settings.getPosition());
        resize(settings.getSize());
    }
    QFont f(textEdit->font());
    f.setPointSize(settings.getFontSize());
    textEdit->setFont(f);
    actionCheck_spelling->setChecked(settings.getCheckSpelling());
    actionSelect_HTML_format->setChecked(settings.getOutputFormat() != "text");

    QList<int> li;
    li.append(1);
    li.append(1);
    splitter->setSizes(li);
    toolBar->setIconSize(settings.getIconSize());
}
Ejemplo n.º 22
0
void ZLQtApplicationWindow::setFullscreen(bool fullscreen) {
	if (fullscreen == myFullScreen) {
		return;
	}
	myFullScreen = fullscreen;
	if (myFullScreen) {
		myWasMaximized = isMaximized();
		if (!myWasMaximized) {
			if (x() != -1) {
				myXOption.setValue(x());
			}
			if (y() != -1) {
				myYOption.setValue(y());
			}
			myWidthOption.setValue(width());
			myHeightOption.setValue(height());
		}
		myToolBar->hide();
		showFullScreen();
	} else {
		myToolBar->show();
		showNormal();
		if (myWasMaximized) {
			showMaximized();
		} else {
			resize(myWidthOption.value(), myHeightOption.value());
			move(myXOption.value(), myYOption.value());
		}
	}
}
Ejemplo n.º 23
0
void ZLQtApplicationWindow::toggleFullscreen() {
	if (isFullScreen()) {
		showNormal();
	} else {
		showFullScreen();
	}
}
Ejemplo n.º 24
0
void MainWindow::on_action_OptionsFullScreen_triggered()
{
	if(isFullScreen()) {
		showNormal();
		ui->menubar->setVisible(true);
		ui->statusbar->setVisible(true);
		SetZoom(g_Config.iWindowZoom);
	}
	else {
		ui->menubar->setVisible(false);
		ui->statusbar->setVisible(false);

		// Remove constraint
		w->setMinimumSize(0, 0);
		w->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
		ui->centralwidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
		setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);

		showFullScreen();

		int width = (int) QApplication::desktop()->screenGeometry().width();
		int height = (int) QApplication::desktop()->screenGeometry().height();
		PSP_CoreParameter().pixelWidth = width;
		PSP_CoreParameter().pixelHeight = height;
		PSP_CoreParameter().renderWidth = width;
		PSP_CoreParameter().renderHeight = height;
		PSP_CoreParameter().outputWidth = width;
		PSP_CoreParameter().outputHeight = height;
		pixel_xres = width;
		pixel_yres = height;
		if (gpu)
			gpu->Resized();
	}
}
Ejemplo n.º 25
0
 void MainWindow::toggleFullScreen2()
 {
     if (windowState() == Qt::WindowFullScreen)
         showNormal();
     else
         showFullScreen();
 }
Ejemplo n.º 26
0
void ZLQtApplicationWindow::setFullscreen(bool fullscreen) {
	if (fullscreen == myFullScreen) {
		return;
	}
	myFullScreen = fullscreen;
	if (myFullScreen) {
		myWasMaximized = isMaximized();
		myWindowToolBar->hide();
		showFullScreen();
		if (myFullscreenToolBar != 0) {
			if (myDocWidget == 0) {
				myDocWidget = new QDockWidget(this);
				myDocWidget->setWidget(myFullscreenToolBar);
				myDocWidget->setFloating(true);
				myDocWidget->setAllowedAreas(Qt::NoDockWidgetArea);
			}
			myDocWidget->show();
			myFullscreenToolBar->show();
			myDocWidget->setMinimumSize(myDocWidget->size());
			myDocWidget->setMaximumSize(myDocWidget->size());
		}
	} else {
		myWindowToolBar->show();
		showNormal();
		if (myWasMaximized) {
			showMaximized();
		}
		if (myDocWidget != 0) {
			//myFullscreenToolBar->hide();
			myDocWidget->hide();
		}
	}
}
void QtQuick2ApplicationViewer::showExpanded() {
#if defined(Q_WS_SIMULATOR)
    showFullScreen();
#else
    show();
#endif
}
Ejemplo n.º 28
0
void MainWindow::keyPressEvent(QKeyEvent *e)
{
    switch(e->key())
    {
    case Qt::Key_F11: isFullScreen() ? showNormal() : showFullScreen(); break;

    case Qt::Key_Escape:
        if(consoleVisible) toggleConsole();
        else if(scriptEditVisible) toggleScriptEdit();
        else isFullScreen() ? showNormal() : (void)close(); break;

    case Qt::Key_AsciiTilde: case Qt::Key_QuoteLeft: if(scriptEditVisible) toggleScriptEdit(); toggleConsole(); break;

    case Qt::Key_Space: if(e->modifiers() & Qt::ControlModifier)
        {
            if(scriptEditVisible)
            {
                Kernel::engine->compileScript(Ui::scriptEdit->textEdit()->document()->toPlainText());
                toggleScriptEdit();
            }
            else { if(consoleVisible) toggleConsole(); toggleScriptEdit(); }
        }
        else if(!Ui::console->hasFocus() && !Ui::scriptEdit->isVisible())
        {
            Kernel::engine->toggle();
            Ui::scene->toggleIndicatorRotation();
        }
        break;

    case Qt::Key_R: Kernel::engine->randomize(); break;
        //    case Qt::Key_Space: if(alive) Kernel::engine->stop(); else Kernel::engine->start(); alive = !alive; break;
    }
}
PreviewWindow::PreviewWindow(QWidget *parent)
    : QWidget(parent)
{
    textEdit = new QTextEdit;
    textEdit->setReadOnly(true);
    textEdit->setLineWrapMode(QTextEdit::NoWrap);

    closeButton = new QPushButton(tr("&Close"));
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    showNormalButton = new QPushButton(tr("Show normal"));
    connect(showNormalButton, SIGNAL(clicked()), this, SLOT(showNormal()));
    showMaximizedButton = new QPushButton(tr("Show maximized"));
    connect(showMaximizedButton, SIGNAL(clicked()), this, SLOT(showMaximized()));
    showFullScreenButton = new QPushButton(tr("Show fullscreen"));
    connect(showFullScreenButton, SIGNAL(clicked()), this, SLOT(showFullScreen()));

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(textEdit);
    layout->addWidget(showNormalButton);
    layout->addWidget(showMaximizedButton);
    layout->addWidget(showFullScreenButton);
    layout->addWidget(closeButton);
    setLayout(layout);

    setWindowTitle(tr("Preview <QWidget>"));
}
// private slot
void kpMainWindow::slotFullScreen ()
{
    if (m_actionFullScreen->isChecked ())
        showFullScreen ();
    else
        showNormal ();
}