当前位置: 首页>>代码示例>>C++>>正文


C++ setWindowState函数代码示例

本文整理汇总了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);
}
开发者ID:elProxy,项目名称:qtbase,代码行数:26,代码来源:mainwindow.cpp

示例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);
}
开发者ID:WizTeam,项目名称:WizQTClient,代码行数:26,代码来源:WizCodeEditorDialog.cpp

示例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]
}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:29,代码来源:chat.cpp

示例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));
}
开发者ID:MilanLi,项目名称:Reversi-Game,代码行数:30,代码来源:mainwidget.cpp

示例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();
}
开发者ID:lediaev,项目名称:DisplayCluster,代码行数:26,代码来源:ContentWindowGraphicsItem.cpp

示例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()));
}
开发者ID:Kreogist,项目名称:Cuties-Uninstaller,代码行数:25,代码来源:mainwindow.cpp

示例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);
    }
}
开发者ID:AWeinb,项目名称:qTox,代码行数:35,代码来源:widget.cpp

示例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
}
开发者ID:jhgorse,项目名称:kst,代码行数:32,代码来源:dialog.cpp

示例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);
}
开发者ID:CamTosh,项目名称:screencloud,代码行数:31,代码来源:selectionoverlay.cpp

示例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;
        }
}
开发者ID:histest,项目名称:his,代码行数:31,代码来源:fmainwindow.cpp

示例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();
    
}
开发者ID:CBause,项目名称:OSM,代码行数:25,代码来源:WFrame.cpp

示例12: setWindowState

void VisualisationContainer::ToggleFullscreen() {
  setWindowState(windowState() ^ Qt::WindowFullScreen);

  Screensaver* screensaver = Screensaver::GetScreensaver();
  if (screensaver)
    isFullScreen() ? screensaver->Inhibit() : screensaver->Uninhibit();
}
开发者ID:RaoulChartreuse,项目名称:Clementine,代码行数:7,代码来源:visualisationcontainer.cpp

示例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();
}
开发者ID:JiabaoZhu,项目名称:PictureMatch,代码行数:25,代码来源:RunGame.cpp

示例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)));

}
开发者ID:kaltsi,项目名称:qt-mobility,代码行数:32,代码来源:device.cpp

示例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);
}
开发者ID:ambivalentduck,项目名称:psychicRobot,代码行数:34,代码来源:displaywidget.cpp


注:本文中的setWindowState函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。