【正文】
而是基于所有傳送事件類(lèi)型,分派給處理特定類(lèi)型的事件處理者( Event Handler)。 建立 QPainter的方式如下,其中 qPinterDevice是個(gè)指向 PinterDevice子類(lèi)別的名稱: QPainter painter( qPinterDevice); 若是圖形組件,通常會(huì)重新定義 QWidget的 paintEvent(),當(dāng)繪圖裝置( Paint Device)需要重繪時(shí),就會(huì)發(fā)出 QPaintEvent并分配給這個(gè)方法來(lái)處理事件,例如組件出現(xiàn)、被覆蓋又重現(xiàn)時(shí),也可以呼叫 repaint()或 update(),這也會(huì)執(zhí)行 paintEvent()。 : Q_OBJECT,通??梢月暶髟陬?lèi)的私有段中,讓該類(lèi)可以使用元對(duì)象的特性,比如動(dòng)態(tài)屬性,信號(hào)和槽。 QObject類(lèi)型的變量 obj實(shí)際上指向一個(gè) MyWidget對(duì)象,因此我們可以這樣進(jìn)行類(lèi)型轉(zhuǎn)換: QWidget *widget = qobject_castQWidget *(obj)。 addDockWidget(Qt::LeftDockWidgetArea, m_pLeftDock)。s title bar. If widget is 0, any custom title bar widget previously set on the dock widget is removed, but not deleted, and the default title bar will be used instead. Tip: The title bar widget must have a valid QWidget::sizeHint() and QWidget::minimumSizeHint(). These functions should take into account the current orientation of the title bar. 總結(jié):通過(guò)前一周的學(xué)習(xí)建立了關(guān)于 Qt中的一些基礎(chǔ)性的概念,進(jìn)一步認(rèn)識(shí)了面向?qū)ο蟮木幊趟枷?