Move wx<->Qt alignment conversion functions to the top

No real changes, this is just a refactoring in preparation for the
future changes (use "git show --color-moved" to view the diff).
This commit is contained in:
Vadim Zeitlin
2019-09-14 23:52:22 +02:00
parent 8adcb899cb
commit 47e3813d91

View File

@@ -26,6 +26,39 @@
#include "wx/qt/private/winevent.h"
#include "wx/qt/private/treeitemfactory.h"
namespace
{
Qt::AlignmentFlag wxQtConvertTextAlign(wxListColumnFormat align)
{
switch (align)
{
case wxLIST_FORMAT_LEFT:
return Qt::AlignLeft;
case wxLIST_FORMAT_RIGHT:
return Qt::AlignRight;
case wxLIST_FORMAT_CENTRE:
return Qt::AlignCenter;
}
return Qt::AlignLeft;
}
wxListColumnFormat wxQtConvertAlignFlag(int align)
{
switch (align)
{
case Qt::AlignLeft:
return wxLIST_FORMAT_LEFT;
case Qt::AlignRight:
return wxLIST_FORMAT_RIGHT;
case Qt::AlignCenter:
return wxLIST_FORMAT_CENTRE;
}
return wxLIST_FORMAT_LEFT;
}
} // anonymous namespace
class wxQtListTreeWidget : public wxQtEventSignalHandler< QTreeWidget, wxListCtrl >
{
public:
@@ -106,35 +139,6 @@ void wxQtListTreeWidget::itemActivated(QTreeWidgetItem *qitem, int column)
}
Qt::AlignmentFlag wxQtConvertTextAlign(wxListColumnFormat align)
{
switch (align)
{
case wxLIST_FORMAT_LEFT:
return Qt::AlignLeft;
case wxLIST_FORMAT_RIGHT:
return Qt::AlignRight;
case wxLIST_FORMAT_CENTRE:
return Qt::AlignCenter;
}
return Qt::AlignLeft;
}
wxListColumnFormat wxQtConvertAlignFlag(int align)
{
switch (align)
{
case Qt::AlignLeft:
return wxLIST_FORMAT_LEFT;
case Qt::AlignRight:
return wxLIST_FORMAT_RIGHT;
case Qt::AlignCenter:
return wxLIST_FORMAT_CENTRE;
}
return wxLIST_FORMAT_LEFT;
}
wxListCtrl::wxListCtrl()
{
Init();