UID:83140
UID:7394
QApplication's main areas of responsibility are:......Since the QApplication object does so much initialization, it must be created before any other objects related to the user interface are created. QApplication also deals with common command line arguments. Hence, it is usually a good idea to create it before any interpretation or modification of argv is done in the application itself.
引用第1楼dbzhang800于2009-12-28 12:48发表的 :1. 这叫定义(definition),不叫声明(declaration)2. 看 QApplication 的 manual
UID:331
引用第3楼xinqingfly于2009-12-28 13:57发表的 :QMainWindow *mainWindow=NULL;int main(int argc, char **argv){ QApplication app(argc, argv);.......
引用第5楼dbzhang800于2009-12-28 16:23发表的 :http://www.cuteqt.com/?p=1147
UID:88244
引用第9楼benbenmajia于2009-12-28 17:27发表的 :我想你即使想做全局的也不用这样的吧,你如果用多线程的话不需要这样,你如果不是多线程的话每次只能利用到一个窗口,何必?
引用第6楼tzqdo于2009-12-28 17:04发表的 :error C2679: binary '=' : no operator found which takes a right-hand operand of type 'QMainWindow *' (or there is no acceptable conversion)感觉有点重复定义的意思。QMainWindow *mainWindow=NULL;什么作用,强制声明么?对这块不大懂.......
引用第6楼tzqdo于2009-12-28 17:04发表的 :这个帖子我也搜到了,感觉说的不是一个问题.......
引用第6楼tzqdo于2009-12-28 17:04发表的 :其实是这样的,mainwindow里面有个lineEdit,我是想在任意地方都能往里面写内容,就像一个日志的东西.......