void teacherChatMain::initialize( void )
{
}
void teacherChatMain::startWorking( void )
{
winChatWidget->setMaximumWidth(350);
stuNameLbl
= new QLabel("",winChatWidget
);
stuNameLbl->setMinimumSize(368,20);
gridLayout->addWidget(stuNameLbl, 0, 0, 0, 1);
closeBt->setFixedSize(20, 20);
closeBt
->setIcon
(QIcon(":/resources/cancelar.png"));
closeBt
->setIconSize
(QSize(16,
16));
gridLayout->addWidget(closeBt, 0, 2);
textEdit->setFocusPolicy(Qt::NoFocus);
textEdit->setMinimumSize(394,450);
gridLayout->addWidget(textEdit, 1, 0, 1, 1);
messageLbl
= new QLabel(tr
("Mensagem: "),winChatWidget
);
messageLbl->setMinimumWidth(80);
messageLbl->setMaximumWidth(80);
gridLayout->addWidget(messageLbl, 2, 0);
lineEdit->setFocusPolicy(Qt::StrongFocus);
lineEdit->setMinimumSize(307,20);
gridLayout->addWidget(lineEdit, 2, 1);
closeBt->setVisible(false);
stuNameLbl->setVisible(false);
tableFormat.setBorder(0);
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressedFunc()));
winChatWidget->setLayout(gridLayout);
setTeacherName(_parent->getTeacherName());
setActive(false);
stGridDlg = new studentsGridDialog(this, studentsScrollArea,_parent->getLoggedStudents(), _parent->getTeacherName(), windowChatScrollArea);
QObject::connect(stGridDlg,
SIGNAL(newMessageReceived
()),
this,
SLOT(newMessageReceived
()));
contentsLayout->addWidget(studentsScrollArea,0,0);
contentsLayout->addWidget(winChatWidget,0,1);
scrollArea->setLayout(contentsLayout);
}
void teacherChatMain::initialize( void )
{
scrollArea = new QScrollArea();
}
void teacherChatMain::startWorking( void )
{
winChatWidget = new QWidget;
winChatWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
winChatWidget->setMaximumWidth(350);
gridLayout = new QGridLayout;
stuNameLbl = new QLabel("",winChatWidget);
stuNameLbl->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
stuNameLbl->setMinimumSize(368,20);
gridLayout->addWidget(stuNameLbl, 0, 0, 0, 1);
closeBt = new QPushButton(winChatWidget);
closeBt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
closeBt->setFixedSize(20, 20);
closeBt->setIcon(QIcon(":/resources/cancelar.png"));
closeBt->setIconSize(QSize(16, 16));
gridLayout->addWidget(closeBt, 0, 2);
textEdit = new QTextEdit(winChatWidget);
textEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
textEdit->setFocusPolicy(Qt::NoFocus);
textEdit->setMinimumSize(394,450);
gridLayout->addWidget(textEdit, 1, 0, 1, 1);
messageLbl = new QLabel(tr("Mensagem: "),winChatWidget);
messageLbl->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
messageLbl->setMinimumWidth(80);
messageLbl->setMaximumWidth(80);
gridLayout->addWidget(messageLbl, 2, 0);
lineEdit = new QLineEdit(winChatWidget);
messageLbl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
lineEdit->setFocusPolicy(Qt::StrongFocus);
lineEdit->setMinimumSize(307,20);
gridLayout->addWidget(lineEdit, 2, 1);
closeBt->setVisible(false);
stuNameLbl->setVisible(false);
tableFormat.setBorder(0);
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressedFunc()));
winChatWidget->setLayout(gridLayout);
setTeacherName(_parent->getTeacherName());
setActive(false);
connect(this, SIGNAL(newMessage(QString,QString)),
this, SLOT(appendMessage(QString,QString)));
stGridDlg = new studentsGridDialog(this, studentsScrollArea,_parent->getLoggedStudents(), _parent->getTeacherName(), windowChatScrollArea);
QObject::connect(stGridDlg, SIGNAL(newMessageReceived()), this, SLOT(newMessageReceived()));
connect(this, SIGNAL(returnPressedMsg(QString, QString)), stGridDlg, SIGNAL(returnPressedSignal(QString, QString)));
contentsLayout->addWidget(studentsScrollArea,0,0);
contentsLayout->addWidget(winChatWidget,0,1);
scrollArea->setLayout(contentsLayout);
}
To copy to clipboard, switch view to plain text mode
Bookmarks