![]() ![]() ![]() Label is QLabel made on QDialog.Įxplicit MainWindow(QWidget *parent = 0) Įditorplain.cpp file: #include "editorplain. This er should send on dialog editorplain and set as label for example: ui->label->setText(er). On mywindow I have a string er which returns some string as result. Widgets can also be cloned on the form: Holding down Ctrl and dragging the widget creates a copy of the widget that can be dragged to a new position. Ui->label_2->setText(myData.textForEdit) for Discarding Changes) and closes the dialog. QDialogButtonBox::DestructiveRole: 2: Clicking the button causes a destructive change (e.g. QDialogButtonBox::RejectRole: 1: Clicking the button causes the dialog to be rejected (e.g. When opening dialog I want a grab data from string er: Editorplain::setData(myType myData) Clicking the button causes the dialog to be accepted (e.g. ![]() Dialog boxes present users with options and choices, and allow them to set the options to their preferred values and to make their choices. This creates a widget called Form, and the form.h and form.cpp will also be added to your project. Select Widget and then go with the defaults on the rest. In the dialog that opens up, choose Qt > Qt Designer Form Class, and click Choose. HERE IS WHAT I WANT SEND A DATA TO ANOTHER DIALOG `editorplain` This chapter will teach you how to create dialog boxes using Qt. Next, click Edit in the UI Designer and then rightclick Forms. QString er = ui->selected_filename->text() You may add new method for your dialog and set data into it, for example. void MainWindow::on_actionRoot_files_triggered() Qt World Summit: Early-Bird Tickets SOLVED mainwindow pass data to dialog. Problem: Send text data to label on another dialog.Īction on triggered from menu call a new dialog:Įr will return string from mainwindow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |