osx - QListWidget on mac os X show abnormal -
i use qlistwidget on qt creator of mac, code
m_plistwidget->setobjectname(qstringliteral("ttmanagevmlist")); m_plistwidget->setframeshape(qlistwidget::noframe); m_plistwidget->setattribute(qt::wa_translucentbackground,false); m_plistwidget->setalternatingrowcolors(true); m_plistwidget->setcontentsmargins(0,0,0,0); m_plistwidget->setresizemode(qlistview::fixed); m_plistwidget->setautoscroll(true); m_plistwidget->setedittriggers(qabstractitemview::noedittriggers);
but shows abnormal,like
it has blue border,but when loses focus,it's normal. knows reason of problem?
i believe can use this:
m_plistwidget->setattribute(qt::wa_macshowfocusrect, false);
read qt::wa_macshowfocusrect
here
indicates widget should qfocusframe around it. widgets draw own focus halo regardless of attribute. not qwidget::focuspolicy plays main role in whether given focus or not, controls whether or not gets focus frame. attribute applicable os x.
Comments
Post a Comment