[Solved] Display QMainwWindow and QMdiArea
-
This works as expected:
@
#include <QApplication>
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QTextEdit>int main(int argc, char **argv)
{
QApplication a(argc, argv);QMainWindow mw; QMdiArea *mdi = new QMdiArea(&mw); mw.setCentralWidget(mdi); QTextEdit *te = new QTextEdit; QMdiSubWindow *sw = mdi->addSubWindow(te); sw->resize(300,100); sw->show(); mw.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec();
}
@ -
[quote author="Volker" date="1288698753"]This works as expected:
@
#include <QApplication>
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QTextEdit>int main(int argc, char **argv)
{
QApplication a(argc, argv);QMainWindow mw; QMdiArea *mdi = new QMdiArea(&mw); mw.setCentralWidget(mdi); QTextEdit *te = new QTextEdit; QMdiSubWindow *sw = mdi->addSubWindow(te); sw->resize(300,100); sw->show(); mw.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec();
}
@[/quote]question another!!!!
@#include <QApplication>
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QTextEdit>int main(int argc, char **argv)
{
QApplication a(argc, argv);QMainWindow mw; QMdiArea *mdi = new QMdiArea(&mw); mw.setCentralWidget(mdi); QTextEdit *te = new QTextEdit; QMdiSubWindow *sw = mdi->addSubWindow(te);
// sw->resize(300,100);
sw->showMaximized();QTextEdit *ti = new QTextEdit; QMdiSubWindow *sb = mdi->addSubWindow(ti); sb->resize(300,100); sb->show(); mw.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); return a.exec();
}
@
How Display QTextEdit *ti size(300,100)??? *ti Display Maximized. If push minimize 2 windows minimize and *ti take size 300,100 -
finish resault must out !http://img827.imageshack.us/img827/7070/11579515.jpg(2)!