void YaTabBarBase::updateLayout() { // force re-layout QEvent e(QEvent::ActivationChange); changeEvent(&e); updateSendButton(); }
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())); }
void MainWindow::changeConnectionState(ConnectionState newState) { if(m_connectionState != newState) { m_connectionState = newState; updateConnectButton(); updateSendButton(); if(newState == ConnectionState::Connecting) { m_connectionTimeout.start(); } else { m_connectionTimeout.stop(); if(newState == ConnectionState::Disconnected) { cleanup(); } } } }