// Start constructor SwitchDialog SwitchDialog::SwitchDialog(QWidget *parent) { // INIT vars isClicked = false; // Create buttons label = new QLabel(tr("Change/flip object? ")); btn_yes = new QPushButton(tr("Yes")); btn_no = new QPushButton(tr("No")); btn_no->setDefault(true); // If clicked connections connect(btn_yes, SIGNAL(clicked()), this, SLOT(yesClicked())); connect(btn_no, SIGNAL(clicked()), this, SLOT(close())); // Layout layout_text = new QHBoxLayout(); layout_text->addWidget(label); layout_btn = new QVBoxLayout(); layout_btn->addWidget(btn_yes); layout_btn->addWidget(btn_no); layout_btn->addStretch(); layout_main = new QHBoxLayout(); layout_main->addLayout(layout_text); layout_main->addLayout(layout_btn); setLayout(layout_main); setWindowTitle("Change?"); setFixedHeight(sizeHint().height()); }// End constructor SwitchDialog
RecordConfirmationDialog::RecordConfirmationDialog(const QString &sn, const QString &displayName) : IconDialogBase(tr("Recording confirmation"), QStyle::SP_MessageBoxQuestion), skypeName(sn) { QLabel *label = new QLabel(tr("%1 has started recording the call with <b>%2</b> (%3).<br>" "Do you wish to continue recording or shall it stop and delete the file?").arg(PROGRAM_NAME, skypeName, displayName)); vbox->addWidget(label); vbox->addSpacing(10); remember = new QCheckBox(tr("&Automatically perform this action on the next call with %1").arg(skypeName)); remember->setEnabled(false); widgets.append(remember); vbox->addWidget(remember); hbox->addStretch(1); QPushButton *button = new QPushButton(tr("&Continue recording")); button->setEnabled(false); button->setDefault(true); button->setMinimumWidth(180); widgets.append(button); connect(button, SIGNAL(clicked()), this, SLOT(yesClicked())); hbox->addWidget(button); button = new QPushButton(tr("&Stop recording and delete")); button->setEnabled(false); button->setMinimumWidth(180); widgets.append(button); connect(button, SIGNAL(clicked()), this, SLOT(noClicked())); hbox->addWidget(button); hbox->addStretch(1); connect(this, SIGNAL(rejected()), this, SIGNAL(no())); QTimer::singleShot(1000, this, SLOT(enableWidgets())); show(); raise(); activateWindow(); }
void MirrorAddDlg::init() { setCaption(i18n("Add mirror")); QWidget *widget = new QWidget(this); ui.setupUi(widget); setMainWidget(widget); if (m_countryModel) { ui.location->setModel(m_countryModel); ui.location->setCurrentIndex(-1); } setButtons(KDialog::Yes | KDialog::Cancel); setButtonGuiItem(KDialog::Yes, KStandardGuiItem::add()); updateButton(); connect(ui.url, SIGNAL(textChanged(QString)), this, SLOT(updateButton(QString))); connect(this, SIGNAL(yesClicked()), this, SLOT(addMirror())); }
int SMEngine::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: showMe(); break; case 1: setLabel((*reinterpret_cast< QString(*)>(_a[1]))); break; case 2: setWidget((*reinterpret_cast< QWidget*(*)>(_a[1]))); break; case 3: setLayout((*reinterpret_cast< QLayout*(*)>(_a[1]))); break; case 4: breakIsOver(); break; case 5: yesClicked(); break; case 6: noClicked(); break; case 7: confirnClicked(); break; case 8: skipClicked(); break; case 9: createGuiWithList((*reinterpret_cast< QList<QMap<QString,QString> >*(*)>(_a[1]))); break; case 10: createInputGuiWithDataSet((*reinterpret_cast< QMap<QString,QString>(*)>(_a[1]))); break; case 11: repaintGui(); break; case 12: changeWidget((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break; case 13: changeWidget((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 14: parseXMLFile((*reinterpret_cast< QString(*)>(_a[1]))); break; case 15: showInfoWidget((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 16: showInputWidget(); break; case 17: addLayout(); break; case 18: addWidgetToLayout((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break; case 19: addWidgetToLayout((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 20: toggleFirstUse((*reinterpret_cast< bool(*)>(_a[1]))); break; case 21: finished(); break; case 22: executeSpec((*reinterpret_cast< QString(*)>(_a[1]))); break; case 23: acceptButton(); break; case 24: saveToDom((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 25: timeOut(); break; case 26: emitClickSignal((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } _id -= 27; } return _id; }
bool BTRecvQueryDialogWidget::constructDialog(const QVariantMap ¶meters) { mLoader = new HbDocumentLoader(); bool ok = false; mLoader->load(DOCML_BT_RECV_QUERY_DIALOG, &ok); if(ok) { mDialog = qobject_cast<HbDialog*>(mLoader->findWidget("receiveAuthorizationDialog")); mHeading = qobject_cast<HbLabel*>(mLoader->findWidget("receiveAuthorizationHeading")); mDeviceName = qobject_cast<HbLabel*>(mLoader->findWidget("deviceName")); mDeviceType = qobject_cast<HbLabel*>(mLoader->findWidget("deviceType")); mDeviceIcon = qobject_cast<HbLabel*>(mLoader->findWidget("deviceIcon")); int classOfDevice = parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceClass)).toDouble(); HbIcon icon = getBadgedDeviceTypeIcon(classOfDevice); mDeviceIcon->setIcon(icon); mDeviceName->setPlainText(parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceName)).toString()); mDeviceType->setPlainText(getDeviceTypeString(classOfDevice)); mYesAction = qobject_cast<HbAction*>(mLoader->findObject("yesAction")); mNoAction = qobject_cast<HbAction*>(mLoader->findObject("noAction")); mAuthorizeUser = qobject_cast<HbCheckBox*>(mLoader->findWidget("authorizeUser")); int dialogType = parameters.value(QString::number(TBluetoothDialogParams::EDialogTitle)).toInt(); switch(dialogType) { case TBluetoothDialogParams::EReceive: { mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from")); }break; case TBluetoothDialogParams::EReceiveFromPairedDevice: { mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from_paired_device")); mAuthorizeUser->setCheckState(Qt::Checked); }break; case TBluetoothDialogParams::EConnect: { mHeading->setPlainText(hbTrId("txt_bt_title_connect_to")); mAuthorizeUser->setCheckState(Qt::Checked); }break; case TBluetoothDialogParams::EPairingRequest: mHeading->setPlainText(hbTrId("txt_bt_title_pair_with")); mAuthorizeUser->setCheckState(Qt::Checked); break; default: break; } mDialog->setHeadingWidget(mHeading); } mDialog->setBackgroundFaded(false); mDialog->setDismissPolicy(HbPopup::NoDismiss); mDialog->setTimeout(HbPopup::NoTimeout); connect(mYesAction, SIGNAL(triggered()), this, SLOT(yesClicked())); connect(mNoAction, SIGNAL(triggered()), this, SLOT(noClicked())); connect(mAuthorizeUser, SIGNAL(clicked(bool)), this, SLOT(checkBoxStateChanged(bool))); return true; }