Пример #1
0
void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
{
    Q_D(QWidget);
    d->aboutToDestroy();
    if (!isWindow() && parentWidget())
        parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));

    d->deactivateWidgetCleanup();
    if (testAttribute(Qt::WA_WState_Created)) {
        setAttribute(Qt::WA_WState_Created, false);
        QObjectList childObjects =  children();
        for (int i = 0; i < childObjects.size(); ++i) {
            QObject *obj = childObjects.at(i);
            if (obj->isWidgetType())
                static_cast<QWidget*>(obj)->destroy(destroySubWindows,
                                                     destroySubWindows);
        }
        releaseMouse();
        if (qt_pressGrab == this)
          qt_pressGrab = 0;

        if (keyboardGrb == this)
            releaseKeyboard();
        if (testAttribute(Qt::WA_ShowModal))                // just be sure we leave modal
            QApplicationPrivate::leaveModal(this);
        else if ((windowType() == Qt::Popup))
            qApp->d_func()->closePopup(this);
#ifndef QT_NO_IM
        if (d->ic) {
            delete d->ic;
            d->ic =0;
        } else {
            // release previous focus information participating with
            // preedit preservation of qic -- while we still have a winId
            QInputContext *qic = QApplicationPrivate::inputContext;
            if (qic)
                qic->widgetDestroyed(this);
        }
#endif //QT_NO_IM

        if ((windowType() == Qt::Desktop)) {
        } else {
            if (parentWidget() && parentWidget()->testAttribute(Qt::WA_WState_Created)) {
                d->hide_sys();
            }
            if (destroyWindow && isWindow()) {
                if (d->extra && d->extra->topextra && d->extra->topextra->backingStore)
                    d->extra->topextra->backingStore->windowSurface->setGeometry(QRect());
                qwsDisplay()->destroyRegion(internalWinId());
            }
        }
        QT_TRY {
            d->setWinId(0);
        } QT_CATCH (const std::bad_alloc &) {
            // swallow - destructors must not throw
        }
    }
}
Пример #2
0
void RPCConsole::keyPressEvent(QKeyEvent *event)
{
#ifdef ANDROID
    if(windowType() != Qt::Widget && event->key() == Qt::Key_Back)
    {
        close();
    }
#else
    if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
    {
        close();
    }
#endif
}
Пример #3
0
void RPCConsole::keyPressEvent(QKeyEvent *event)
{
    if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
    {
        close();
    }
}
Пример #4
0
LoginDialog::LoginDialog(QWidget *parent, QMdiArea *area) :
	QDialog(parent), emarea(area), closable(false) {
    setUpGUI();
    setWindowTitle( tr("Вход в систему") );
    setModal( true );
    subwindow = emarea->addSubWindow(this, windowType());
}
Пример #5
0
SaveFileDialog::SaveFileDialog(QTextEdit *textEdit, QString *fileName, QMainWindow *mainWindow)
{
    this->textEdit = textEdit;
    this->fileName = fileName;
    this->mainWindow = mainWindow;

    fileNameEdit = new QLineEdit;
    fileNameLabel = new QLabel(tr("Имя файла:"));

    okButton = createButton(tr("&Ок"), SLOT(save()));
    cancelButton = createButton(tr("&Cancel"), SLOT(close()));

    QHBoxLayout *buttonsLayout = new QHBoxLayout;
    buttonsLayout->addStretch();
    buttonsLayout->addWidget(okButton);
    buttonsLayout->addWidget(cancelButton);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(fileNameLabel, 0, 0, 1, 3);
    mainLayout->addWidget(fileNameEdit, 1, 0, 1, 3);
    mainLayout->addLayout(buttonsLayout, 2, 0, 1, 3);
    setLayout(mainLayout);

    setWindowTitle(tr("Сохранить"));
    resize(200, 100);
    subwindow = emarea->addSubWindow(this, windowType());
}
Пример #6
0
KDecoration* Factory::createDecoration( KDecorationBridge* bridge )
    {
    NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK, bridge );
    if( type == NET::Dialog )
        ;
    return new Decoration( bridge, this );
    }
Пример #7
0
void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
{
    Q_D(QWidget);

    d->aboutToDestroy();
    if (!isWindow() && parentWidget())
        parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
    d->deactivateWidgetCleanup();

    if ((windowType() == Qt::Popup) && qApp)
        qApp->d_func()->closePopup(this);

    if (this == QApplicationPrivate::active_window)
        QApplication::setActiveWindow(0);
    if (QWidget::mouseGrabber() == this)
        releaseMouse();
    if (QWidget::keyboardGrabber() == this)
        releaseKeyboard();

    setAttribute(Qt::WA_WState_Created, false);

    if (windowType() != Qt::Desktop) {
        if (destroySubWindows) {
            QObjectList childList(children());
            for (int i = 0; i < childList.size(); i++) {
                QWidget *widget = qobject_cast<QWidget *>(childList.at(i));
                if (widget && widget->testAttribute(Qt::WA_NativeWindow)) {
                    if (widget->windowHandle()) {
                        widget->destroy();
                    }
                }
            }
        }
        if (destroyWindow) {
            d->deleteTLSysExtra();
        } else {
            if (parentWidget() && parentWidget()->testAttribute(Qt::WA_WState_Created)) {
                d->hide_sys();
            }
        }

        d->setWinId(0);
    }
}
Пример #8
0
void StereogramWidget::mouseDoubleClickEvent(QMouseEvent* e)
{
    if (e->button() == Qt::LeftButton) {
        if ((windowType() & Qt::Window) == Qt::Window)
            emit attaching();
        else
            emit detaching();
        e->accept();
    }
}
Пример #9
0
void QWaylandWindow::setGeometry(const QRect &rect)
{
    setGeometry_helper(rect);

    if (window()->isVisible()) {
        if (mWindowDecoration)
            mWindowDecoration->update();

        if (mResizeAfterSwap && windowType() == Egl && mSentInitialResize)
            mResizeDirty = true;
        else
            QWindowSystemInterface::handleGeometryChange(window(), geometry());

        mSentInitialResize = true;
    }

    QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
}
Пример #10
0
void STFT::resize(uint32_t winSize, uint32_t padSize){
	float * tmp = mBufInv;
	uint32_t oldWinSize = sizeWin();
	uint32_t oldNumBins = numBins();
	
	// resize DFT buffers
	DFT::resize(winSize, padSize);
	
	mBufInv = tmp;	// DFT::resize changes this, so change it back
	
	// resize STFT-specific buffers
	mSlide.sizeWin(winSize);
	mem::resize(mFwdWin, oldWinSize, winSize);
	mem::resize(mBufInv, oldWinSize, winSize);
	mem::resize(mPhases, oldNumBins, numBins());
	
	mem::deepZero(mPhases, numBins());
	mem::deepZero(mBufInv, winSize);
	
	// re-compute fwd window
	windowType(mWinType);
}
Пример #11
0
void RPCConsole::reject()
{
    // Ignore escape keypress if this is not a seperate window
    if(windowType() != Qt::Widget)
        QDialog::reject();
}
Пример #12
0
void StereogramWidget::hideEvent(QHideEvent*)
{
    if ((windowType() & Qt::Window) == Qt::Window)
        emit attaching();
}
Пример #13
0
bool LaptopClient::isTransient() const
{
    NET::WindowType type = windowType(SUPPORTED_WINDOW_TYPES_MASK);
    return type == NET::Dialog;
}
Пример #14
0
bool KCommonDecoration::isToolWindow() const
{
    NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK );
    return ((type==NET::Toolbar)||(type==NET::Utility)||(type==NET::Menu));
}
Пример #15
0
bool Client::isFloating() const
{
    xcb_ewmh_connection_t* conn = WindowManager::instance()->ewmhConnection();
    return windowType() != conn->_NET_WM_WINDOW_TYPE_NORMAL;
}
Пример #16
0
bool Client::shouldLayout()
{
#warning handle transient-for here
    xcb_ewmh_connection_t* conn = WindowManager::instance()->ewmhConnection();
    return windowType() == conn->_NET_WM_WINDOW_TYPE_NORMAL;
}