Page 1 of 1

How to make a dialog?

Posted: Wed Mar 30, 2016 9:03 am
by Eiji Kurihara
In the function doAction() in the plugin, it is written that
--> you may want to start by asking parameters( with a custom dialog, etc.) .
However to try to add MFC class in QMY_PLUGIN, by the message
"MFC class is added only on MFC project",
I cannot make a MFC dialog . If I check your CloudCompare, there is a QDialog.
But I did not know how to use it.
I am sorry so many questions. But surely I become familiar with your CloudCompare.
Sincerely,

Re: How to make a dialog?

Posted: Thu Mar 31, 2016 7:40 am
by daniel
Indeed, we don't use MFC (so as to be portable on Linux and Mac OS).

You have to use Qt for everything that is related to the graphical user interface. You should learn a little bit about Qt first (http://doc.qt.io/qt-5/gettingstarted.html).

And once again you can copy and update the code of other plugins (qPCV, qHPR and qRansacSD have dialogs for instance).

Re: How to make a dialog?

Posted: Thu Mar 31, 2016 10:10 am
by Eiji Kurihara
Thank you for your reply. I must study more about Qt.
Probably, I will start this tommorow.
Sincerely,

Re: How to make a dialog?

Posted: Mon Apr 04, 2016 1:58 am
by Eiji Kurihara
I am still strugging to make a dialog. By copying ccPcvDlg.cpp, ccPcvDlg.h, pcvDlg.ui in the qPCV directory, I made qMyPluginDlg.cpp, qMyPluginDlg.h and qMyPluginDlg.ui. Since there is a QtCreator, by changing pcvDlg.ui using the QtCreator, I could make qMyPluginDlg.ui.
For opening and reading ppPcvDlg.h, it needs ui_MyPluginDlg.h corresponding to ui_pcvDlg.h. If I look at ui_pcvDlg.h, it is written,
'Form generated from reading UI file pcvDlg.ui'. So I think there is an easist way to make ui_MyPluginDlg.h from qMyPluginDlg.ui.
Please give me a good advice.
Sincerely,

Re: How to make a dialog?

Posted: Mon Apr 04, 2016 6:47 am
by daniel
Indeed you don't have to create the 'ui_XXX.h' files. You just have to run CMake once (it will detect the .ui files in your directory) and then run the compilation of the project once (it will create the 'ui_XXXX.h' files on the first run).

Re: How to make a dialog?

Posted: Mon Apr 04, 2016 9:36 am
by Eiji Kurihara
Thank you for your teaching. Since my first dialog is so simple, and I have an experience to make a dialog in the unix,
I can make ui_MyPluginDlg.h without running CMake. My dialog is appeared after picking myPlugin dialog.
I try to do your advice when making another dialog.
Sincerely,