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); Q_UNUSED(event);
QPainter painter(this->viewport()); QPainter painter(this->viewport());
painter.setFont(font()); painter.setFont(font());
painter.setLayoutDirection(Qt::LayoutDirectionAuto);
auto viewableRowsCount = getViewableRowsCount(); auto viewableRowsCount = getViewableRowsCount();
int scrollValue = -horizontalScrollBar()->value(); int scrollValue = -horizontalScrollBar()->value();

View File

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

View File

@ -20,6 +20,7 @@ CPUWidget::CPUWidget(Architecture* architecture, QWidget* parent)
mArchitecture(architecture) mArchitecture(architecture)
{ {
ui->setupUi(this); ui->setupUi(this);
setLayoutDirection(Qt::LeftToRight);
setDefaultDisposition(); setDefaultDisposition();
setStyleSheet("AbstractTableView:focus, CPURegistersView:focus, CPUSideBar:focus { border: 1px solid #000000; }"); 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); Q_UNUSED(event);
QPainter p(this->viewport()); QPainter p(this->viewport());
p.setFont(this->font()); p.setFont(this->font());
p.setLayoutDirection(Qt::LayoutDirectionAuto);
int xofs = this->horizontalScrollBar()->value(); int xofs = this->horizontalScrollBar()->value();
int yofs = this->verticalScrollBar()->value(); int yofs = this->verticalScrollBar()->value();

View File

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

View File

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

View File

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