Qt学习笔记:使用QTreeWidget实现如Eva的用户列表
Qt学习笔记,使用QTreeWidget实现如Eva的用户列表
完整源码:
#-------------------------------------------------
#
# Project created by QtCreator 2011-10-08T14:23:35
#
#-------------------------------------------------
QT += core gui
TARGET = drawItem
TEMPLATE = app
SOURCES += main.cpp\
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
RESOURCES += \
icon.qrc
#-------------------------------------------------
#
# Project created by QtCreator 2011-10-08T14:23:35
#
#-------------------------------------------------
QT += core gui
TARGET = drawItem
TEMPLATE = app
SOURCES += main.cpp\
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
RESOURCES += \
icon.qrc
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Widget</class>
<widget class="QWidget" name="Widget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>349</width>
<height>522</height>
</rect>
</property>
<property name="windowTitle">
<string>Widget</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="icon.qrc">
<normaloff>:/new/prefix1/image/theme/contact.png</normaloff>:/new/prefix1/image/theme/contact.png</iconset>
</attribute>
<attribute name="title">
<string/>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="toolTip">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
<p align="justify" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html></string>
</property>
<property name="styleSheet">
<string notr="true">font: 11pt "Ubuntu";
text-decoration: underline;</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>1</string>
</property>
</column>
<item>
<property name="text">
<string>Friends</string>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="textAlignment">
<set>AlignHCenter|AlignVCenter|AlignCe
补充:软件开发 , C语言 ,