Clock::Clock(QObject *parent) : PlexyDesk::ControllerInterface (parent) { clock = new ClockWidget(QRectF(0, 0, 210, 210)); if (connectToDataSource("timerengine")) { connect(dataSource(), SIGNAL(sourceUpdated(QVariantMap)), this, SLOT(onDataUpdated(QVariantMap))); } }
TextChatWidgetItem::TextChatWidgetItem(Contact* contact, ContactIdWithMessageId const& senderAndMessageId, QString const& message, QWidget *parent) : ChatWidgetItem(contact, senderAndMessageId, parent), ui(new Ui::TextChatWidgetItem), message(message) { ui->setupUi(this); QSizePolicy sp = this->sizePolicy(); sp.setHeightForWidth(true); this->setSizePolicy(sp); ui->lblMessageText->setText(preprocessLinks(message)); ui->lblMessageText->setWordWrap(true); ui->lblFromTime->setWordWrap(true); onDataUpdated(); }
LocationChatWidgetItem::LocationChatWidgetItem(Contact* contact, ContactIdWithMessageId const& senderAndMessageId, QDateTime const& timeSend, QDateTime const& timeReceived, double latitude, double longitude, double height, QString const& description, QWidget *parent) : ChatWidgetItem(contact, senderAndMessageId, timeSend, timeReceived, parent), ui(new Ui::LocationChatWidgetItem), latitude(latitude), longitude(longitude), height(height), description(description) { ui->setupUi(this); QSizePolicy sp = this->sizePolicy(); sp.setHeightForWidth(true); this->setSizePolicy(sp); QString const locationUrl = QString(QStringLiteral("https://maps.google.com/?q=%1,%2")).arg(latitude).arg(longitude); ui->lblMessageText->setText(QString("Location: <a href=\"%1\">%1</a> - %2").arg(locationUrl).arg(description)); ui->lblMessageText->setWordWrap(true); ui->lblFromTime->setWordWrap(true); onDataUpdated(); }
AuthPlugin::AuthPlugin(QObject *object) : PlexyDesk::ControllerInterface (object) { mWidget = new PlexyDesk::AuthWidget(QRectF(0, 0, 480, 320)); mWidget->setController(this); mWidget->setVisible(false); connect(mWidget, SIGNAL(facebookToken(QString)), this, SLOT(onFacebookToken(QString))); mContactUI = new FacebookContactUI(QRectF(0.0, 0.0, 488.0, 320.0)); mContactUI->setController(this); mContactUI->setVisible(true); if (connectToDataSource("facebookengine")) { connect(dataSource(), SIGNAL(sourceUpdated(QVariantMap)), this, SLOT(onDataUpdated(QVariantMap))); } }
std::shared_ptr<Connection> FlowScene:: restoreConnection(Properties const &p) { QUuid nodeInId; QUuid nodeOutId; p.get("in_id", &nodeInId); p.get("out_id", &nodeOutId); PortIndex portIndexIn; PortIndex portIndexOut; p.get("in_index", &portIndexIn); p.get("out_index", &portIndexOut); auto nodeIn = _nodes[nodeInId]; auto nodeOut = _nodes[nodeOutId]; auto connection = std::make_shared<Connection>(nodeIn, portIndexIn, nodeOut, portIndexOut); auto cgo = std::make_unique<ConnectionGraphicsObject>(*this, connection); nodeIn->nodeState().setConnection(PortType::In, portIndexIn, connection); nodeOut->nodeState().setConnection(PortType::Out, portIndexOut, connection); // trigger data propagation nodeOut->onDataUpdated(portIndexOut); // after this function connection points are set to node port connection->setGraphicsObject(std::move(cgo)); _connections[connection->id()] = connection; return connection; }
SmsView::SmsView(QWidget *parent) : QWidget(parent), ui(new Ui::SmsView) { ui->setupUi(this); QVBoxLayout *layout = new QVBoxLayout(); m_pagger = new PageWidget(3,this); connect(m_pagger, SIGNAL(currentPageChanged(int)), this, SLOT(onPageChanged(int))); layout->addWidget(m_pagger); m_smsView = new QTableView(this); m_smsView->horizontalHeader()->setStyleSheet("QHeaderView::section{background:skyblue;}"); layout->addWidget(m_smsView); QToolButton *btnGo = new QToolButton(this); btnGo->setText("Send SMS"); btnGo->setIcon(QIcon(":/icon/icon/send_sms.png")); btnGo->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); btnGo->setIconSize(QSize(32, 32)); layout->addWidget(btnGo); connect(btnGo,SIGNAL(clicked()),this, SLOT(onSendSMS())); setLayout(layout); m_model = new SmsTableModel(this); m_smsView->setModel(m_model); m_smsView->verticalHeader()->hide(); m_smsView->setColumnHidden(0,true); m_smsView->setColumnHidden(5,true); onDataUpdated(); }
void SmsView::onPageChanged(int page) { m_curPage = page; onDataUpdated(); }