나는 QPainter와 직사각형을 가지고 있습니다.Qt : 더미 라인 편집 컨트롤을 그리는 방법
QLineEdit 컨트롤을 비우고 싶습니다. 비어 있습니다. 그냥 그려 그 라이브 컨트롤을하지 않습니다. 어떻게해야합니까? QStyle : : drawPrimitive를 사용해 보았습니다. 아무것도 그려지지 않습니다.
QStyleOption option1;
option1.init(contactsView); // contactView is the parent QListView
option1.rect = option.rect; // option.rect is the rectangle to be drawn on.
contactsView->style()->drawPrimitive(QStyle::PE_FrameLineEdit, &option1, painter, contactsView);
당연히 나는 그려진 더미가 Windows 및 OSX에서 기본으로 보이길 바랍니다.
진짜'QLineEdit'을 생성 한 다음'qlineedit-> setEnabled (false)'를 설정할 수 있습니까? 또는 귀하의 목적에 맞는 행동/외관을 생성하지 않습니까? – tmpearce