diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index 782e541fd..90edf8fc8 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -25,16 +25,16 @@ FriendWidget::FriendWidget(int FriendId, QString id) : friendId(FriendId) { - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - this->setMouseTracking(true); - this->setAutoFillBackground(true); - this->setFixedHeight(55); - this->setLayout(&layout); + setMouseTracking(true); + setAutoFillBackground(true); + setFixedHeight(55); + setLayout(&layout); layout.setSpacing(0); layout.setMargin(0); layout.setStretchFactor(this, 100); textLayout.setSpacing(0); textLayout.setMargin(0); + setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft avatar.setPixmap(QPixmap(":img/contact.png")); name.setText(id); diff --git a/widget/groupwidget.cpp b/widget/groupwidget.cpp index 7a138e28a..ac0608b1b 100644 --- a/widget/groupwidget.cpp +++ b/widget/groupwidget.cpp @@ -24,14 +24,15 @@ GroupWidget::GroupWidget(int GroupId, QString Name) : groupId{GroupId} { - this->setMouseTracking(true); - this->setAutoFillBackground(true); - this->setLayout(&layout); - this->setFixedHeight(55); + setMouseTracking(true); + setAutoFillBackground(true); + setLayout(&layout); + setFixedHeight(55); layout.setSpacing(0); layout.setMargin(0); textLayout.setSpacing(0); textLayout.setMargin(0); + setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft avatar.setPixmap(QPixmap(":img/group.png")); statusPic.setPixmap(QPixmap(":img/status/dot_online.png")); diff --git a/widget/widget.cpp b/widget/widget.cpp index 38c047259..0b1a4ba51 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -118,6 +118,7 @@ Widget::Widget(QWidget *parent) friendListWidget->layout()->setMargin(0); friendListWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); ui->friendList->setWidget(friendListWidget); + ui->friendList->setLayoutDirection(Qt::RightToLeft); // delay setting username and message until Core inits //ui->nameLabel->setText(core->getUsername());