Merge pull request #3439 from torusrxxx/patch000000e1

Use LayoutDirectionAuto to fix RTL issues
This commit is contained in:
Duncan Ogilvie 2024-10-07 16:00:44 +02:00 committed by GitHub
commit 3a9883edb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 0 deletions

View File

@ -197,6 +197,7 @@ void AbstractTableView::paintEvent(QPaintEvent* event)
Q_UNUSED(event);
QPainter painter(this->viewport());
painter.setFont(font());
painter.setLayoutDirection(Qt::LayoutDirectionAuto);
auto viewableRowsCount = getViewableRowsCount();
int scrollValue = -horizontalScrollBar()->value();

View File

@ -1839,6 +1839,7 @@ void Disassembly::paintEvent(QPaintEvent* event)
// Delay paint the rich text
QPainter painter(this->viewport());
painter.setFont(font());
painter.setLayoutDirection(Qt::LayoutDirectionAuto);
int x = -horizontalScrollBar()->value();
for(int column = 0; column < (int)mRichText.size(); column++)

View File

@ -20,6 +20,7 @@ CPUWidget::CPUWidget(Architecture* architecture, QWidget* parent)
mArchitecture(architecture)
{
ui->setupUi(this);
setLayoutDirection(Qt::LeftToRight);
setDefaultDisposition();
setStyleSheet("AbstractTableView:focus, CPURegistersView:focus, CPUSideBar:focus { border: 1px solid #000000; }");

View File

@ -813,6 +813,7 @@ void DisassemblerGraphView::paintEvent(QPaintEvent* event)
Q_UNUSED(event);
QPainter p(this->viewport());
p.setFont(this->font());
p.setLayoutDirection(Qt::LayoutDirectionAuto);
int xofs = this->horizontalScrollBar()->value();
int yofs = this->verticalScrollBar()->value();

View File

@ -60,6 +60,7 @@ void DisassemblyPopup::paintEvent(QPaintEvent* event)
QRect viewportRect(0, 0, width(), height());
QPainter p(this);
p.setFont(font());
p.setLayoutDirection(Qt::LayoutDirectionAuto);
// Render background
p.fillRect(viewportRect, mDisassemblyBackgroundColor);

View File

@ -688,6 +688,7 @@ void QHexEditPrivate::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
painter.setFont(font());
painter.setLayoutDirection(Qt::LayoutDirectionAuto);
painter.fillRect(event->rect(), _backgroundColor);

View File

@ -18,6 +18,7 @@ TraceWidget::TraceWidget(Architecture* architecture, const QString & fileName, Q
ui(new Ui::TraceWidget)
{
ui->setupUi(this);
setLayoutDirection(Qt::LeftToRight);
setCursor(QCursor(Qt::CursorShape::WaitCursor));
mTraceFile = new TraceFileReader(this);