常见的50 种 QT Object,下面按alpha排序, 有非默认构造的简单示例。
它们的属性设置也有通用性。有不同的外观,有不同的属性行为.不同的用途.
掌握他们是编程的基础. 可以参考<<Qt4 精彩编程实例分析>>源代码

QAction
QActionGroup
QCheckBox
QComboBox
QCursor
QDateTime
QDateTimeEdit
QDialog
QDialogButtonBox
QDockWidget
QFile
QFontComboBox
QFrame
QGraphicsEllipseItem
QGraphicsItemAnimation
QGraphicsPolygonItem
QGraphicsRectItem
QGraphicsScene
QGraphicsTextItem
QGraphicsView
QGridLayout
QGroupBox
QHBoxLayout
QImage
QLabel
QLineEdit
QListView
QListWidget
QListWidgetItem
QMainWindow
QPainter
QPixmap
QProgressBar
QProgressDialog
QPushButton
QRadioButton
QSlider
QSpinBox
QSplitter
QStackedWidget
QStandardItemModel
QTabWidget
QTableView
QTableWidget
QTableWidgetItem
QTextEdit
QTimeLine
QTimer
QToolButton
QVBoxLayout
QWidget

new QAction(QIcon(":/images/copy.png"), tr("Copy"), this);
new QAction(QIcon(":/images/zoomin.png"),tr("ZoomIn"),this);
new QAction(tr("Add Polygon"),this);
new QCheckBox(tr("receive msg"));
new QCursor(QPixmap(":/images/custom.png"),-1,-1);    
new QDialogButtonBox(Qt::Vertical);
new QDockWidget( tr("DockWindow 2"), this );
new QFile(fileName);
new QFontComboBox(toolBar);
new QGraphicsEllipseItem(QRectF(0,0,80,60));
new QGraphicsPolygonItem(QPolygonF(v));
new QGraphicsRectItem(QRectF(0,0,60,60));
new QGraphicsTextItem("Hello Qt");
new QGroupBox(tr("Rotate"));
new QImage(":/images/heart.png");
new QLabel(tr("width:"));
new QListWidget(splitterMain);
new QListWidgetItem (icon,fileName);
new QPainter(pix);
new QPixmap(":/images/rotate.png");
new QPixmap(size());
new QPixmap(width,height);
new QPushButton(tr("pushbutton"));
new QRadioButton(tr("radiobutton1"),group);
new QSlider(Qt::Horizontal);
new QSplitter(Qt::Horizontal,0);
new QSplitter(Qt::Vertical,splitterMain);  
new QStandardItemModel(4,4,this);
new QTableWidgetItem(tr("Alice"));
new QTextEdit( QObject::tr("Top Widget"),splitterRight);
new QTimeLine(4000);
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐