コード例 #1
0
ファイル: compositor.cpp プロジェクト: webOS-ports/luna-next
void Compositor::onSurfaceMappedChanged()
{
    QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
    CompositorWindow *window = surfaceWindow(surface);
    if(window && surface) {
        if(surface->hasContent()) {
            qDebug() << __PRETTY_FUNCTION__ << " MAPPED " << window << "appId" << window->appId() << "windowType" << window->windowType();

            // If it was a window created by QtWebProcess, it may be not already in our WindowModel list
            if (!WindowModel::isWindowAlreadyAdded(mWindowModels, window)) {
                qDebug() << Q_FUNC_INFO << "Adding window" << window << "to our models";
                emit windowAdded(QVariant::fromValue(static_cast<QQuickItem*>(window)));
                WindowModel::addWindowForEachModel(mWindowModels, window);
            }
            emit windowShown(QVariant::fromValue(static_cast<QQuickItem*>(window)));
        }
        else {
            qDebug() << __PRETTY_FUNCTION__ << " UNMAPPED " << window << "appId" << window->appId() << "windowType" << window->windowType();

            if (window == mFullscreenWindow)
                setFullscreenWindow(0);

            emit windowHidden(QVariant::fromValue(static_cast<QQuickItem*>(window)));
        }
    }
}
コード例 #2
0
ファイル: MainWindow.cpp プロジェクト: JamesLinus/hifi
void MainWindow::changeEvent(QEvent* event) {
    if (event->type() == QEvent::WindowStateChange) {
        QWindowStateChangeEvent* stateChangeEvent = static_cast<QWindowStateChangeEvent*>(event);
        if ((stateChangeEvent->oldState() == Qt::WindowNoState ||
            stateChangeEvent->oldState() == Qt::WindowMaximized) &&
            windowState() == Qt::WindowMinimized) {
            emit windowShown(false);
        } else {
            emit windowShown(true);
        }
    } else if (event->type() == QEvent::ActivationChange) {
        if (isActiveWindow()) {
            emit windowShown(true);
        } else {
            emit windowShown(false);
        }
    }
    QMainWindow::changeEvent(event);
}
コード例 #3
0
void WorkingBanner::showEvent(QShowEvent *event)
{
    QDialog::showEvent(event);
    if(!event->spontaneous())
    {
        if(m_working)
        {
            m_working->start();
        }
    }
    QTimer::singleShot(25, this, SLOT(windowShown()));
}
コード例 #4
0
ファイル: toplevel.cpp プロジェクト: CyberShadow/kwin
void Toplevel::setReadyForPainting()
{
    if (!ready_for_painting) {
        ready_for_painting = true;
        if (compositing()) {
            addRepaintFull();
            emit windowShown(this);
            if (Client *cl = dynamic_cast<Client*>(this)) {
                if (cl->tabGroup() && cl->tabGroup()->current() == cl)
                    cl->tabGroup()->setCurrent(cl, true);
            }
        }
    }
}
コード例 #5
0
ファイル: MainWindow.cpp プロジェクト: gfcprogramer/hifi
void MainWindow::changeEvent(QEvent* event) {
    if (event->type() == QEvent::WindowStateChange) {
        QWindowStateChangeEvent* stateChangeEvent = static_cast<QWindowStateChangeEvent*>(event);
        if ((stateChangeEvent->oldState() == Qt::WindowNoState ||
             stateChangeEvent->oldState() == Qt::WindowMaximized) &&
             windowState() == Qt::WindowMinimized) {
            emit windowShown(false);
        } else {
            emit windowShown(true);
        }
        
        if (isFullScreen() != Menu::getInstance()->isOptionChecked(MenuOption::Fullscreen)) {
            Menu::getInstance()->setIsOptionChecked(MenuOption::Fullscreen, isFullScreen());
        }
    } else if (event->type() == QEvent::ActivationChange) {
        if (isActiveWindow()) {
            emit windowShown(true);
        } else {
            emit windowShown(false);
        }
    }
    QMainWindow::changeEvent(event);
}
コード例 #6
0
ファイル: qluaapplication.cpp プロジェクト: diz-vara/qtlua
bool 
QLuaApplication::notify(QObject *receiver, QEvent *event)
{
  // capture window polish events
  if (event->type() == QEvent::Show)
    if (receiver->isWidgetType())
      {
        QWidget *w = static_cast<QWidget*>(receiver);
        if (w->windowType() == Qt::Window)
#if QT_VERSION >= 0x040400 
          if (!w->testAttribute(Qt::WA_DontShowOnScreen))
#endif
            emit windowShown(w);
      }
  return QApplication::notify(receiver, event);
}
コード例 #7
0
ファイル: MainWindow.cpp プロジェクト: JamesLinus/hifi
void MainWindow::hideEvent(QHideEvent* event) {
    if (event->spontaneous()) {
        emit windowShown(false);
    }
    QMainWindow::hideEvent(event);
}
コード例 #8
0
ファイル: MainWindow.cpp プロジェクト: JamesLinus/hifi
void MainWindow::showEvent(QShowEvent* event) {
    if (event->spontaneous()) {
        emit windowShown(true);
    }
    QMainWindow::showEvent(event);
}
コード例 #9
0
ファイル: mainform.cpp プロジェクト: andrei-b/YAGF
MainForm::MainForm(QWidget *parent): QMainWindow(parent)
{
    setupUi(this);

    ///!!!!!
    //alignButton->hide();
    //unalignButton->hide();


    setWindowTitle("YAGF");
    spellChecker = new SpellChecker(textEdit);
    spellChecker->enumerateDicts();
    selectLangsBox = new QComboBox();
    QLabel *label = new QLabel();
    label->setMargin(4);
    label->setText(trUtf8("Recognition language"));
    frame->show();
    toolBar->addWidget(label);
    selectLangsBox->setFrame(true);
    toolBar->addWidget(selectLangsBox);
    graphicsInput = new QGraphicsInput(QRectF(0, 0, 2000, 2000), graphicsView) ;
    graphicsInput->addToolBarAction(actionHideShowTolbar);
    graphicsInput->addToolBarAction(this->actionTBLV);
    graphicsInput->addToolBarAction(this->actionSmaller_view);
    graphicsInput->addToolBarSeparator();
    graphicsInput->addToolBarAction(actionRotate_90_CCW);
    graphicsInput->addToolBarAction(actionRotate_180);
    graphicsInput->addToolBarAction(actionRotate_90_CW);
    graphicsInput->addToolBarAction(actionDeskew);
    graphicsInput->addToolBarSeparator();
    graphicsInput->addToolBarAction(actionSelect_Text_Area);
    graphicsInput->addToolBarAction(actionSelect_multiple_blocks);
    graphicsInput->addToolBarAction(ActionClearAllBlocks);

    statusBar()->show();
    imageLoaded = false;
    useXSane = TRUE;
    textSaved = TRUE;
    hasCopy = false;
    //rotation = 0;
    m_menu = new QMenu(graphicsView);
    ifCounter = 0;

    connect(actionOpen, SIGNAL(triggered()), this, SLOT(loadImage()));
    connect(actionQuit, SIGNAL(triggered()), this, SLOT(close()));
    connect(this, SIGNAL(windowShown()), this, SLOT(onShowWindow()), Qt::QueuedConnection);
    connect(actionScan, SIGNAL(triggered()), this, SLOT(scanImage()));
    connect(actionPreviousPage, SIGNAL(triggered()), this, SLOT(loadPreviousPage()));
    connect(actionNextPage, SIGNAL(triggered()), this, SLOT(loadNextPage()));
    connect(actionRecognize, SIGNAL(triggered()), this, SLOT(recognize()));
    connect(action_Save, SIGNAL(triggered()), this, SLOT(saveText()));
    connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAboutDlg()));
    connect(actionOnlineHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
    connect(actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyClipboard()));
    textEdit->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(textEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
    connect(textEdit, SIGNAL(copyAvailable(bool)), this, SLOT(copyAvailable(bool)));
    connect(textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()));
    connect(graphicsInput, SIGNAL(rightMouseClicked(int, int, bool)), this, SLOT(rightMouseClicked(int, int, bool)));


    tesMap = new TesMap();
    fillLanguagesBox();
    initSettings();
    delTmpFiles();
    scanProcess = new QProcess(this);
    QXtUnixSignalCatcher::connectUnixSignal(SIGUSR2);
    ba = new QByteArray();
    connect(QXtUnixSignalCatcher::catcher(), SIGNAL(unixSignal(int)), this, SLOT(readyRead(int)));

    connect(textEdit->document(), SIGNAL(cursorPositionChanged(const QTextCursor &)), this, SLOT(updateSP()));

    //displayLabel->installEventFilter(this);
    textEdit->installEventFilter(this);
    QPixmap l_cursor;
    l_cursor.load(":/resize.png");
    resizeCursor = new QCursor(l_cursor);
    graphicsInput->setMagnifierCursor(resizeCursor);
    l_cursor.load(":/resize_block.png");
    resizeBlockCursor = new QCursor(l_cursor);
   // textEdit->setContextMenuPolicy(Qt::ActionsContextMenu);

    this->sideBar->show();
    connect(sideBar, SIGNAL(fileSelected(const QString &)), this, SLOT(fileSelected(const QString &)));

    connect(actionRecognize_All_Pages, SIGNAL(triggered()), this, SLOT(recognizeAll()));

    graphicsInput->setSideBar(sideBar);

    QPixmap pm;
    pm.load(":/align.png");
    //alignButton->setIcon(pm);
    pm.load(":/undo.png");
    //unalignButton->setIcon(pm);
    //connect(unalignButton, SIGNAL(clicked()), this, SLOT(unalignButtonClicked()));

    //clearBlocksButton->setDefaultAction(ActionClearAllBlocks);
    loadFromCommandLine();
    emit windowShown();

    pdfx = NULL;
    if (findProgram("pdftoppm")) {
        pdfx = new PDF2PPT();
    } else
    if (findProgram("gs")) {
         pdfx = new GhostScr();
    }

    if (pdfx) {
        connect(pdfx, SIGNAL(addPage(QString)), this, SLOT(addPDFPage(QString)), Qt::QueuedConnection);
        connect (pdfx, SIGNAL(finished()), this, SLOT(finishedPDF()));
    }

    pdfPD.setWindowTitle("YAGF");
    pdfPD.setLabelText(trUtf8("Importing pages from the PDF document..."));
    pdfPD.setCancelButtonText(trUtf8("Cancel"));
    pdfPD.setMinimum(-1);
    pdfPD.setMaximum(-1);
    pdfPD.setWindowIcon(QIcon(":/yagf.png"));
    if (pdfx)
        connect(&pdfPD, SIGNAL(canceled()), pdfx, SLOT(cancel()));

}
コード例 #10
0
void
MainWindow::showEvent(QShowEvent *event) {
  emit windowShown();
  event->accept();
}