Changeset View
Changeset View
Standalone View
Standalone View
tests/setmainwindowtest.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
62 | 62 | | |||
63 | // Create test dialog | 63 | // Create test dialog | ||
64 | QDialog *dialog = new QDialog; | 64 | QDialog *dialog = new QDialog; | ||
65 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); | 65 | dialog->setAttribute(Qt::WA_DeleteOnClose, true); | ||
66 | QHBoxLayout *layout = new QHBoxLayout(dialog); | 66 | QHBoxLayout *layout = new QHBoxLayout(dialog); | ||
67 | layout->addWidget(new QLabel("Test Dialog.\nYou should not be able to bring the parent window on top of me.")); | 67 | layout->addWidget(new QLabel("Test Dialog.\nYou should not be able to bring the parent window on top of me.")); | ||
68 | 68 | | |||
69 | // Show it | 69 | // Show it | ||
70 | KWindowSystem::setMainWindow(dialog, id); | 70 | dialog->setAttribute(Qt::WA_NativeWindow, true); | ||
71 | KWindowSystem::setMainWindow(dialog->windowHandle(), id); | ||||
71 | dialog->exec(); | 72 | dialog->exec(); | ||
72 | 73 | | |||
73 | m_label->setText(QString()); | 74 | m_label->setText(QString()); | ||
74 | } | 75 | } | ||
75 | 76 | | |||
76 | int main(int argc, char **argv) | 77 | int main(int argc, char **argv) | ||
77 | { | 78 | { | ||
78 | QApplication app(argc, argv); | 79 | QApplication app(argc, argv); | ||
79 | Window window; | 80 | Window window; | ||
80 | window.show(); | 81 | window.show(); | ||
81 | return app.exec(); | 82 | return app.exec(); | ||
82 | } | 83 | } |