English 中文(简体)
QMainWindow、QWidget和QDialog之间的区别是什么?
原标题:What s the difference between QMainWindow, QWidget and QDialog?

QMainWindow、QWidget和QDialog之间的区别是什么?

最佳回答

“QWidget 是Qt所有可选课的基类。 任何<代码>QWidget的基类,如无父母,可显示其为窗口。

缩略语 它总是出现在一个窗口中,并具有功能,使其与在方言(接受、拒绝等)上的共同纽扣地合作。

。 它预先确定了菜单、地位酒吧、工具路障和其他植被的位置。 它没有像<代码>QDialog

问题回答

QWidget:是QtWidgets模块中所有全球倡议要素的基级。 它本身可以是窗口,也可以是QLayout的一部分,也可以是父母-子女阶层的成员。

QDialog:通常用于――惊讶! - 在需要用户投入时展示临时方言。

<>QMainWindow:方便类别,可用作申请的主要窗口。 它具有一些内在的冰层:状态条、工具条以及菜单。





相关问题
Qt (Creator) with WinSocks (ws2_32)

I want to use an older code-fragment in my Qt-project, which is using WinSocks. I created my program with Qt Creator and I don t know, how I can link to the ws2_32-Library. I already added LIBS += -...

Drag & drop with .ui files

I m having big troubles with drag & drop. I ve created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two ...

PRECOMPILED_HEADER and Subdirs template on Qt

I have a big Qt project, splitted on several static libraries (around 70) and one application, and for that I m using a .pro file with the subdirs template. To speed up the compilations time, I want ...

how do i place QTableWidgetItem Icon in center of cell

i want a table cell to have just an icon without any text. i see the QTableWidgetItem class has a method to align the text (int QTableWidgetItem::textAlignment () const) i find no way to adjust the ...

Showing two windows in Qt4

My friend and I have each created parts of a GUI using Qt 4. They both work independently and I am trying to integrate his form with the my main window. As of now this is the code I am using to try ...

Hiding a QWidget on a QToolbar?

I have directly added some QWidgets to a QToolbar but simply going widget->setVisible(false) did not work. Can someone please give me an example of how to show and hide a widget that is on a QToolbar? ...

热门标签