コード例 #1
0
void SmugWindow::writeSettings()
{
    KConfig config(QString::fromLatin1("kipirc"));
    KConfigGroup grp = config.group("Smug Settings");
    grp.writeEntry("AnonymousImport", m_anonymousImport);
    grp.writeEntry("Email",           m_email);
    grp.writeEntry("Password",        m_password);
    grp.writeEntry("Current Album",   m_currentAlbumID);
    grp.writeEntry("Current Key",     m_currentAlbumKey);
    grp.writeEntry("Resize",          m_widget->m_resizeChB->isChecked());
    grp.writeEntry("Maximum Width",   m_widget->m_dimensionSpB->value());
    grp.writeEntry("Image Quality",   m_widget->m_imageQualitySpB->value());

    if (m_import)
    {
        KConfigGroup dialogGroup = config.group("Smug Import Dialog");
        KWindowConfig::saveWindowSize(windowHandle(), dialogGroup);
    }
    else
    {
        KConfigGroup dialogGroup = config.group("Smug Export Dialog");
        KWindowConfig::saveWindowSize(windowHandle(), dialogGroup);
    }

    config.sync();
}
コード例 #2
0
ファイル: qt-display.cpp プロジェクト: dourgulf/biliobs
OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
	: QWidget(parent, flags)
{
	setAttribute(Qt::WA_PaintOnScreen);
	setAttribute(Qt::WA_StaticContents);
	setAttribute(Qt::WA_NoSystemBackground);
	setAttribute(Qt::WA_OpaquePaintEvent);
	setAttribute(Qt::WA_DontCreateNativeAncestors);
	setAttribute(Qt::WA_NativeWindow);

	auto windowVisible = [this] (bool visible)
	{
		if (!visible)
			return;

		if (!display) {
			CreateDisplay();
		} else {
			QSize size = GetPixelSize(this);
			obs_display_resize(display, size.width(), size.height());
		}
	};

	auto sizeChanged = [this] (QScreen*)
	{
		CreateDisplay();

		QSize size = GetPixelSize(this);
		obs_display_resize(display, size.width(), size.height());
	};

	connect(windowHandle(), &QWindow::visibleChanged, windowVisible);
	connect(windowHandle(), &QWindow::screenChanged, sizeChanged);
}
コード例 #3
0
ファイル: qwidget_qpa.cpp プロジェクト: cedrus/qt
void QWidget::setWindowState(Qt::WindowStates newstate)
{
    Q_D(QWidget);
    Qt::WindowStates oldstate = windowState();
    if (oldstate == newstate)
        return;
    if (isWindow() && !testAttribute(Qt::WA_WState_Created))
        create();

    data->window_state = newstate;
    data->in_set_window_state = 1;
    Qt::WindowState newEffectiveState = effectiveState(newstate);
    Qt::WindowState oldEffectiveState = effectiveState(oldstate);
    if (isWindow() && newEffectiveState != oldEffectiveState) {
        // Ensure the initial size is valid, since we store it as normalGeometry below.
        if (!testAttribute(Qt::WA_Resized) && !isVisible())
            adjustSize();

        d->createTLExtra();
        if (oldEffectiveState == Qt::WindowNoState)
            d->topData()->normalGeometry = geometry();

        Q_ASSERT(windowHandle());
        windowHandle()->setWindowState(newEffectiveState);
    }
    data->in_set_window_state = 0;

    if (newstate & Qt::WindowActive)
        activateWindow();

    QWindowStateChangeEvent e(oldstate);
    QApplication::sendEvent(this, &e);
}
コード例 #4
0
bool WindowWidget::event(QEvent *evt) {
    bool ret = QWidget::event(evt);
    if (m_hostedWindow) {
//        if (evt->type() == QEvent::UpdateRequest)
//            return true;
        switch (evt->type()) {
        case QEvent::Wheel:
        case QEvent::KeyPress:
        case QEvent::KeyRelease:
            qGuiApp->sendEvent(m_hostedWindow, evt);
            break;
        case QEvent::Show:
            if (!m_hostedWindow->parent())
                m_hostedWindow->setParent(windowHandle());
            break;
        case QEvent::Resize:
            m_hostedWindow->resize(this->size());
            break;
        case QEvent::Move:
            break;
        case QEvent::Hide:
            windowHandle()->close();
            break;
        default:
            qGuiApp->sendEvent(m_hostedWindow, evt);
        }
    }
    return ret;
}
コード例 #5
0
MainWindow::MainWindow()
    : QMainWindow()
    , m_server_process(new QProcess(this))
    , m_orientation_index(0)
    , m_grid_row(0)
    , m_grid(new QGridLayout)
    , m_start_server(new QPushButton)
    , m_rotate_keyboard(new QPushButton("Rotate input method"))
{
    m_server_process->setProcessChannelMode(QProcess::ForwardedChannels);

    connect(m_server_process, SIGNAL(stateChanged(QProcess::ProcessState)),
            this, SLOT(onServerStateChanged()));

    connect(m_start_server, SIGNAL(clicked()),
            this, SLOT(onStartServerClicked()));
    connect(m_rotate_keyboard, SIGNAL(clicked()),
            this, SLOT(onRotateKeyboardClicked()));

    initUI();
    onServerStateChanged();

    qWarning()<<"Screen Orientation:"<<windowHandle()->screen()->primaryOrientation()<<windowHandle()->screen()->geometry();
    // Work around a bug in maliit input method support where primary orientation is always portrait
    windowHandle()->reportContentOrientationChange(windowHandle()->screen()->primaryOrientation());
}
コード例 #6
0
void MaintenanceDlg::readSettings()
{
    KSharedConfig::Ptr config = KSharedConfig::openConfig();
    KConfigGroup group        = config->group(d->configGroupName);
    d->expanderBox->readSettings(group);
    d->albumSelectors->loadState();

    MaintenanceSettings prm;

    d->useMutiCoreCPU->setChecked(group.readEntry(d->configUseMutiCoreCPU,                               prm.useMutiCoreCPU));
    d->expanderBox->setChecked(Private::NewItems,           group.readEntry(d->configNewItems,           prm.newItems));
    d->expanderBox->setChecked(Private::Thumbnails,         group.readEntry(d->configThumbnails,         prm.thumbnails));
    d->scanThumbs->setChecked(group.readEntry(d->configScanThumbs,                                       prm.scanThumbs));
    d->expanderBox->setChecked(Private::FingerPrints,       group.readEntry(d->configFingerPrints,       prm.fingerPrints));
    d->scanFingerPrints->setChecked(group.readEntry(d->configScanFingerPrints,                           prm.scanFingerPrints));
    d->expanderBox->setChecked(Private::Duplicates,         group.readEntry(d->configDuplicates,         prm.duplicates));
    d->similarity->setValue(group.readEntry(d->configSimilarity,                                         prm.similarity));
    d->expanderBox->setChecked(Private::FaceManagement,     group.readEntry(d->configFaceManagement,     prm.faceManagement));
    d->faceScannedHandling->setCurrentIndex(group.readEntry(d->configFaceScannedHandling,                (int)prm.faceSettings.alreadyScannedHandling));
    d->expanderBox->setChecked(Private::ImageQualitySorter, group.readEntry(d->configImageQualitySorter, prm.qualitySort));
    d->qualityScanMode->setCurrentIndex(group.readEntry(d->configQualityScanMode,                        prm.qualityScanMode));
    d->expanderBox->setChecked(Private::MetadataSync,       group.readEntry(d->configMetadataSync,       prm.metadataSync));
    d->syncDirection->setCurrentIndex(group.readEntry(d->configSyncDirection,                            prm.syncDirection));

    for (int i = Private::NewItems ; i < Private::Stretch ; ++i)
    {
        slotItemToggled(i, d->expanderBox->isChecked(i));
    }

    winId();
    DXmlGuiWindow::restoreWindowSize(windowHandle(), group);
    resize(windowHandle()->size());
}
コード例 #7
0
ファイル: bootmanager.cpp プロジェクト: KitoHo/citra
qreal GRenderWindow::windowPixelRatio() {
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    // windowHandle() might not be accessible until the window is displayed to screen.
    return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
#else
    return 1.0f;
#endif
}
コード例 #8
0
void ExpoBlendingDlg::readSettings()
{
    KConfig config;
    KConfigGroup group = config.group("ExpoBlending Settings");

    d->enfuseSettingsBox->readSettings(group);
    d->saveSettingsBox->readSettings(group);

    d->templateFileName->setText(group.readEntry("Template File Name", QString::fromLatin1("enfuse")));

    winId();
    KConfigGroup group2 = config.group("ExpoBlending Dialog");
    KWindowConfig::restoreWindowSize(windowHandle(), group2);
    resize(windowHandle()->size());
}
コード例 #9
0
void AbstractRenderView::initializeForFirstPaint()
{
    if (m_onFirstPaintInitialized)
    {
        return;
    }

    m_onFirstPaintInitialized = true;

    // let the subclass create a context first
    initializeRenderContext();

    auto updateRenWinDpi = [this] () -> void
    {
        auto renWin = renderWindow();
        auto nativeParent = nativeParentWidget();
        if (!renWin || !nativeParent)
        {
            return;
        }

        const auto dpi = static_cast<int>(nativeParent->windowHandle()->screen()->logicalDotsPerInch());
        if (dpi != renWin->GetDPI())
        {
            renWin->SetDPI(dpi);
        }
    };

    if (auto nativeParent = nativeParentWidget())
    {
        connect(nativeParent->windowHandle(), &QWindow::screenChanged, updateRenWinDpi);
    }

    updateRenWinDpi();
}
コード例 #10
0
ファイル: window.cpp プロジェクト: Nnamso/tdesktop
void Window::init() {
	psInitFrameless();
	setWindowIcon(wndIcon);

	App::app()->installEventFilter(this);
	connect(windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState)));
	connect(windowHandle(), SIGNAL(activeChanged()), this, SLOT(checkHistoryActivation()));

	QPalette p(palette());
	p.setColor(QPalette::Window, st::wndBG->c);
	setPalette(p);

	title = new TitleWidget(this);

    psInitSize();
}
コード例 #11
0
ファイル: GLWidget.cpp プロジェクト: idaohang/RunParticles
GLWidget::GLWidget(Map *map, QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent),
    _playMode(PlayMode_Pause),
    _map(map),
    _timer(new QTimer(this)),
    _idleTimer(new QTimer(this)),
    _fullScreen(false),
    _lockToLayer(false)
{
    setObjectName("GLWidget");
    if (_map == NULL)
        _map = new Map();
    elapsedTimer.start();
    connect(_map, SIGNAL(signalLayerAdded(LayerId)),
            this, SLOT(updateGL()));
    connect(_map, SIGNAL(signalLayerClicked(LayerId)),
            this, SLOT(slotLayerSelected(LayerId)));
    connect(_timer, SIGNAL(timeout()), this, SLOT(update()));
    connect(_map, SIGNAL(layerUpdated()), SLOT(slotRedrawWhenReady()));
    _timer->setInterval(Refresh_Interval);
    _idleTimer->setSingleShot(true);
    if (QWindow *window = windowHandle())
        _viewCtx.setDevicePixelRatio(window->devicePixelRatio());
    connect(_idleTimer, SIGNAL(timeout()), SLOT(updateGL()));
}
コード例 #12
0
ファイル: IblRenderWindow.cpp プロジェクト: SNce/IBLBaker
LRESULT
RenderWindow::callback (HWND window, 
                        UINT msg, 
                        WPARAM wParam, 
                        LPARAM lParam)
{
    if (windowHandle() == nullptr)
        return Window::callback (window, msg, wParam, lParam);
    // Send event message to AntTweakBar
    if (TwEventWin(window, msg, wParam, lParam))
    {
        _rendererHasFocus = false;
        return 0; // Event has been handled by AntTweakBar
    }


    if (msg >= WM_MOUSEFIRST &&
        msg <= WM_MBUTTONDBLCLK)
    {
        _rendererHasFocus = true;
    }

    switch (msg)
    {
        case WM_KEYDOWN:
            if(wParam == VK_ESCAPE)
                DestroyWindow(window);
            break;    
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
    }
    return Window::callback (window, msg, wParam, lParam);
}
コード例 #13
0
ファイル: MainWindow.cpp プロジェクト: ToadKing/dolphin
void MainWindow::CreateComponents()
{
  m_menu_bar = new MenuBar(this);
  m_tool_bar = new ToolBar(this);
  m_game_list = new GameList(this);
  m_render_widget = new RenderWidget;
  m_stack = new QStackedWidget(this);
  m_controllers_window = new ControllersWindow(this);
  m_settings_window = new SettingsWindow(this);
  m_hotkey_window = new MappingWindow(this, 0);

  connect(this, &MainWindow::EmulationStarted, m_settings_window,
          &SettingsWindow::EmulationStarted);
  connect(this, &MainWindow::EmulationStopped, m_settings_window,
          &SettingsWindow::EmulationStopped);

#if defined(HAVE_XRANDR) && HAVE_XRANDR
  m_graphics_window = new GraphicsWindow(
      new X11Utils::XRRConfiguration(
          static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(
              "display", windowHandle())),
          winId()),
      this);
#else
  m_graphics_window = new GraphicsWindow(nullptr, this);
#endif

  InstallHotkeyFilter(m_hotkey_window);
  InstallHotkeyFilter(m_controllers_window);
  InstallHotkeyFilter(m_settings_window);
  InstallHotkeyFilter(m_graphics_window);
}
コード例 #14
0
ToolBarControllerWidget::ToolBarControllerWidget()
    :QWidget(0)
{

    setWindowTitle("QMacToolBar Test");
    resize(400, 200);

    QMacToolBar *toolBar = new QMacToolBar(this);

    QIcon qtIcon(QStringLiteral(":qtlogo.png"));
    fooItem = toolBar->addItem(qtIcon, QStringLiteral("Foo"));
    fooItem->setText("foo");

    connect(fooItem, SIGNAL(activated()), this, SLOT(activated()));

    QMacToolBarItem *item5 = toolBar->addAllowedItem(qtIcon, QStringLiteral("AllowedFoo"));
    connect(item5, SIGNAL(activated()), this, SLOT(activated()));

    QLineEdit *fooItemText = new QLineEdit(this);
    fooItemText->setText("Foo");
    fooItemText->move(10, 10);
    connect(fooItemText, SIGNAL(textChanged(QString)), this, SLOT(changeItemText(QString)));

    winId();
    toolBar->attachToWindow(windowHandle());
}
コード例 #15
0
ファイル: QtTest.cpp プロジェクト: xylsxyls/xueyelingshuang
void QtTest::onButtonClicked()
{
	TipDialogParam tipDialogParam;
	tipDialogParam.m_tip = QStringLiteral("µã»÷");
	tipDialogParam.m_parent = windowHandle();
	DialogManager::instance().makeDialog(tipDialogParam);
}
コード例 #16
0
void MaintenanceDlg::writeSettings()
{
    KSharedConfig::Ptr config = KSharedConfig::openConfig();
    KConfigGroup group        = config->group(d->configGroupName);
    d->expanderBox->writeSettings(group);
    d->albumSelectors->saveState();

    MaintenanceSettings prm   = settings();

    group.writeEntry(d->configUseMutiCoreCPU,      prm.useMutiCoreCPU);
    group.writeEntry(d->configNewItems,            prm.newItems);
    group.writeEntry(d->configThumbnails,          prm.thumbnails);
    group.writeEntry(d->configScanThumbs,          prm.scanThumbs);
    group.writeEntry(d->configFingerPrints,        prm.fingerPrints);
    group.writeEntry(d->configScanFingerPrints,    prm.scanFingerPrints);
    group.writeEntry(d->configDuplicates,          prm.duplicates);
    group.writeEntry(d->configSimilarity,          prm.similarity);
    group.writeEntry(d->configFaceManagement,      prm.faceManagement);
    group.writeEntry(d->configFaceScannedHandling, (int)prm.faceSettings.alreadyScannedHandling);
    group.writeEntry(d->configImageQualitySorter,  prm.qualitySort);
    group.writeEntry(d->configQualityScanMode,     prm.qualityScanMode);
    group.writeEntry(d->configMetadataSync,        prm.metadataSync);
    group.writeEntry(d->configSyncDirection,       prm.syncDirection);

    DXmlGuiWindow::saveWindowSize(windowHandle(), group);
}
コード例 #17
0
void DPluginDialog::saveDialogSize()
{
    KConfig config;
    KConfigGroup group = config.group(objectName());
    DXmlGuiWindow::saveWindowSize(windowHandle(), group);
    config.sync();
}
コード例 #18
0
ファイル: bootmanager.cpp プロジェクト: kemenaran/citra
// On Qt 5.0+, this correctly gets the size of the framebuffer (pixels).
//
// Older versions get the window size (density independent pixels),
// and hence, do not support DPI scaling ("retina" displays).
// The result will be a viewport that is smaller than the extent of the window.
void GRenderWindow::OnFramebufferSizeChanged()
{
    // Screen changes potentially incur a change in screen DPI, hence we should update the framebuffer size
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    // windowHandle() might not be accessible until the window is displayed to screen.
    auto pixel_ratio = windowHandle() ? (windowHandle()->screen()->devicePixelRatio()) : 1.0;

    unsigned width = child->QPaintDevice::width() * pixel_ratio;
    unsigned height = child->QPaintDevice::height() * pixel_ratio;
#else
    unsigned width = child->QPaintDevice::width();
    unsigned height = child->QPaintDevice::height();
#endif

    NotifyFramebufferLayoutChanged(EmuWindow::FramebufferLayout::DefaultScreenLayout(width, height));
}
コード例 #19
0
ファイル: scandialog.cpp プロジェクト: birkedal/digikam
void ScanDialog::saveSettings()
{
    KConfig config(d->configGroupName);
    KConfigGroup group = config.group(QLatin1String("Scan Tool Dialog"));
    DXmlGuiWindow::saveWindowSize(windowHandle(), group);
    config.sync();
}
コード例 #20
0
ファイル: swwindow.cpp プロジェクト: KDE/kipi-plugins
void SwWindow::readSettings()
{
    KConfig config("kipirc");
    KConfigGroup grp = config.group("Muvee Settings");

    SwUser user;
    user.email       = grp.readEntry("User Email", "");
    user.password    = grp.readEntry("User Password", "");
    m_connector->setUser(user);

    m_currentAlbumID = grp.readEntry("Current Album", -1LL);

    if (grp.readEntry("Resize", false))
    {
        m_widget->m_resizeChB->setChecked(true);
        m_widget->m_dimensionSpB->setEnabled(true);
        m_widget->m_imageQualitySpB->setEnabled(true);
    }
    else
    {
        m_widget->m_resizeChB->setChecked(false);
        m_widget->m_dimensionSpB->setEnabled(false);
        m_widget->m_imageQualitySpB->setEnabled(false);
    }

    m_widget->m_dimensionSpB->setValue(grp.readEntry("Maximum Width",    1600));
    m_widget->m_imageQualitySpB->setValue(grp.readEntry("Image Quality", 90));

    KConfigGroup dialogGroup = config.group("Muvee Export Dialog");
    KWindowConfig::restoreWindowSize(windowHandle(), dialogGroup);
}
コード例 #21
0
ファイル: musicplayer.cpp プロジェクト: karllen/MP3Player
//! [6]
void MusicPlayer::createThumbnailToolBar()
{
    thumbnailToolBar = new QWinThumbnailToolBar(this);
    thumbnailToolBar->setWindow(windowHandle());

    playToolButton = new QWinThumbnailToolButton(thumbnailToolBar);
    playToolButton->setEnabled(false);
    playToolButton->setToolTip(tr("Play"));
    playToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
    connect(playToolButton, SIGNAL(clicked()), this, SLOT(togglePlayback()));

    forwardToolButton = new QWinThumbnailToolButton(thumbnailToolBar);
    forwardToolButton->setEnabled(false);
    forwardToolButton->setToolTip(tr("Fast forward"));
    forwardToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekForward));
    connect(forwardToolButton, SIGNAL(clicked()), this, SLOT(seekForward()));

    backwardToolButton = new QWinThumbnailToolButton(thumbnailToolBar);
    backwardToolButton->setEnabled(false);
    backwardToolButton->setToolTip(tr("Rewind"));
    backwardToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekBackward));
    connect(backwardToolButton, SIGNAL(clicked()), this, SLOT(seekBackward()));
    thumbnailToolBar->addButton(backwardToolButton);
    thumbnailToolBar->addButton(playToolButton);
    thumbnailToolBar->addButton(forwardToolButton);

    connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(updateThumbnailToolBar()));
    connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(updateThumbnailToolBar()));
    connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(updateThumbnailToolBar()));
}
コード例 #22
0
S60VideoWidgetDisplay::~S60VideoWidgetDisplay()
{
    // Notify observers that window is about to be destroyed
    QScopedPointer<QWidget> widget(m_widget);
    m_widget = 0;
    emit windowHandleChanged(windowHandle());
    // Widget will be deleted by QScopedPointer
}
コード例 #23
0
void ExportDialog::readSettings()
{
    KConfig config("kipirc");
    KConfigGroup group = config.group(QString("VideoSlideShow Settings"));
    QString path       = group.readEntry("Temp Dir", QString());
    d->settingsBox->setTempDirPath(path);
    KWindowConfig::restoreWindowSize(windowHandle(), group);
}
コード例 #24
0
ファイル: qwindowcontainer.cpp プロジェクト: giucam/qtbase
bool QWindowContainer::event(QEvent *e)
{
    Q_D(QWindowContainer);
    if (!d->window)
        return QWidget::event(e);

    QEvent::Type type = e->type();
    switch (type) {
    case QEvent::ChildRemoved: {
        QChildEvent *ce = static_cast<QChildEvent *>(e);
        if (ce->child() == d->window)
            d->window = 0;
        break;
    }
    // The only thing we are interested in is making sure our sizes stay
    // in sync, so do a catch-all case.
    case QEvent::Resize:
        d->updateGeometry();
        break;
    case QEvent::Move:
        d->updateGeometry();
        break;
    case QEvent::PolishRequest:
        d->updateGeometry();
        break;
    case QEvent::Show:
        d->updateUsesNativeWidgets();
        if (d->isStillAnOrphan()) {
            d->window->setParent(d->usesNativeWidgets
                                 ? windowHandle()
                                 : window()->windowHandle());
        }
        if (d->window->parent()) {
            d->markParentChain();
            d->window->show();
        }
        break;
    case QEvent::Hide:
        if (d->window->parent())
            d->window->hide();
        break;
    case QEvent::FocusIn:
        if (d->window->parent()) {
            if (d->oldFocusWindow != d->window) {
                d->window->requestActivate();
            } else {
                QWidget *next = nextInFocusChain();
                next->setFocus();
            }
        }
        break;
    default:
        break;
    }

    return QWidget::event(e);
}
コード例 #25
0
void BoxOfficeMainForm::draw(UInt16 updateCode)
{
    Graphics graphics(windowHandle());
    ArsRectangle rect(bounds());
    if (redrawAll==updateCode)
    {
        MoriartyForm::draw(updateCode);
    }
}
コード例 #26
0
ファイル: imageshackwindow.cpp プロジェクト: KDE/kipi-plugins
void ImageshackWindow::saveSettings()
{
    KConfig config(QString::fromLatin1("kipirc"));
    KConfigGroup group = config.group("Imageshack Settings");
    KWindowConfig::saveWindowSize(windowHandle(), group);

    group.writeEntry("Private", m_widget->m_privateImagesChb->isChecked());
    group.writeEntry("Rembar", m_widget->m_remBarChb->isChecked());
    group.sync();
}
コード例 #27
0
void MainWindow::toggleVisible()
{
    if (!m_window) {
        m_window = new QWindow();
        m_window->setTransientParent(windowHandle());
        m_window->setMinimumSize(QSize(200, 100));
        m_window->setTitle("Transient Window");
    }
    m_window->setVisible(!m_window->isVisible());
}
コード例 #28
0
void ExportDialog::saveSettings()
{
    KConfig config("kipirc");
    KConfigGroup group  = config.group(QString("VideoSlideShow Settings"));

    group.writeEntry("Temp Dir", d->settingsBox->getTempDirPath());
    KWindowConfig::saveWindowSize(windowHandle(), group);

    config.sync();
}
コード例 #29
0
void PsMainWindow::psInitFrameless() {
    psUpdatedPositionTimer.setSingleShot(true);
	connect(&psUpdatedPositionTimer, SIGNAL(timeout()), this, SLOT(psSavePosition()));

	if (frameless) {
		//setWindowFlags(Qt::FramelessWindowHint);
	}

    connect(windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(psStateChanged(Qt::WindowState)));
}
コード例 #30
0
ファイル: popup_menu.cpp プロジェクト: i-rinat/tdesktop
void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource source) {
	_parent = parent;

	auto origin = PanelAnimation::Origin::TopLeft;
	auto w = p - QPoint(0, _padding.top());
	auto r = Sandbox::screenGeometry(p);
	_useTransparency = Platform::TransparentWindowsSupported(p);
	handleCompositingUpdate();
	if (rtl()) {
		if (w.x() - width() < r.x() - _padding.left()) {
			if (_parent && w.x() + _parent->width() - _padding.left() - _padding.right() + width() - _padding.right() <= r.x() + r.width()) {
				w.setX(w.x() + _parent->width() - _padding.left() - _padding.right());
			} else {
				w.setX(r.x() - _padding.left());
			}
		} else {
			w.setX(w.x() - width());
		}
	} else {
		if (w.x() + width() - _padding.right() > r.x() + r.width()) {
			if (_parent && w.x() - _parent->width() + _padding.left() + _padding.right() - width() + _padding.right() >= r.x() - _padding.left()) {
				w.setX(w.x() + _padding.left() + _padding.right() - _parent->width() - width() + _padding.left() + _padding.right());
			} else {
				w.setX(p.x() - width() + _padding.right());
			}
			origin = PanelAnimation::Origin::TopRight;
		}
	}
	if (w.y() + height() - _padding.bottom() > r.y() + r.height()) {
		if (_parent) {
			w.setY(r.y() + r.height() - height() + _padding.bottom());
		} else {
			w.setY(p.y() - height() + _padding.bottom());
			origin = (origin == PanelAnimation::Origin::TopRight) ? PanelAnimation::Origin::BottomRight : PanelAnimation::Origin::BottomLeft;
		}
	}
	if (w.x() < r.x()) {
		w.setX(r.x());
	}
	if (w.y() < r.y()) {
		w.setY(r.y());
	}
	move(w);

	setOrigin(origin);
	_menu->setShowSource(source);

	startShowAnimation();

	psUpdateOverlayed(this);
	show();
	psShowOverAll(this);
	windowHandle()->requestActivate();
	activateWindow();
}