bool Form1::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: init_var(); break; case 1: btnConnect_clicked(); break; case 2: onReceive(); break; case 3: btnInit_clicked(); break; case 4: btnSave_clicked(); break; case 5: languageChange(); break; case 6: onTimer(); break; default: return QDialog::qt_invoke( _id, _o ); } return TRUE; }
void lmcChatRoomWindow::createToolBar(void) { QToolBar* pLeftBar = new QToolBar(ui.wgtToolBar); pLeftBar->setStyleSheet("QToolBar { border: 0px }"); pLeftBar->setIconSize(QSize(16, 16)); ui.toolBarLayout->addWidget(pLeftBar); pFontAction = pLeftBar->addAction(QIcon(QPixmap(IDR_FONT, "PNG")), "Change Font...", this, SLOT(btnFont_clicked())); pFontColorAction = pLeftBar->addAction(QIcon(QPixmap(IDR_FONTCOLOR, "PNG")), "Change Color...", this, SLOT(btnFontColor_clicked())); pLeftBar->addSeparator(); pbtnSmiley = new lmcToolButton(pLeftBar); pbtnSmiley->setIcon(QIcon(QPixmap(IDR_SMILEY, "PNG"))); pbtnSmiley->setPopupMode(QToolButton::InstantPopup); pbtnSmiley->setMenu(pSmileyMenu); pLeftBar->addWidget(pbtnSmiley); pLeftBar->addSeparator(); pSaveAction = pLeftBar->addAction(QIcon(QPixmap(IDR_SAVE, "PNG")), "&Save As...", this, SLOT(btnSave_clicked())); pSaveAction->setShortcut(QKeySequence::Save); pSaveAction->setEnabled(false); ui.lblDividerTop->setBackgroundRole(QPalette::Light); ui.lblDividerTop->setAutoFillBackground(true); ui.lblDividerBottom->setBackgroundRole(QPalette::Dark); ui.lblDividerBottom->setAutoFillBackground(true); if(groupMode) { QToolBar* pContactsBar = new QToolBar(ui.wgtContactsBar); pContactsBar->setStyleSheet("QToolBar { border: 0px }"); pContactsBar->setIconSize(QSize(24, 24)); ui.contactsBarLayout->addWidget(pContactsBar); addContactAction = pContactsBar->addAction(QIcon(QPixmap(IDR_ADDCONTACT, "PNG")), "&Add Contacts...", this, SLOT(addContactAction_triggered())); QToolButton* pButton = (QToolButton*)pContactsBar->widgetForAction(addContactAction); pButton->setAutoRaise(false); } }