本文整理汇总了C++中QWindow::showFullScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ QWindow::showFullScreen方法的具体用法?C++ QWindow::showFullScreen怎么用?C++ QWindow::showFullScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWindow
的用法示例。
在下文中一共展示了QWindow::showFullScreen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressEvent
void CanvasQt::keyPressEvent(QKeyEvent* keyEvent) {
#ifdef USE_QWINDOW
QWindow* parent = this->parent();
#else
QWidget* parent = this->parentWidget();
#endif
if (parent && keyEvent->key() == Qt::Key_F && keyEvent->modifiers() == Qt::ShiftModifier){
if(parent->windowState() == Qt::WindowFullScreen) {
parent->showNormal();
} else {
parent->showFullScreen();
}
}
KeyboardEvent pressKeyEvent(EventConverterQt::getKeyButton(keyEvent),
EventConverterQt::getModifier(keyEvent),
KeyboardEvent::KEY_STATE_PRESS);
Canvas::keyPressEvent(&pressKeyEvent);
if(pressKeyEvent.hasBeenUsed()) {
keyEvent->accept();
} else {
QGLWindow::keyPressEvent(keyEvent);
}
}
示例2: FullScreenVideoWindow
PlatformVideoWindow::PlatformVideoWindow()
{
QWindow* win = new FullScreenVideoWindow();
m_window = win;
win->setFlags(win->flags() | Qt::FramelessWindowHint);
// FIXME: Port to Qt 5.
win->showFullScreen();
m_videoWindowId = win->winId();
}
示例3: main
int main(int argc, char ** argv)
{
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
format.setAlphaBufferSize(8);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
QSurfaceFormat::setDefaultFormat(format);
QGuiApplication app(argc, argv);
QWindow *window = 0;
QQmlEngine *engine = 0;
CodeModel *model = 0;
model = new CodeModel();
int exitCode = 0;
// Want nicer fonts
qputenv("QT_DF_RANGE",QByteArray("0.15"));
//qputenv("QML_FIXED_ANIMATION_STEP",QByteArray("1"));
QQuickView *qxView = new QuintView();
engine = qxView->engine();
window = qxView;
qxView->rootContext()->setContextProperty("codemodel",model);
qxView->rootContext()->setContextProperty("view",qxView);
qxView->setSource(QUrl("qrc:/quint.qml"));
QObject::connect(engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
app.setOverrideCursor( QCursor( Qt::BlankCursor ) );
window->showFullScreen();
exitCode = app.exec();
delete window;
return exitCode;
}