1 2 | XReparentWindow(Display *display, Window w, Window parent, int x, int y) |
1 2 3 4 5 | QXtApplication app(argc, argv, "TwoEditors"); TwoEditors m; app.setMainWidget(&m); m.show(); return app.exec(); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | class TwoEditors : public QMainWindow { QMultiLineEdit* qtchild; EncapsulatedXtWidget* xtchild; public: TwoEditors() : QMainWindow( 0, "mainWindow") { QPopupMenu* file = new QPopupMenu( this ); file->insertItem("E&xit", qApp, SLOT( quit() ) ); menuBar()->insertItem( "&File", file ); statusBar(); QSplitter* splitter = new QSplitter( this ); splitter->setOpaqueResize( TRUE ); setCentralWidget( splitter ); xtchild = new EncapsulatedXtWidget( splitter ); qtchild = new QMultiLineEdit( splitter ); qtchild->setText(QTEDMSG); } }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | QGtkApplication a( argc, argv ); QMainWindow *wnd=new MainWnd(); QPushButton *Qt=new QPushButton("This is Qt!", wnd); QGtkWidget *Gtk=new QGtkWidget(wnd); wnd->resize(200,100); Qt->setGeometry(0,0,100,50); Gtk->setGeometry(100,0,100,100); GtkWidget *box=gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(Gtk->getGtkWidget()), box); GtkWidget *b=gtk_button_new_with_label("This is GTK!"); gtk_box_pack_start(GTK_BOX(box), b, TRUE, TRUE, 0); gtk_widget_show(b); gtk_widget_show(box); wnd->show(); a.setMainWidget( wnd ); gtk_widget_show(b); gtk_widget_show(box); return a.exec(); |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |