From 3b12797953dc0aed4360b40d5818ea93a49163e5 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 04:21:26 +0000 Subject: [PATCH] Improve specific listctrl wxQT, thanks @seandpagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/qt/listctrl.h | 6 ------ src/generic/listbkg.cpp | 4 ++++ src/qt/listctrl.cpp | 17 ++++++----------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/wx/qt/listctrl.h b/include/wx/qt/listctrl.h index 5b2edcffc2..0030688534 100644 --- a/include/wx/qt/listctrl.h +++ b/include/wx/qt/listctrl.h @@ -182,12 +182,6 @@ public: void SetImageList(wxImageList *imageList, int which); void AssignImageList(wxImageList *imageList, int which); - // are we in report mode? - bool InReportView() const; - - // are we in virtual report mode? - bool IsVirtual() const; - // refresh items selectively (only useful for virtual list controls) void RefreshItem(long item); void RefreshItems(long itemFrom, long itemTo); diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index bcf8b642ce..7e4c59afd0 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -142,6 +142,10 @@ long wxListbook::GetListCtrlFlags() const { flags |= wxLC_LIST; } + +#ifdef __WXQT__ + flags |= wxLC_NO_HEADER; +#endif } // Use single selection in any case. diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index d63876a4a0..f1b782ee59 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -129,6 +129,11 @@ bool wxListCtrl::Create(wxWindow *parent, { m_qtTreeWidget = new wxQtTreeWidget( parent, this ); + if (style & wxLC_NO_HEADER) + m_qtTreeWidget->setHeaderHidden(true); + + m_qtTreeWidget->setRootIsDecorated(false); + return QtCreateControl( parent, id, pos, size, style, validator, name ); } @@ -311,7 +316,7 @@ bool wxListCtrl::SetItem(wxListItem& info) { if (info.m_image >= 0) { - wxImageList *imglst = GetImageList(wxIMAGE_LIST_SMALL); + wxImageList *imglst = GetImageList(wxIMAGE_LIST_NORMAL); wxCHECK_MSG(imglst, false, "invalid listctrl imagelist"); const wxBitmap* bitmap = imglst->GetBitmapPtr(info.m_image); if (bitmap != NULL) @@ -649,16 +654,6 @@ void wxListCtrl::AssignImageList(wxImageList *imageList, int which) m_ownsImageListState = true; } -bool wxListCtrl::InReportView() const -{ - return true; -} - -bool wxListCtrl::IsVirtual() const -{ - return false; -} - void wxListCtrl::RefreshItem(long WXUNUSED(item)) { }