mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
рЕФАКТ
This commit is contained in:
@@ -37,6 +37,12 @@
|
|||||||
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_Main">
|
<widget class="QGroupBox" name="groupBox_Main">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Main</string>
|
<string>Main</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -72,6 +78,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_Server">
|
<widget class="QGroupBox" name="groupBox_Server">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Server</string>
|
<string>Server</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -210,6 +222,12 @@
|
|||||||
<height>58</height>
|
<height>58</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save</string>
|
<string>Save</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -243,6 +261,12 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Additional</string>
|
<string>Additional</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -257,6 +281,12 @@
|
|||||||
<height>58</height>
|
<height>58</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Version</string>
|
<string>Version</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -283,6 +313,12 @@
|
|||||||
<height>58</height>
|
<height>58</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Style</string>
|
<string>Style</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_1">
|
<widget class="QWidget" name="tab_1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
@@ -25,41 +25,41 @@ MsgWidget::~MsgWidget()
|
|||||||
|
|
||||||
void MsgWidget::setAligneAvatarLeft()
|
void MsgWidget::setAligneAvatarLeft()
|
||||||
{
|
{
|
||||||
ui->horizontalLayout->removeItem(ui->verticalLayout_2);
|
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Avatar);
|
||||||
ui->horizontalLayout->removeItem(ui->verticalLayout);
|
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Text);
|
||||||
ui->horizontalLayout->removeItem(ui->horizontalLayout_2);
|
ui->horizontalLayout_Main->removeItem(ui->horizontalLayout_Add);
|
||||||
|
|
||||||
ui->horizontalLayout->addLayout(ui->verticalLayout);
|
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Avatar);
|
||||||
ui->horizontalLayout->addLayout(ui->verticalLayout_2);
|
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Text);
|
||||||
ui->horizontalLayout->addLayout(ui->horizontalLayout_2);
|
ui->horizontalLayout_Main->addLayout(ui->horizontalLayout_Add);
|
||||||
|
|
||||||
ui->textEdit->setObjectName("MsgWidgetLocal");
|
ui->editText->setObjectName("MsgWidgetEditTextLocal");
|
||||||
ui->lbl_time->setObjectName("MsgWidgetLblTimeLocal");
|
ui->lblTime->setObjectName("MsgWidgetLblTimeLocal");
|
||||||
|
|
||||||
ui->lbl_time->setAlignment(Qt::AlignLeft);
|
ui->lblTime->setAlignment(Qt::AlignLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MsgWidget::setAligneAvatarRight()
|
void MsgWidget::setAligneAvatarRight()
|
||||||
{
|
{
|
||||||
ui->horizontalLayout->removeItem(ui->verticalLayout_2);
|
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Avatar);
|
||||||
ui->horizontalLayout->removeItem(ui->verticalLayout);
|
ui->horizontalLayout_Main->removeItem(ui->verticalLayout_Text);
|
||||||
ui->horizontalLayout->removeItem(ui->horizontalLayout_2);
|
ui->horizontalLayout_Main->removeItem(ui->horizontalLayout_Add);
|
||||||
|
|
||||||
ui->horizontalLayout->addLayout(ui->horizontalLayout_2);
|
ui->horizontalLayout_Main->addLayout(ui->horizontalLayout_Add);
|
||||||
ui->horizontalLayout->addLayout(ui->verticalLayout_2);
|
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Text);
|
||||||
ui->horizontalLayout->addLayout(ui->verticalLayout);
|
ui->horizontalLayout_Main->addLayout(ui->verticalLayout_Avatar);
|
||||||
|
|
||||||
ui->textEdit->setObjectName("MsgWidgetRemote");
|
ui->editText->setObjectName("MsgWidgetEditTextRemote");
|
||||||
ui->lbl_time->setObjectName("MsgWidgetLblTimeRemote");
|
ui->lblTime->setObjectName("MsgWidgetLblTimeRemote");
|
||||||
|
|
||||||
ui->lbl_time->setAlignment(Qt::AlignRight);
|
ui->lblTime->setAlignment(Qt::AlignRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MsgWidget::setAvatar(QString avatar)
|
void MsgWidget::setAvatar(QString avatar)
|
||||||
{
|
{
|
||||||
QPixmap pix(avatar);
|
QPixmap pix(avatar);
|
||||||
ui->label->setPixmap( pix.scaled(32,32) );
|
ui->lblAvatar->setPixmap( pix.scaled(32,32) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MsgWidget::setWidth(int width)
|
void MsgWidget::setWidth(int width)
|
||||||
@@ -70,18 +70,18 @@ void MsgWidget::setWidth(int width)
|
|||||||
|
|
||||||
void MsgWidget::setText(QString text)
|
void MsgWidget::setText(QString text)
|
||||||
{
|
{
|
||||||
ui->textEdit->setText(text);
|
ui->editText->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MsgWidget::setTime(QString timeStr)
|
void MsgWidget::setTime(QString timeStr)
|
||||||
{
|
{
|
||||||
ui->lbl_time->setText(timeStr);
|
ui->lblTime->setText(timeStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MsgWidget::on_textEdit_textChanged()
|
void MsgWidget::on_editText_textChanged()
|
||||||
{
|
{
|
||||||
QString text = ui->textEdit->toPlainText();
|
QString text = ui->editText->toPlainText();
|
||||||
QFontMetrics metricsFont(ui->textEdit->font()); //метрики шрифта
|
QFontMetrics metricsFont(ui->editText->font()); //метрики шрифта
|
||||||
|
|
||||||
//геометрические параметры текста (высота/ширина в пикселях). В одну строку
|
//геометрические параметры текста (высота/ширина в пикселях). В одну строку
|
||||||
QRect textRect = metricsFont.boundingRect(QRect(0, 0, 0, 0), 0, text);
|
QRect textRect = metricsFont.boundingRect(QRect(0, 0, 0, 0), 0, text);
|
||||||
@@ -102,20 +102,20 @@ void MsgWidget::on_textEdit_textChanged()
|
|||||||
cnt += 1;
|
cnt += 1;
|
||||||
|
|
||||||
this->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X + 20 + 30);
|
this->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X + 20 + 30);
|
||||||
ui->textEdit->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X);
|
ui->editText->setFixedHeight(textRect1str.height() * cnt + (ost? textRect1str.height() : 0) + X);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->setFixedHeight(textRect.height() + X + 20 + 30);
|
this->setFixedHeight(textRect.height() + X + 20 + 30);
|
||||||
ui->textEdit->setFixedHeight(textRect.height() + X);
|
ui->editText->setFixedHeight(textRect.height() + X);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//В одну строку
|
{//В одну строку
|
||||||
ui->textEdit->setFixedWidth(textRect.width() + X);
|
ui->editText->setFixedWidth(textRect.width() + X);
|
||||||
ui->textEdit->setFixedHeight(textRect.height() + X);
|
ui->editText->setFixedHeight(textRect.height() + X);
|
||||||
this->setFixedHeight(textRect.height() + X + 20 + 30);
|
this->setFixedHeight(textRect.height() + X + 20 + 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public:
|
|||||||
void setTime(QString timeStr);
|
void setTime(QString timeStr);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_textEdit_textChanged();
|
void on_editText_textChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MsgWidget *ui;
|
Ui::MsgWidget *ui;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>212</height>
|
<height>233</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_Main">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_Avatar">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="lblAvatar">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>32</width>
|
<width>32</width>
|
||||||
@@ -38,13 +38,19 @@
|
|||||||
<height>32</height>
|
<height>32</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>TextLabel</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer_Avatar">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -59,15 +65,21 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_Text">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="textEdit">
|
<widget class="QTextEdit" name="editText">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -80,7 +92,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="lbl_time">
|
<widget class="QLabel" name="lblTime">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Tahoma</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>--:--</string>
|
<string>--:--</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -89,9 +107,9 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_Add">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer_Add">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user