本文整理汇总了C++中setWindowState函数的典型用法代码示例。如果您正苦于以下问题:C++ setWindowState函数的具体用法?C++ setWindowState怎么用?C++ setWindowState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setWindowState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow() : QMainWindow(0)
{
QMenu *file = menuBar()->addMenu(tr("&File"));
QAction *newAction = file->addAction(tr("New Game"));
newAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
QAction *quitAction = file->addAction(tr("Quit"));
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
if (QApplication::arguments().contains("-fullscreen")) {
scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small);
setWindowState(Qt::WindowFullScreen);
} else {
scene = new GraphicsScene(0, 0, 880, 630);
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
view = new QGraphicsView(scene, this);
view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
scene->setupScene(newAction, quitAction);
#ifndef QT_NO_OPENGL
view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
#endif
setCentralWidget(view);
}
示例2: WizWebEngineViewContainerDialog
WizCodeEditorDialog::WizCodeEditorDialog(WizExplorerApp& app, WizDocumentWebView* external, QWidget *parent) :
WizWebEngineViewContainerDialog(parent)
, m_app(app)
, m_external(external)
, m_codeBrowser(new WizWebEngineView({{"codeEditor", this}, {"external", external}}, this))
{
setWindowState(windowState() & ~Qt::WindowFullScreen);
resize(650, 550);
//
//
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->setSpacing(6);
verticalLayout->setContentsMargins(5, 5, 5, 5);
verticalLayout->addWidget(m_codeBrowser);
QString strFileName = Utils::WizPathResolve::resourcesPath() + "files/code/insert_code.htm";
QString strHtml;
::WizLoadUnicodeTextFromFile(strFileName, strHtml);
strHtml.replace("Wiz_Language_Replace", tr("Language"));
strHtml.replace("Wiz_OK_Replace", tr("OK"));
strHtml.replace("Wiz_Cancel_Replace", tr("Cancel"));
QUrl url = QUrl::fromLocalFile(strFileName);
m_codeBrowser->page()->setHtml(strHtml, url);
}
示例3: QDialog
Chat::Chat(QWidget *parent)
: QDialog(parent), ui(new Ui_Chat)
{
//! [Construct UI]
ui->setupUi(this);
#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
setWindowState(Qt::WindowFullScreen);
#endif
connect(ui->quitButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(ui->connectButton, SIGNAL(clicked()), this, SLOT(connectClicked()));
connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendClicked()));
//! [Construct UI]
//! [Create Chat Server]
server = new ChatServer(this);
connect(server, SIGNAL(clientConnected(QString)), this, SLOT(clientConnected(QString)));
connect(server, SIGNAL(clientDisconnected(QString)), this, SLOT(clientDisconnected(QString)));
connect(server, SIGNAL(messageReceived(QString,QString)),
this, SLOT(showMessage(QString,QString)));
connect(this, SIGNAL(sendMessage(QString)), server, SLOT(sendMessage(QString)));
server->startServer();
//! [Create Chat Server]
//! [Get local device name]
localName = QBluetoothLocalDevice().name();
//! [Get local device name]
}
示例4: QDeclarativeView
MainWidget::MainWidget(QWidget *parent)
: QDeclarativeView(parent)
{
// Switch to fullscreen in device
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
setWindowState(Qt::WindowFullScreen);
#endif
setResizeMode(QDeclarativeView::SizeRootObjectToView);
// Register Tile to be available in QML
qmlRegisterType<Tile>("gameCore", 1, 0, "Tile");
// Setup context
m_context = rootContext();
m_context->setContextProperty("mainWidget", this);
m_context->setContextProperty("gameData", &m_gameData);
// Set view optimizations not already done for QDeclarativeView
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground);
// Make QDeclarativeView use OpenGL backend
QGLWidget *glWidget = new QGLWidget(this);
setViewport(glWidget);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
// Open root QML file
setSource(QUrl(filename));
}
示例5: ContentWindowInterface
ContentWindowGraphicsItem::ContentWindowGraphicsItem(boost::shared_ptr<ContentWindowManager> contentWindowManager) : ContentWindowInterface(contentWindowManager)
{
// defaults
resizing_ = false;
// graphics items are movable
setFlag(QGraphicsItem::ItemIsMovable, true);
// default fill color / opacity
setBrush(QBrush(QColor(0, 0, 0, 128)));
// border based on if we're selected or not
// use the -1 argument to force an update but not emit signals
setWindowState(windowState_, (ContentWindowInterface *)-1);
// current coordinates
//x_ = y_ = 0;
//w_ = h_ = 1;
setRect(x_, y_, w_, h_);
// new items at the front
// we assume that interface items will be constructed in depth order so this produces the correct result...
setZToFront();
}
示例6: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
//Set Main Window Properties.
setWindowOpacity(0);
setWindowState(Qt::WindowFullScreen);
//Set Main Window Palette.
QPalette pal=palette();
pal.setColor(QPalette::Window, QColor(0,0,0));
setPalette(pal);
fadeAnimation=new QTimeLine(200, this);
fadeAnimation->setUpdateInterval(5);
fadeAnimation->setFrameRange(0,9);
connect(fadeAnimation, SIGNAL(valueChanged(qreal)),
this, SLOT(updateBackgroundAlpha(qreal)));
mainContext=new ContextWindow(this);
setCentralWidget(mainContext);
connect(mainContext, SIGNAL(requireExit()),
this, SLOT(animateClose()));
connect(mainContext, SIGNAL(requireUninstall()),
this, SLOT(animateDestory()));
}
示例7: isMinimized
void Widget::newMessageAlert(GenericChatroomWidget* chat)
{
bool inactiveWindow = isMinimized() || !isActiveWindow();
if (!inactiveWindow && activeChatroomWidget != nullptr && chat == activeChatroomWidget)
return;
if (ui->statusButton->property("status").toString() == "busy")
return;
QApplication::alert(this);
if (inactiveWindow)
eventFlag = true;
if (Settings::getInstance().getShowWindow())
{
show();
if (inactiveWindow && Settings::getInstance().getShowInFront())
setWindowState(Qt::WindowActive);
}
if (Settings::getInstance().getNotifySound())
{
static QFile sndFile(":audio/notification.pcm");
static QByteArray sndData;
if (sndData.isEmpty())
{
sndFile.open(QIODevice::ReadOnly);
sndData = sndFile.readAll();
sndFile.close();
}
Audio::playMono16Sound(sndData);
}
}
示例8: QDialog
Dialog::Dialog(QWidget *parent)
: QDialog(parent), _allowApply(false) {
setupUi(this);
_saveAsDefault->hide();
_applyToExisting->hide();
extensionWidget()->hide();
connect(_listWidget, SIGNAL(itemClicked(QListWidgetItem*)),
this, SLOT(selectPageForItem(QListWidgetItem*)));
connect(_buttonBox, SIGNAL(clicked(QAbstractButton*)),
this, SLOT(buttonClicked(QAbstractButton*)));
setAttribute(Qt::WA_DeleteOnClose);
resize(minimumSizeHint());
_saveAsDefault->setProperty("si","Save as default");
_applyToExisting->setProperty("si","Apply to existing objects");
#if defined(__QNX__) || defined(__ANDROID__)
// Mobile environments don't have window managers, and so dialogs
// are not a native concept. We may consider adding a "Back"
// button to dialogs on mobile platform...
//
// In the meantime, dialogs should be fullscreen. A dialog without
// borders looks really bad, and getting the size right is difficult.
setWindowState(Qt::WindowFullScreen);
#endif
}
示例9: QGraphicsView
SelectionOverlay::SelectionOverlay(QWidget *parent) :
QGraphicsView(parent)
{
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setStyleSheet( "QGraphicsView { border-style: none; }" );
Qt::WindowStates state = windowState();
state |= Qt::WindowFullScreen;
state |= Qt::WindowActive;
grabKeyboard();
grabMouse();
scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
rubberBand = new TransparentRubberBand(QRubberBand::Rectangle, this);
rubberBand->setGeometry(0,0,0,0);
rubberBandRect = new QGraphicsRectItem(rubberBand->geometry());
rubberBandRect->setBrush(QBrush(QColor(100,100,100,0)));
rbGeometryBeforeResize = QRect(0,0,0,0);
resizingFrom = MOUSE_OUT;
selRectStart = QPoint(0,0);
selRectEnd = QPoint(0,0);
rbDistX = 0;
rbDistY = 0;
drawingRubberBand = resizingRubberBand = movingRubberBand = false;
setScene(scene);
setWindowState( state );
setMouseTracking(true);
//Set mau5 cursor
setCursor(crossShape);
}
示例10: switch
void FMainWindow::onSystemTrayIconClicked(QSystemTrayIcon::ActivationReason reason)
{
switch(reason)
{
//单击
case QSystemTrayIcon::Trigger:
//双击
case QSystemTrayIcon::DoubleClick:
if(isHidden())
{
//恢复窗口显示
show();
//一下两句缺一均不能有效将窗口置顶
setWindowState(Qt::WindowActive);
activateWindow();
setLocked(locked);
}
else
{
if(! locked)
{
hide();
}
}
break;
case QSystemTrayIcon::Context:
break;
default:
break;
}
}
示例11: setWindowState
void WFrame::onCreate() {
setWindowState(Qt::WindowMaximized);
setWindowIcon(QIcon(":files/02.png"));
setAcceptDrops(true);
mapLoaded = false;
wStart = new WStart(c,r);
setCentralWidget(wStart);
centralWidget()->show();
statusBar()->show();
statusProg = new QProgressBar();
statusProg->setMaximum(100);
statusProg->setMinimum(0);
statusProg->setValue(0);
statusProg->setVisible(false);
statusBar()->addWidget(statusProg);
createActions();
createMenuBar();
}
示例12: setWindowState
void VisualisationContainer::ToggleFullscreen() {
setWindowState(windowState() ^ Qt::WindowFullScreen);
Screensaver* screensaver = Screensaver::GetScreensaver();
if (screensaver)
isFullScreen() ? screensaver->Inhibit() : screensaver->Uninhibit();
}
示例13: QDialog
RunGame::RunGame(int row, int col, int totalTime, QString imageFileFamily, int imageKind, QWidget *parent) :
QDialog(parent),
ui(new Ui::RunGame)
{
ui->setupUi(this);
setWindowState(Qt::WindowFullScreen);
setWindowIcon(QIcon(":/Main/Resources/Main/Head1.png"));
{
m_isRun = false;
m_isPause = false;
m_runTimeId = 0;
m_useTime = 0;
m_rowNumber = row;
m_colNumber = col;
m_totalTime = totalTime * 1000;
m_imageFileFamily = imageFileFamily;
m_imageKind = imageKind;
m_oldPressBtn = NULL;
}
createMap();
}
示例14: QDialog
DeviceDiscoveryDialog::DeviceDiscoveryDialog(QWidget *parent)
: QDialog(parent), discoveryAgent(new QBluetoothDeviceDiscoveryAgent),
localDevice(new QBluetoothLocalDevice),
ui(new Ui_DeviceDiscovery)
{
ui->setupUi(this);
#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
setWindowState(Qt::WindowFullScreen);
#endif
connect(ui->inquiryType, SIGNAL(toggled(bool)), this, SLOT(setGeneralUnlimited(bool)));
connect(ui->scan, SIGNAL(clicked()), this, SLOT(startScan()));
connect(discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)),
this, SLOT(addDevice(const QBluetoothDeviceInfo&)));
connect(discoveryAgent, SIGNAL(finished()), this, SLOT(scanFinished()));
connect(ui->list, SIGNAL(itemActivated(QListWidgetItem*)),
this, SLOT(itemActivated(QListWidgetItem*)));
connect(localDevice, SIGNAL(hostModeStateChanged(QBluetoothLocalDevice::HostMode)),
this, SLOT(hostModeStateChanged(QBluetoothLocalDevice::HostMode)));
hostModeStateChanged(localDevice->hostMode());
// add context menu for devices to be able to pair device
ui->list->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->list, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(displayPairingMenu(QPoint)));
connect(localDevice, SIGNAL(pairingFinished(const QBluetoothAddress&, QBluetoothLocalDevice::Pairing))
, this, SLOT(pairingDone(const QBluetoothAddress&, QBluetoothLocalDevice::Pairing)));
}
示例15: setWindowState
DisplayWidget::DisplayWidget(QWidget *parent,bool FullScreen)
:QGLWidget(QGLFormat(QGL::DoubleBuffer|QGL::AlphaChannel|QGL::SampleBuffers|QGL::AccumBuffer), parent, 0, FullScreen?Qt::X11BypassWindowManagerHint:Qt::Widget)
{
//Take care of window and input initialization.
timer.start(16, this); //Draw again shortly after constructor finishes
if(FullScreen)
{
setWindowState(Qt::WindowFullScreen);
setCursor(QCursor(Qt::BlankCursor)); //Hide the cursor
raise(); //Make sure it's the top window
}
setPalette(QPalette(QColor(0, 0, 0))); //IF the background draws, draw it black.
setAutoFillBackground(false); //Try to let glClear work...
setAutoBufferSwap(false); //Don't let QT swap automatically, we want to control timing.
backgroundColor=point(0,0,0);
deepBackgroundColor=point(0,0,0);
for(int k=0;k<4;k++) drawShapes[k]=false;
calibrationMode=true;
//Set up a "calibration" field. Should be a 1/4 circle in each corner
Sphere sphere;
spheres.clear();
sphere.color=point(1,0,0);
sphere.position=point(0,0,HANDLEDEPTH);
sphere.radius=.018;
spheres.push_back(sphere);
sphere.color=point(0,1,0);
sphere.position=point(LEFTPROBE,0,HANDLEDEPTH);
spheres.push_back(sphere);
sphere.color=point(0,0,1);
sphere.position=point(0, UPPROBE,HANDLEDEPTH);
spheres.push_back(sphere);
}