Beispiel #1
0
int StatusWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: on_baseOffsetBox_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: on_referenceAltitudeBox_editingFinished(); break;
        case 2: on_enableAccelBox_clicked(); break;
        case 3: on_enableBaroBox_clicked(); break;
        case 4: on_enableGPSBox_clicked(); break;
        case 5: on_sendButton_clicked(); break;
        case 6: requestBarometerData(); break;
        case 7: gotBaseBarometerData((*reinterpret_cast< unsigned short(*)>(_a[1])),(*reinterpret_cast< ulong(*)>(_a[2]))); break;
        case 8: gotBasePressure((*reinterpret_cast< ulong(*)>(_a[1]))); break;
        case 9: gotRoverPitch((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 10: gotRoverRoll((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 11: gotRoverPressure((*reinterpret_cast< ulong(*)>(_a[1]))); break;
        case 12: gotRoverTemperature((*reinterpret_cast< short(*)>(_a[1]))); break;
        case 13: gotRoverAltitude((*reinterpret_cast< double(*)>(_a[1])),(*reinterpret_cast< double(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 14;
    }
    return _id;
}
PanelMonitor::PanelMonitor(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PanelMonitor)
{
    ui->setupUi(this);
    ui->console->setReadOnly(true);
    ui->console->setMaximumBlockCount(1024);
    ui->console->setWordWrapMode(QTextOption::NoWrap);
    connect(ui->commandLine, SIGNAL(returnPressed()), this, SLOT(on_sendButton_clicked()));
    connect(this, SIGNAL(initializePanel(QMap<QString,QString>)), this, SLOT(initialize(QMap<QString,QString>)));
    connect(this, SIGNAL(messageIn(QByteArray)), this, SLOT(parseMessage(QByteArray)));
    connect(this, SIGNAL(connectionState(bool)), this, SLOT(updateConnectionState(bool)));
}
Beispiel #3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    updateConnectButton();
    updateSendButton();

    m_connectionTimeout.setInterval(5000);
    m_connectionTimeout.setSingleShot(true);
    connect(&m_connectionTimeout, SIGNAL(timeout()), this, SLOT(onConnectTimeout()));

    ChatInputSendFilter * sendFilter = new ChatInputSendFilter(this);
    connect(sendFilter, SIGNAL(sendPressed()), this, SLOT(on_sendButton_clicked()));
    ui->sayLineEdit->installEventFilter(sendFilter);

    connect(ui->actionSave_chat_as_HTML_page, SIGNAL(triggered(bool)), this, SLOT(onSaveChat()));
}
MessagePage::MessagePage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MessagePage),
    model(0),
    msgdelegate(new MessageViewDelegate())
{
    ui->setupUi(this);
   
    
#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
    ui->deleteButton->setIcon(QIcon());
#endif
    // Context menu actions
    replyAction           = new QAction(ui->sendButton->text(),            this);
    deleteAction          = new QAction(ui->deleteButton->text(),          this);

    // Build context menu
    contextMenu = new QMenu();

    contextMenu->addAction(replyAction);
    contextMenu->addAction(deleteAction);

    connect(replyAction,           SIGNAL(triggered()), this, SLOT(on_sendButton_clicked()));
    connect(deleteAction,          SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked()));

    //Build second context menu
    contextMenu2 = new QMenu();

    copyAction = new QAction(tr("&Copy"), this);

    contextMenu2->addAction(copyAction);

    connect(copyAction, SIGNAL(triggered()), this, SLOT(copy_clicked()));

    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
    connect(ui->listConversation, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu2(QPoint)));

    // Show Messages
    ui->listConversation->setItemDelegate(msgdelegate);
    ui->listConversation->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
    ui->listConversation->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
    ui->listConversation->setAttribute(Qt::WA_MacShowFocusRect, false);
}
int MoodBox::DrawingWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clipartWindowRequest(); break;
        case 1: messageSent(); break;
        case 2: replyChanged(); break;
        case 3: clear(); break;
        case 4: reset(); break;
        case 5: addImage((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 6: addReply((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 7: on_penToolButton_clicked(); break;
        case 8: on_simplebrushToolButton_clicked(); break;
        case 9: on_oilbrushToolButton_clicked(); break;
        case 10: on_sprayToolButton_clicked(); break;
        case 11: on_eraserToolButton_clicked(); break;
        case 12: on_textToolButton_clicked(); break;
        case 13: on_picturesToolButton_clicked(); break;
        case 14: on_sendButton_clicked(); break;
        case 15: onItemAdded((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 16: onItemRemoved((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 17: onSceneCleared(); break;
        case 18: onSaveScene(); break;
        case 19: onSceneColorChanged(); break;
        case 20: onUndoChanged(); break;
        case 21: onContactListChanged(); break;
        case 22: onContactAuthorizationChanged((*reinterpret_cast< qint32(*)>(_a[1]))); break;
        case 23: onUserOnlineChanged(); break;
        default: ;
        }
        _id -= 24;
    }
    return _id;
}
Beispiel #6
0
ClientWindow::ClientWindow()
{
	QHBoxLayout* mainLayout = new QHBoxLayout;
	QVBoxLayout* verticalLayout_2 = new QVBoxLayout;
	QHBoxLayout* horizontalLayout = new QHBoxLayout;

	// Clients list
	QListView* list = new QListView;
    model = new QStringListModel(clientsList);

	list->setEditTriggers(QAbstractItemView::NoEditTriggers);
	list->setModel(model);


	QLabel* label = new QLabel("Server's IP :");

	IPServer = new QLineEdit("127.0.0.1");
	IPServer->setMaximumSize(150, 16777215);

	QLabel* label_2 = new QLabel("Server's port :");

	serverPort = new QSpinBox;
	serverPort->setMinimumSize(60, 0);
	serverPort->setMinimum(1024);
	serverPort->setMaximum(65535);
	serverPort->setValue(50885);

	connectionButton = new QPushButton("Connect");
	connect(connectionButton, SIGNAL(clicked()), this, SLOT(on_connectionButton_clicked()));

	horizontalLayout->addWidget(label);
	horizontalLayout->addWidget(IPServer);
	horizontalLayout->addWidget(label_2);
	horizontalLayout->addWidget(serverPort);
	horizontalLayout->addWidget(connectionButton);

	messageList = new QTextEdit;
	messageList->setReadOnly(true);

	QHBoxLayout* horizontalLayout_2 = new QHBoxLayout;

	QLabel* label_3 = new QLabel("Username :"******"Message :");

	message = new QLineEdit;

	sendButton = new QPushButton("Send");
	connect(sendButton, SIGNAL(clicked()), this, SLOT(on_sendButton_clicked()));
	
	sendFileButton = new QPushButton("Send a file");
	connect(sendFileButton, SIGNAL(clicked()), this, SLOT(on_sendFileButton_clicked()));

	horizontalLayout_2->addWidget(label_3);
	horizontalLayout_2->addWidget(username);
	horizontalLayout_2->addWidget(label_4);
	horizontalLayout_2->addWidget(message);
	horizontalLayout_2->addWidget(sendButton);
	horizontalLayout_2->addWidget(sendFileButton);

	verticalLayout_2->addLayout(horizontalLayout);
	verticalLayout_2->addWidget(messageList);
	verticalLayout_2->addLayout(horizontalLayout_2);

	mainLayout->addWidget(list);
	mainLayout->addLayout(verticalLayout_2);

	setLayout(mainLayout);
}
Beispiel #7
0
void ClientWindow::on_message_returnPressed() {
	// Pressing Enter has the same effect as clicking the "Send" button
	on_sendButton_clicked();
}
ChatWindow::ChatWindow(QListWidgetItem *item, MainWindow *parent):
    QMainWindow(parent),
    username(CommonElements::getInstance()->getUsername()),
    item(item),
    friendName(item->text().left(item->text().size() - 4)),
    friendHead(new QLabel(this)),
    friendnameLabel(new QLabel(this)),
    messageEdit(new QTextEdit(this)),
    sendEdit(new QTextEdit(this)),
    sendButton(new QPushButton(this)),
    picButton(new QPushButton(this)),
    expressButton(new QPushButton(this)),
    filButton(new QPushButton(this)),
    closeButton(new CloseButton(this)),
    minButton(new MiniumButton(this)),
    trueImage(new QCheckBox(this)),
    manager(0),
    recmanager(0),
    filemanager(0),
    dmanager(0),
    pressed(false),
    expDialog(0)
{

    this->setWindowFlags(Qt::FramelessWindowHint/* | Qt::Tool*/ | Qt::X11BypassWindowManagerHint);

    this->setMinimumSize(800, 600);
    this->setMaximumSize(800, 600);

    QLinearGradient linearGradient(QPoint(0, 0), QPoint(0, 600));
    linearGradient.setColorAt(0, QColor(133, 218, 223));
    linearGradient.setColorAt(1, QColor(255, 255, 255));

    QPalette palette;
    palette.setBrush(QPalette::Background, QBrush(linearGradient));
    this->setPalette(palette);

    QFont font;
    font.setPointSize(16);

    this->setWindowTitle(this->friendName);

    this->sendButton->setText("发送");
    this->trueImage->setText("显示原图");

    this->trueImage->setChecked(false);

    this->messageEdit->setReadOnly(true);

    this->friendHead->setGeometry(60, 32, 48, 48);
    this->friendnameLabel->setGeometry(120,32, 200, 48);
    this->messageEdit->setGeometry(50, 85, 700, 285);
    this->sendEdit->setGeometry(50, 420, 700, 120);
    this->sendButton->setGeometry(710, 550, 60, 30);
    this->picButton->setGeometry(90, 380, 30, 30);
    this->expressButton->setGeometry(50, 380, 30, 30);
    this->filButton->setGeometry(130, 380, 30, 30);
    this->closeButton->setGeometry(770, 0, 30, 30);
    this->minButton->setGeometry(740, 0, 30, 30);
    this->trueImage->setGeometry(170, 380, 80, 30);

    QImage head(":/images/photo");
    head.scaled(48, 48, Qt::KeepAspectRatio);
    this->friendHead->setScaledContents(true);
    this->friendHead->setPixmap(QPixmap::fromImage(head));
    this->friendnameLabel->setText(this->friendName);
    this->friendnameLabel->setFont(font);

    font.setPointSize(10);
    this->messageEdit->setFont(font);

    this->expressButton->setStyleSheet("QPushButton{border-image:url(:/images/expression);}"
                                       "QPushButton:hover{border-image:url(:/images/expression_1);}"
                                       "QPushButton:pressed{border-image:url(:/images/expression_2);}");
    this->picButton->setStyleSheet("QPushButton{border-image:url(:/images/pic_0);}"
                                   "QPushButton:hover{border-image:url(:/images/pic_1);}"
                                   "QPushButton:pressed{border-image:url(:/images/pic_2);}");
    this->filButton->setStyleSheet("QPushButton{border-image:url(:/images/file);}"
                                   "QPushButton:hover{border-image:url(:/images/file_1);}"
                                   "QPushButton:pressed{border-image:url(:/images/file_2);}");

    connect(this->sendButton, SIGNAL(clicked()), this, SLOT(on_sendButton_clicked()));
    connect(this->picButton, SIGNAL(clicked()), this, SLOT(on_picButton_clicked()));
    connect(this->closeButton, SIGNAL(clicked()), this, SLOT(on_closeButton_clicked()));
    connect(this->minButton, SIGNAL(clicked()), this, SLOT(on_minButton_clicked()));
    connect(this->expressButton, SIGNAL(clicked()), this, SLOT(on_expressButton_clicked()));
    connect(this->filButton, SIGNAL(clicked()), this, SLOT(on_filButton_clicked()));

    expMap.insert("huaji", "(#滑稽)");
    expMap.insert("dahan", "(#大汗)");
    expMap.insert("fennu", "(#愤怒)");
    expMap.insert("guaiqiao", "(#乖巧)");
    expMap.insert("hecha", "(#喝茶)");
    expMap.insert("kaixin", "(#开心)");
    expMap.insert("penshui", "(#喷水)");
    expMap.insert("weixiao", "(#微笑)");
    expMap.insert("yinxian", "(#阴险)");

    dPath = QDir::currentPath() + "/headImages/head_" + this->friendName + ".png";
    updateFriendHead();

    Database *db = Database::getInstance("");

    db->loadMessage(this, this->friendName);

}