void MColorComboBoxViewPrivate::_q_popupDisappeared() { Q_Q(MColorComboBoxView); q->disconnect(popupWidget(), SIGNAL(disappeared()), q, SLOT(_q_popupDisappeared())); q->disconnect(colorWidget(), SIGNAL(colorPicked()), q, SLOT(_q_colorPicked())); }
void MSheetPrivate::_q_onStandAloneSheetDisappeared() { Q_Q(MSheet); Q_ASSERT(standAloneWindow != 0); q->disconnect(SIGNAL(disappeared()), q, SLOT(_q_onStandAloneSheetDisappeared())); // Remove sheet from scene otherwise scene will delete sheet // on scene's destructor standAloneWindow->sceneManager()->d_func()->removeSceneWindow(q); if (q->scene()) { q->scene()->removeItem(q); } if (*appearSystemwideDeletionPolicy == MSceneWindow::DestroyWhenDone || (*appearSystemwideDeletionPolicy == MSceneWindow::DestroyWhenDismissed && dismissed)) { q->deleteLater(); } delete appearSystemwideDeletionPolicy; appearSystemwideDeletionPolicy = 0; }
void MColorComboBoxViewPrivate::_q_popupDisappeared() { Q_Q(MColorComboBoxView); QObject::disconnect(controller, SIGNAL(dismissed()), popupWidget(), SLOT(reject())); q->disconnect(popupWidget(), SIGNAL(disappeared()), q, SLOT(_q_popupDisappeared())); q->disconnect(colorWidget(), SIGNAL(colorPicked()), q, SLOT(_q_colorPicked())); }
void Ut_StatusIndicatorMenuWindow::testWhenStatusIndicatorMenuIsDisappearedThenWindowIsHidden() { QSignalSpy spy(statusIndicatorMenuWindow, SIGNAL(visibilityChanged(bool))); QVERIFY(disconnect(statusIndicatorMenuWindow->menuWidget, SIGNAL(disappeared()), statusIndicatorMenuWindow, SLOT(hideWindow()))); statusIndicatorMenuWindow->hideWindow(); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).at(0).toBool(), false); QCOMPARE(statusIndicatorMenuWindow->isVisible(), false); }
void MColorComboBoxViewPrivate::_q_showPopup() { Q_Q(MColorComboBoxView); popupWidget()->setTitle(q->model()->title()); colorWidget()->setSelectedColor(q->model()->color()); q->connect(popupWidget(), SIGNAL(disappeared()), q, SLOT(_q_popupDisappeared())); q->connect(colorWidget(), SIGNAL(colorPicked()), q, SLOT(_q_colorPicked())); popupWidget()->appear(); }
void StatusIndicatorMenuWindow::resetMenuWidget() { if (menuWidget) delete menuWidget; menuWidget = new StatusIndicatorMenu(); connect(menuWidget, SIGNAL(showRequested()), this, SLOT(makeVisible())); connect(menuWidget, SIGNAL(hideRequested()), menuWidget, SLOT(disappear())); connect(menuWidget, SIGNAL(disappeared()), this, SLOT(hideWindow())); // Initialize the status indicator menu after the first USB banner has been shown QTimer::singleShot(7000, this, SLOT(initializeMenuWidget())); }
void Ut_StatusIndicatorMenuWindow::testInitialization() { QVERIFY(statusIndicatorMenuWindow->menuWidget); QVERIFY(disconnect(statusIndicatorMenuWindow, SIGNAL(displayExited()), statusIndicatorMenuWindow, SLOT(displayInActive()))); QVERIFY(disconnect(statusIndicatorMenuWindow, SIGNAL(displayEntered()), statusIndicatorMenuWindow, SLOT(displayActive()))); QVERIFY(disconnect(statusIndicatorMenuWindow->menuWidget, SIGNAL(showRequested()), statusIndicatorMenuWindow, SLOT(makeVisible()))); QVERIFY(disconnect(statusIndicatorMenuWindow->menuWidget, SIGNAL(hideRequested()), statusIndicatorMenuWindow->menuWidget, SLOT(disappear()))); QVERIFY(disconnect(statusIndicatorMenuWindow->menuWidget, SIGNAL(disappeared()), statusIndicatorMenuWindow, SLOT(hideWindow()))); QVERIFY(gSceneWindowStateMap.contains(statusIndicatorMenuWindow->menuWidget)); QCOMPARE(gSceneWindowStateMap[statusIndicatorMenuWindow->menuWidget], MSceneWindow::Disappeared); }
void Notify::hideGriant() { QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity", this); animation->setStartValue(this->windowOpacity()); animation->setEndValue(0); animation->setDuration(200); animation->start(); connect(animation, &QPropertyAnimation::finished, this, [animation, this](){ this->hide(); animation->deleteLater(); Q_EMIT disappeared(); }); }
void LoginSheet::showLoginSuccessfulAndDismiss() { MBasicSheetHeader *header = static_cast<MBasicSheetHeader*>(headerWidget()); header->setProgressIndicatorVisible(false); MMessageBox *messageBox = new MMessageBox; //% "Access Granted!" messageBox->setTitle(qtTrId("xx_wg_sheets_connection_success")); //% "You are now able to use the requested services." messageBox->setText(qtTrId("xx_wg_sheets_connection_success_text")); connect(messageBox, SIGNAL(disappeared()), SLOT(dismiss())); messageBox->appear(MSceneWindow::DestroyWhenDone); }
void SheetsPage::processFullscreenSaveSuccess() { if (!fullScreenPhotoSheet) return; MBasicSheetHeader *header = qobject_cast<MBasicSheetHeader*>(fullScreenPhotoSheet->headerWidget()); if (header) { header->setProgressIndicatorVisible(false); } MMessageBox *msg = new MMessageBox; //% "Save Completed!" msg->setTitle(qtTrId("xx_wg_sheets_save_completed")); //% "The photo was imported into your photo library, and is now accessible through the photo gallery viewer." msg->setText(qtTrId("xx_wg_sheets_save_completed_text")); connect(msg, SIGNAL(disappeared()), fullScreenPhotoSheet, SLOT(dismiss())); msg->appear(MSceneWindow::DestroyWhenDone); }
bool NetworkManagementEngine::sourceRequestEvent(const QString &name) { kDebug() << "Source requested:" << name << sources(); setData(name, DataEngine::Data()); //setData("networkStatus", "isConnected", true); //scheduleSourcesUpdated(); if (name == "connections") { connect(d->activatables, SIGNAL(activatableAdded(RemoteActivatable*)), SLOT(activatableAdded(RemoteActivatable*))); connect(d->activatables, SIGNAL(activatableRemoved(RemoteActivatable*)), SLOT(activatableRemoved(RemoteActivatable*))); connect(d->activatables, SIGNAL(appeared()), SLOT(listAppeared())); connect(d->activatables, SIGNAL(disappeared()), SLOT(listDisappeared())); kDebug() << "connected..."; listAppeared(); return true; }
QString AppWindow::getItem(QString title, QString prompt, QStringList items) { MWidget *centralWidget = new MWidget; QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); centralWidget->setLayout(layout); MComboBox *combobox = new MComboBox(centralWidget); combobox->setTitle(prompt); combobox->addItems(items); layout->addItem(combobox); MDialog* dialog = new MDialog(title, M::OkButton | M::CancelButton); dialog->setCentralWidget(centralWidget); connect(dialog, SIGNAL(disappeared()), SLOT(processDialogResult())); if (dialog->exec(this) == M::OkButton) return combobox->currentText(); return ""; }
QString AppWindow::getText(QString title, QString prompt, QString text) { MWidget *centralWidget = new MWidget; QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); centralWidget->setLayout(layout); MLabel *label = new MLabel(prompt, centralWidget); label->setStyleName("CommonTitleInverted"); MTextEdit *textEdit = new MTextEdit(MTextEditModel::SingleLine, text, centralWidget); layout->addItem(label); layout->addItem(textEdit); MDialog* dialog = new MDialog(title, M::OkButton | M::CancelButton); dialog->setCentralWidget(centralWidget); connect(dialog, SIGNAL(disappeared()), SLOT(processDialogResult())); if (dialog->exec(this) == M::OkButton) return textEdit->text(); return ""; }
void MSheetPrivate::appearSystemwide(MSceneWindow::DeletionPolicy policy) { Q_Q(MSheet); if (standAloneWindow == 0) { standAloneWindow = new MWindow(new MSceneManager); standAloneWindow->setRoundedCornersEnabled(true); #ifdef Q_WS_X11 appendMSheetTypePropertyToStandAloneWindow(); #endif } q->connect(q, SIGNAL(disappeared()), SLOT(_q_onStandAloneSheetDisappeared())); if (!appearSystemwideDeletionPolicy) { appearSystemwideDeletionPolicy = new MSceneWindow::DeletionPolicy; } *appearSystemwideDeletionPolicy = policy; standAloneWindow->sceneManager()->appearSceneWindowNow(q); standAloneWindow->show(); }
Notify::Notify (int displayTime, QWidget *parent) : QWidget(parent), displayTime(displayTime) { this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowSystemMenuHint| Qt::Tool | Qt::WindowStaysOnTopHint); this->setAttribute(Qt::WA_NoSystemBackground, true); this->setAttribute(Qt::WA_TranslucentBackground,true); backgroundLabel = new QLabel(this); backgroundLabel->move(0, 0); backgroundLabel->setObjectName("notify-background"); QHBoxLayout *mainLayout = new QHBoxLayout(backgroundLabel); QVBoxLayout *contentLayout = new QVBoxLayout(); iconLabel = new QLabel(backgroundLabel); iconLabel->setFixedWidth(40); iconLabel->setAlignment(Qt::AlignCenter); titleLabel = new QLabel(backgroundLabel); titleLabel->setObjectName("notify-title"); bodyLabel = new QLabel(backgroundLabel); bodyLabel->setObjectName("notify-body"); QFont font = bodyLabel->font(); font.setPixelSize(12); bodyLabel->setFont(font); contentLayout->addWidget(titleLabel); contentLayout->addWidget(bodyLabel); mainLayout->addWidget(iconLabel); mainLayout->addSpacing(5); mainLayout->addLayout(contentLayout); closeBtn = new QPushButton("×", backgroundLabel); closeBtn->setObjectName("notify-close-btn"); closeBtn->setFixedSize(24, 24); connect(closeBtn, &QPushButton::clicked, this, [this]{ Q_EMIT disappeared(); }); this->setStyleSheet("#notify-background {" "border: 1px solid #ccc;" "background:white;" "border-radius: 4px;" "} " "#notify-title{" "font-weight: bold;" "color: #333;" "font-size: 14px;" "}" "#notify-body{" "color: #444;" "}" "#notify-close-btn{ " "border: 0;" "color: #999;" "}" "#notify-close-btn:hover{ " "background: #ccc;" "}"); }