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