[kde-edu]: Review Request: KWordQuiz: Right Justify option for arabic

Aleks aletum at lavabit.com
Tue Jan 19 00:53:11 CET 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2646/
-----------------------------------------------------------

Review request for KDE-Edu.


Summary
-------

This patch is an endeavour to address this issue: https://bugs.kde.org/show_bug.cgi?id=175520
The Column Setting menu now has a two checkboxes, one for each column.
As for code itself, I used the KEduVocDocumen::option field to store the flag when a checkbox is triggered.
The trickiest part was to let the KWQTableDelegate::drawDisplay function know about the flag, so I utilized an unused (in this application) QStyleOptionViewItem.decorationAlignment flag Qt::AlignRight.
Thus KWQTableDelegate::paint invokes KWQTableDelegate::drawDisplay and passes this "magic" flag. This may be a confusing moment, so I'll elaborate. I might have chosen ANY QStyleOptionViewItem.decorationAlignment flag like Qt::AlignTop, the outcome would be the same.
Later on though in painter->drawText(textRect, option.displayAlignment | Qt::TextWordWrap | Qt::AlignRight, str), the flag Qt::AlignRight is used in a totally different context as it should be used.

I know this solution is far from perfect, I just tried to implement a new feature making as few changes as possible, hence such workaround.

I certainly would like to know if there was any other more efficient way to do what I did.


Diffs
-----

  /trunk/KDE/kdeedu/kwordquiz/src/columndialogbase.ui 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/dlglanguage.cpp 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwordquiz.cpp 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwqcommands.h 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwqcommands.cpp 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwqtabledelegate.cpp 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwqtablemodel.h 1076603 
  /trunk/KDE/kdeedu/kwordquiz/src/kwqtablemodel.cpp 1076603 

Diff: http://reviewboard.kde.org/r/2646/diff


Testing
-------

The only said thing that cropped up during testing is that when doing
Undo-Redo after Checking the AlignRight Box, the View area would not refresh until you put a cursor over it. This is certainly a fixable issue.
If this patch is confirmed, I will tweak everything to perfection.


Thanks,

Aleks



More information about the kde-edu mailing list