Exemple #1
0
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);
}
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);
}
Exemple #3
0
void QWidget::show()
{
    Qt::WindowFlags flags = windowFlags() & 0xff;
    int threshold = qApp->autoMaximizeThreshold();
    if ((threshold < 0) || (windowState() & Qt::WindowFullScreen) || (windowState() & Qt::WindowMaximized)) {
        setVisible(true);
        return;
    }
    int height = sizeHint().height();
    int screenHeight = (qreal(threshold) / 100.0f * qApp->desktop()->screenGeometry(this).height());
    bool maximize  = height > screenHeight;
    if (!maximize) {
        // If we do not maximize yet we check the widget and its child widgets whether they are
        //vertically expanding. If one of the widgets is expanding we maximize.
        QList<QWidget *> list = findChildren<QWidget *>();
        bool expandingChild = sizePolicy().verticalPolicy () == QSizePolicy::Expanding;
        for (int i = 0; (i < list.size()) && !expandingChild; ++i) {
            expandingChild = list.at(i)->sizePolicy().verticalPolicy () == QSizePolicy::Expanding;
        }
        maximize = expandingChild;
    }
    if ((minimumSizeHint().height() > qApp->desktop()->screenGeometry(this).height()) || (minimumSizeHint().width() > qApp->desktop()->screenGeometry(this).width()))
        maximize = false;

    if ((flags == Qt::Window || flags == Qt::Dialog) && maximize) {
        setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
            | Qt::WindowMaximized);
        setVisible(true);
    }
    else {
        setVisible(true);
    }
}
Exemple #4
0
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]
}
Exemple #5
0
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));
}
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();
}
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()));
}
Exemple #8
0
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);
    }
}
Exemple #9
0
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
}
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);
}
Exemple #11
0
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;
        }
}
Exemple #12
0
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();
    
}
void VisualisationContainer::ToggleFullscreen() {
  setWindowState(windowState() ^ Qt::WindowFullScreen);

  Screensaver* screensaver = Screensaver::GetScreensaver();
  if (screensaver)
    isFullScreen() ? screensaver->Inhibit() : screensaver->Uninhibit();
}
Exemple #14
0
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();
}
Exemple #15
0
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)));

}
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);
}
void TermMainWindow::toggleBorderless()
{
    setWindowFlags(windowFlags() ^ Qt::FramelessWindowHint);
    show();
    setWindowState(Qt::WindowActive); /* don't loose focus on the window */
    Properties::Instance()->borderless = toggleBorder->isChecked();
}
void ContentWindowGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event)
{
    // on Mac we've seen that mouse events can go to the wrong graphics item
    // this is due to the bug: https://bugreports.qt.nokia.com/browse/QTBUG-20493
    // here we ignore the event if it shouldn't have been sent to us, which ensures
    // it will go to the correct item...
    if(boundingRect().contains(event->pos()) == false)
    {
        event->ignore();
        return;
    }

    // move to next state
    switch(windowState_) {
    case UNSELECTED:
        windowState_ = SELECTED;
        break;
    case SELECTED:
        windowState_ = INTERACTION;
        break;
    case INTERACTION:
        windowState_ = UNSELECTED;
        break;
    }

    setWindowState(windowState_);

    QGraphicsItem::mouseDoubleClickEvent(event);
}
Exemple #19
0
void GuiMainWindow::readWindowSettings()
{
    QSettings settings(QSettings::IniFormat, QSettings::UserScope, APPNAME, APPNAME);

    settings.beginGroup("GuiMainWindow");
    qutty_config.mainwindow.size    = settings.value("Size", size()).toSize();
    qutty_config.mainwindow.pos     = settings.value("Position", pos()).toPoint();
    qutty_config.mainwindow.state   = settings.value("WindowState", (int)windowState()).toInt();
    qutty_config.mainwindow.flag    = settings.value("WindowFlags", (int)windowFlags()).toInt();
    qutty_config.mainwindow.menubar_visible = settings.value("ShowMenuBar", false).toBool();
    qutty_config.mainwindow.titlebar_tabs = settings.value("ShowTabsInTitlebar", true).toBool();
    settings.endGroup();

    if (qutty_config.mainwindow.titlebar_tabs && qutty_config.mainwindow.menubar_visible)
        qutty_config.mainwindow.menubar_visible = false;

    resize(qutty_config.mainwindow.size);
    move(qutty_config.mainwindow.pos);
    setWindowState((Qt::WindowState)qutty_config.mainwindow.state);
    setWindowFlags((Qt::WindowFlags)qutty_config.mainwindow.flag);

    menuGetActionById(MENU_FULLSCREEN)->setChecked((windowState() & Qt::WindowFullScreen));
    menuGetActionById(MENU_ALWAYSONTOP)->setChecked((windowFlags() & Qt::WindowStaysOnTopHint));
    menuGetActionById(MENU_MENUBAR)->setChecked(qutty_config.mainwindow.menubar_visible);
    menuGetActionById(MENU_TAB_IN_TITLE_BAR)->setChecked(qutty_config.mainwindow.titlebar_tabs);

    if (qutty_config.mainwindow.menubar_visible) {
        // setup main menubar
        menuBar()->show();
        menuBar()->addMenu(&menuCommonMenus[MENU_FILE-MENU_SEPARATOR-1]);
        menuBar()->addMenu(&menuCommonMenus[MENU_EDIT-MENU_SEPARATOR-1]);
        menuBar()->addMenu(&menuCommonMenus[MENU_VIEW-MENU_SEPARATOR-1]);
    }
}
///////////////////private///////////////////////
void MainWindow::readSettings()
{
    QSettings sets(QSettings::IniFormat, QSettings::UserScope, "upcoder", "upcoder", this);
    sets.beginGroup("window");
    resize(sets.value("size", QSize(500, 400)).toSize());
    move(sets.value("position", QPoint(100, 100)).toPoint());
    if (sets.value("ismaximized", false).toBool())
    {
        setWindowState(Qt::WindowMaximized);
    }
    ui->tableView->setColumnWidth(0, sets.value("colwidth0", 300).toInt());
    ui->tableView->setColumnWidth(1, sets.value("colwidth1", 80).toInt());
    ui->tableView->setColumnWidth(2, sets.value("colwidth2", 80).toInt());
    ui->tableView->setColumnWidth(3, sets.value("colwidth3", 150).toInt());
    dialogdir = sets.value("dialogdir", QString()).toString();
    sets.endGroup();
    sets.beginGroup("application");
    settings.authentification = sets.value("auth", false).toBool();
    settings.email = sets.value("email", QString()).toString();
    settings.password = sets.value("password", QString()).toString();
    settings.region = sets.value("region", QString()).toString();
    settings.passForDown = sets.value("passfordown", QString()).toString();
    settings.comment = sets.value("comment", QString()).toString();
    settings.trayicon = sets.value("trayicon", false).toBool();
    settings.mintotray = sets.value("mintotray", false).toBool();
    sets.endGroup();
}
Exemple #21
0
void QToolBarPrivate::endDrag()
{
    Q_Q(QToolBar);
    Q_ASSERT(state != 0);

    q->releaseMouse();

    if (state->dragging) {
        QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
        Q_ASSERT(layout != 0);

        if (!layout->plug(state->widgetItem)) {
            if (q->isFloatable()) {
                layout->restore();
                setWindowState(true); // gets rid of the X11BypassWindowManager window flag
                                      // and activates the resizer
                q->activateWindow();
            } else {
                layout->revert(state->widgetItem);
            }
        }
    }

    delete state;
    state = 0;
}
void MainWindow::Initialize( )
{
    LayoutUI( );
    setWindowState( Qt::WindowMaximized );

    pTcpServerThread = QTcpServerThread::CreateInstance( );
}
Exemple #23
0
/*!
  \class hrWindow
  \brief The hrWindow class
*/
hrWindow::hrWindow(QMainWindow *parent):
        QMainWindow(parent)
        , menuscr(NULL)
        , advscr(NULL)
        , render(NULL)
{
    setWindowTitle("OpenHoMM, fullscreen - F11, menu - F12, U - underground, +/- zoom");

    createMenu();

    int gameX = hrSettings::get().x(),
        gameY = hrSettings::get().y();

    if ( gameX > 0 && gameY > 0 )
        move(gameX, gameY);

    menuscr = new hrMenuScreen();
    advscr = new hrAdventureScreen();

    render = new hrRender(this, menuscr);

    setCentralWidget(render);
    resize(800,600);

    if ( hrSettings::get().isFullscreen() )
    {
        QSize windowmode_resolution(800,600);
        hrFullscreenWrapper::enableFullscreen(windowmode_resolution);
        setWindowState(windowState() | Qt::WindowFullScreen );
        menuBar->hide();
    }
    else if ( hrSettings::get().isShowmenu() )
        menuBar->show();
}
Exemple #24
0
void MainWindow::resizeToVideo(MediaWidget::ResizeFactor resizeFactor)
{
	if (!isFullScreen() && !mediaWidget->sizeHint().isEmpty()) {
		if (isMaximized()) {
			setWindowState(windowState() & ~Qt::WindowMaximized);
		}

		QSize videoSize;

		switch (resizeFactor) {
		case MediaWidget::ResizeOff:
			break;
		case MediaWidget::OriginalSize:
			videoSize = mediaWidget->sizeHint();
			break;
		case MediaWidget::DoubleSize:
			videoSize = (2 * mediaWidget->sizeHint());
			break;
		}

		if (!videoSize.isEmpty()) {
			resize(size() - centralWidget()->size() + videoSize);
		}
	}
}
Exemple #25
0
Popup::Popup(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Popup)
{
    ui->setupUi(this);

    ui->monthcomboBox->addItem(tr("January"),   "01");
    ui->monthcomboBox->addItem(tr("Febuary"),   "02");
    ui->monthcomboBox->addItem(tr("March"),     "03");
    ui->monthcomboBox->addItem(tr("April"),     "04");
    ui->monthcomboBox->addItem(tr("May"),       "05");
    ui->monthcomboBox->addItem(tr("June"),      "06");
    ui->monthcomboBox->addItem(tr("July"),      "07");
    ui->monthcomboBox->addItem(tr("August"),    "08");
    ui->monthcomboBox->addItem(tr("September"), "09");
    ui->monthcomboBox->addItem(tr("October"),   "10");
    ui->monthcomboBox->addItem(tr("November"),  "11");
    ui->monthcomboBox->addItem(tr("December"),  "12");

    ui->datecomboBox->addItem(tr("1"),    "01");
    ui->datecomboBox->addItem(tr("2"),    "02");
    ui->datecomboBox->addItem(tr("3"),    "03");
    ui->datecomboBox->addItem(tr("4"),    "04");
    ui->datecomboBox->addItem(tr("5"),    "05");
    ui->datecomboBox->addItem(tr("6"),    "06");
    ui->datecomboBox->addItem(tr("7"),    "07");
    ui->datecomboBox->addItem(tr("8"),    "08");
    ui->datecomboBox->addItem(tr("9"),    "09");
    ui->datecomboBox->addItem(tr("10"),  "10");
    ui->datecomboBox->addItem(tr("11"),  "11");
    ui->datecomboBox->addItem(tr("12"),  "12");
    ui->datecomboBox->addItem(tr("13"),  "13");
    ui->datecomboBox->addItem(tr("14"),  "14");
    ui->datecomboBox->addItem(tr("15"),  "15");
    ui->datecomboBox->addItem(tr("16"),  "16");
    ui->datecomboBox->addItem(tr("17"),  "17");
    ui->datecomboBox->addItem(tr("18"),  "18");
    ui->datecomboBox->addItem(tr("19"),  "19");
    ui->datecomboBox->addItem(tr("20"),  "20");
    ui->datecomboBox->addItem(tr("21"),  "21");
    ui->datecomboBox->addItem(tr("22"),  "22");
    ui->datecomboBox->addItem(tr("23"),  "23");
    ui->datecomboBox->addItem(tr("24"),  "24");
    ui->datecomboBox->addItem(tr("25"),  "25");
    ui->datecomboBox->addItem(tr("26"),  "26");
    ui->datecomboBox->addItem(tr("27"),  "27");
    ui->datecomboBox->addItem(tr("28"),  "28");
    ui->datecomboBox->addItem(tr("29"),  "29");
    ui->datecomboBox->addItem(tr("30"),  "30");
    ui->datecomboBox->addItem(tr("31"),  "31");

    setWindowState(Qt::WindowFullScreen);

    // connect keyboard
    connect(ui->testlineEdit,SIGNAL(selectionChanged()),this,SLOT(on_keyboard()));
    lineEditkeyboard = new Keyboard();


}
Exemple #26
0
bool MainWindow::showSaveOnCloseDialog()
{
	if (has_opened_file && (has_unsaved_changes || has_autosave_conflict))
	{
		// Show the window in case it is minimized
		setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
		raise();
		activateWindow();
		
		QMessageBox::StandardButton ret;
		if (!has_unsaved_changes && actual_path != autosavePath(currentPath()))
		{
			ret = QMessageBox::warning(this, appName(),
			                           tr("Do you want to remove the autosaved version?"),
			                           QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
		}
		else
		{
			ret = QMessageBox::warning(this, appName(),
			                           tr("The file has been modified.\n"
			                              "Do you want to save your changes?"),
			                           QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
		}
		
		switch (ret)
		{
		case QMessageBox::Cancel:
			return false;
			
		case QMessageBox::Discard:
			if (has_autosave_conflict)
				setHasAutosaveConflict(false);
			else
				removeAutosaveFile();
			break;
			
		case QMessageBox::Save:
			if (!save())
				return false;
			// fall through 
			
		 case QMessageBox::Yes:
			setHasAutosaveConflict(false);
			removeAutosaveFile();
			break;
			
		case QMessageBox::No:
			setHasAutosaveConflict(false);
			break;
			
		default:
			Q_ASSERT(false && "Unsupported return value from message box");
			break;
		}
		
	}
	
	return true;
}
Exemple #27
0
/**
 * Main initialization function
 */
void App::init()
{
	QSettings settings;

	setWindowIcon(QIcon(":/qlc.png"));

#ifndef __APPLE__
	/* MDI Area */
	setCentralWidget(new QMdiArea(this));
	centralWidget()->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(centralWidget(),
		SIGNAL(customContextMenuRequested(const QPoint&)),
		this,
		SLOT(slotCustomContextMenuRequested(const QPoint&)));

	/* Workspace background */
	setBackgroundImage(settings.value("/workspace/background").toString());

	/* Application geometry and window state */
	QVariant var;
	var = settings.value(KXMLQLCGeometry, QRect(0, 0, 800, 600));
	if (var.isValid() == true)
		setGeometry(var.toRect());
	var = settings.value(KXMLQLCWindowState, Qt::WindowNoState);
	if (var.isValid() == true)
		setWindowState(Qt::WindowState(var.toInt()));
#else
	/* App is just a toolbar, we only need it to be the size of the
	   toolbar's buttons */
	resize(600, 32);
	move(0, 22);
#endif

	/* Input & output mappers and their plugins */
	initOutputMap();
	initInputMap();

	/* Function running engine/master timer */
	m_masterTimer = new MasterTimer(this, m_outputMap);
	m_masterTimer->start();

	/* Buses */
	Bus::init(this);

	/* Fixture definitions */
	loadFixtureDefinitions();

	// The main view
	initStatusBar();
	initActions();
	initMenuBar();
	initToolBar();

	// Document
	initDoc();

	// Start up in non-modified state
	m_doc->resetModified();
}
void radeon_profile::setupTrayIcon() {
    trayMenu = new QMenu(this);
    setWindowState(Qt::WindowMinimized);
    //close //
    closeApp = new QAction(trayMenu);
    closeApp->setText(tr("Quit"));
    connect(closeApp,SIGNAL(triggered()),this,SLOT(closeFromTray()));

    // standard profiles
    changeProfile = new QAction(trayMenu);
    changeProfile->setText(tr("Change standard profile"));
    connect(changeProfile,SIGNAL(triggered()),this,SLOT(on_chProfile_clicked()));

    // refresh when hidden
    refreshWhenHidden = new QAction(trayMenu);
    refreshWhenHidden->setCheckable(true);
    refreshWhenHidden->setChecked(true);
    refreshWhenHidden->setText(tr("Keep refreshing when hidden"));

    // dpm menu //
    dpmMenu = new QMenu(this);
    dpmMenu->setTitle(tr("DPM"));

    dpmSetBattery = new QAction(dpmMenu);
    dpmSetBalanced = new QAction(dpmMenu);
    dpmSetPerformance = new QAction(dpmMenu);

    dpmSetBattery->setText(tr("Battery"));
    dpmSetBattery->setIcon(QIcon(":/icon/symbols/arrow1.png"));
    dpmSetBalanced->setText(tr("Balanced"));
    dpmSetBalanced->setIcon(QIcon(":/icon/symbols/arrow2.png"));
    dpmSetPerformance->setText(tr("Performance"));
    dpmSetPerformance->setIcon(QIcon(":/icon/symbols/arrow3.png"));

    connect(dpmSetBattery,SIGNAL(triggered()),this,SLOT(on_btn_dpmBattery_clicked()));
    connect(dpmSetBalanced,SIGNAL(triggered()),this, SLOT(on_btn_dpmBalanced_clicked()));
    connect(dpmSetPerformance,SIGNAL(triggered()),this,SLOT(on_btn_dpmPerformance_clicked()));

    dpmMenu->addAction(dpmSetBattery);
    dpmMenu->addAction(dpmSetBalanced);
    dpmMenu->addAction(dpmSetPerformance);
    dpmMenu->addSeparator();
    dpmMenu->addMenu(forcePowerMenu);

    // add stuff above to menu //
    trayMenu->addAction(refreshWhenHidden);
    trayMenu->addSeparator();
    trayMenu->addAction(changeProfile);
    trayMenu->addMenu(dpmMenu);
    trayMenu->addSeparator();
    trayMenu->addAction(closeApp);

    // setup icon finally //
    QIcon appicon(":/icon/extra/radeon-profile.png");
    trayIcon = new QSystemTrayIcon(appicon,this);
    trayIcon->show();
    trayIcon->setContextMenu(trayMenu);
    connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
void QToolBarPrivate::unplug(const QRect &_r)
{
    Q_Q(QToolBar);
    QRect r = _r;
    r.moveTopLeft(q->mapToGlobal(QPoint(0, 0)));
    setWindowState(true, true, r);
    layout->setExpanded(false);
}
Exemple #30
0
FirmwareUpgrade::FirmwareUpgrade(QWidget *parent) : QDialog(parent)
{
    setupUi(this);

#ifdef QT_ARCH_ARM
    setWindowState(windowState() | Qt::WindowFullScreen);
#endif
}