本文整理汇总了C++中QWindow::setFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ QWindow::setFlags方法的具体用法?C++ QWindow::setFlags怎么用?C++ QWindow::setFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWindow
的用法示例。
在下文中一共展示了QWindow::setFlags方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FullScreenVideoWindow
PlatformVideoWindow::PlatformVideoWindow()
{
QWindow* win = new FullScreenVideoWindow();
m_window = win;
win->setFlags(win->flags() | Qt::FramelessWindowHint);
m_videoWindowId = win->winId();
}
示例2: setWindowFlags
void QQuickViewInspector::setWindowFlags(Qt::WindowFlags flags)
{
QWindow *w = getMasterWindow(m_view);
w->setFlags(flags);
// make flags are applied
w->setVisible(false);
w->setVisible(true);
}
示例3: show
virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
m_dialog.winId();
QWindow *window = m_dialog.windowHandle();
Q_ASSERT(window);
window->setTransientParent(parent);
window->setFlags(f);
m_dialog.setWindowModality(m);
m_dialog.show();
return m_dialog.isVisible();
}
示例4: show
virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
m_dialog.winId();
QWindow *window = m_dialog.windowHandle();
Q_ASSERT(window);
window->setTransientParent(parent);
window->setFlags(f);
m_dialog.setWindowModality(m);
m_dialog.setWindowTitle(QPlatformColorDialogHelper::options()->windowTitle());
m_dialog.setOptions((QColorDialog::ColorDialogOptions)((int)(QPlatformColorDialogHelper::options()->options())));
m_dialog.show();
return m_dialog.isVisible();
}
示例5: openGlContext
QString openGlContext()
{
QString result;
QTextStream str(&result);
QOpenGLContext context;
if (context.create()) {
# ifdef QT_OPENGL_DYNAMIC
str << "Dynamic GL ";
# endif
switch (context.openGLModuleType()) {
case QOpenGLContext::LibGL:
str << "LibGL";
break;
case QOpenGLContext::LibGLES:
str << "LibGLES";
break;
}
QWindow window;
if (QGuiApplication::platformName() == QLatin1String("greenisland"))
window.setFlags(Qt::Desktop);
window.setSurfaceType(QSurface::OpenGLSurface);
//window.setScreen(QGuiApplication::primaryScreen());
window.create();
if (context.makeCurrent(&window)) {
QOpenGLFunctions functions(&context);
str << " Vendor: " << reinterpret_cast<const char *>(functions.glGetString(GL_VENDOR))
<< "\nRenderer: " << reinterpret_cast<const char *>(functions.glGetString(GL_RENDERER))
<< "\nVersion: " << reinterpret_cast<const char *>(functions.glGetString(GL_VERSION))
<< "\nGLSL version: " << reinterpret_cast<const char *>(functions.glGetString(GL_SHADING_LANGUAGE_VERSION))
<< "\nFormat: " << context.format();
QList<QByteArray> extensionList = context.extensions().toList();
std::sort(extensionList.begin(), extensionList.end());
QByteArray extensions = extensionList.join(' ');
str << " \nFound " << extensionList.size() << " extensions:\n";
str << wordWrap(extensions, 78);
context.doneCurrent();
}
window.destroy();
} else {
str << "Unable to create an Open GL context.\n";
}
return result;
}
示例6: create_sys
void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)
{
Q_Q(QWidget);
Q_UNUSED(window);
Q_UNUSED(initializeWindow);
Q_UNUSED(destroyOldWindow);
Qt::WindowFlags flags = data.window_flags;
if (!q->testAttribute(Qt::WA_NativeWindow) && !q->isWindow())
return; // we only care about real toplevels
QWindow *win = topData()->window;
// topData() ensures the extra is created but does not ensure 'window' is non-null
// in case the extra was already valid.
if (!win) {
createTLSysExtra();
win = topData()->window;
}
win->setFlags(data.window_flags);
fixPosIncludesFrame();
if (q->testAttribute(Qt::WA_Moved))
win->setGeometry(q->geometry());
else
win->resize(q->size());
win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
if (q->testAttribute(Qt::WA_TranslucentBackground)) {
QSurfaceFormat format;
format.setAlphaBufferSize(8);
win->setFormat(format);
}
if (QWidget *nativeParent = q->nativeParentWidget()) {
if (nativeParent->windowHandle()) {
if (flags & Qt::Window) {
win->setTransientParent(nativeParent->windowHandle());
win->setParent(0);
} else {
win->setTransientParent(0);
win->setParent(nativeParent->windowHandle());
}
}
}
qt_window_private(win)->positionPolicy = topData()->posIncludesFrame ?
QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
win->create();
// Enable nonclient-area events for QDockWidget and other NonClientArea-mouse event processing.
if ((flags & Qt::Desktop) == Qt::Window)
win->handle()->setFrameStrutEventsEnabled(true);
data.window_flags = win->flags();
QBackingStore *store = q->backingStore();
if (!store) {
if (win && q->windowType() != Qt::Desktop)
q->setBackingStore(new QBackingStore(win));
else
q->setAttribute(Qt::WA_PaintOnScreen, true);
}
setWindowModified_helper();
setWinId(win->winId());
// Check children and create windows for them if necessary
q_createNativeChildrenAndSetParent(q);
if (extra && !extra->mask.isEmpty())
setMask_sys(extra->mask);
// If widget is already shown, set window visible, too
if (q->isVisible())
win->setVisible(true);
}