Qt Wizard building
-
Hi,
I'm just starting out using Qt and would like to create a wizard GUI.The wizard is for data analysis, and should have several main components. To start out with, my main goal is to construct the following:
-
In the first dialog, request from User a HDF5 file; then load the data from a HDF5 format from some directory (My guess is to use QFileDialog currently, but am unsure how to read the .hdf5 in Qt unless I include a bunch of HDF libraries). An extra feature might be a push button which opens a new dialog to view the metadata and one for the data.
-
Given the Keys from this data set, ask the user to filter out which keys they care about (ie take out the columns of interest and cosntruct a new .hdf5 straight from the gui)
The primary goal will be to load the data using the GUI. Does anyone know how I could implement this? Many thanks!
-
-
Hi,
I'm just starting out using Qt and would like to create a wizard GUI.The wizard is for data analysis, and should have several main components. To start out with, my main goal is to construct the following:
-
In the first dialog, request from User a HDF5 file; then load the data from a HDF5 format from some directory (My guess is to use QFileDialog currently, but am unsure how to read the .hdf5 in Qt unless I include a bunch of HDF libraries). An extra feature might be a push button which opens a new dialog to view the metadata and one for the data.
-
Given the Keys from this data set, ask the user to filter out which keys they care about (ie take out the columns of interest and cosntruct a new .hdf5 straight from the gui)
The primary goal will be to load the data using the GUI. Does anyone know how I could implement this? Many thanks!
- Yes, QFileDialog can be used. I don't know what HDF5 is, probably you will need to use some libraries to read it.
- You can use http://doc.qt.io/qt-5/qcheckbox.html if the amount of entries isn't big
-
-
@jsulm thanks for the advice. So HDF5 is a heirarchical data format used to store and work with large and complex datasets.
OK, I'll hunt down the libraries, great.
As for 2., the entries would be large. Would it be possible to populate a list view, have another list view, two pushbutton to retieve keys from the respective lists, and then a pushbutton to filter the hdf5 table?
Thanks SGaist; so I installed libhdf5- put LIBS += /usr/lib/libhdf5_cpp.so -lhdf5 in the .pro file, and loaded the headers.
I have another question. so as the first step in the QWizardpage I have, I want to include a file browser, ie connect a QPushButton to a QLineEdit and QFileDialog somehow.
I can open a QFIle dialog using the following line in the .cpp for the wizard
---From class in header------
#include <QWizard>
QT_BEGIN_NAMESPACE
class QCheckBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QRadioButton;
class QFileDialog;
class QDir;
QT_END_NAMESPACE...
class Page2: public QWizardPage
{
private:
// QPushButton *m_button;
QLabel *browseLabel;
QLineEdit *browseLineEdit;
QPushButton *browsePushButton;
QFileDialog *browseFileDialog;
};-------Implementation-----------
....
browseLabel = new QLabel(tr("Open file!: "));
browseLineEdit = new QLineEdit;
browsePushButton = new QPushButton;
browsePushButton->setText("Browse ...");
QString _File;
browseFileDialog = new QFileDialog;QString filename = browseFileDialog->getOpenFileName(this, "Open file", "~/","HDF5 files (*.h5);;All Files (*.*)");
This opens a dialog, but only because of the last line; not at the command of the button.
How can I link the pushbutton, to open browseFileDialog, and once it selects the file, ::getOpenFileName() on the result, and finally set the Text browseLineEdit to the result?
-
@jsulm thanks for the advice. So HDF5 is a heirarchical data format used to store and work with large and complex datasets.
OK, I'll hunt down the libraries, great.
As for 2., the entries would be large. Would it be possible to populate a list view, have another list view, two pushbutton to retieve keys from the respective lists, and then a pushbutton to filter the hdf5 table?
Thanks SGaist; so I installed libhdf5- put LIBS += /usr/lib/libhdf5_cpp.so -lhdf5 in the .pro file, and loaded the headers.
I have another question. so as the first step in the QWizardpage I have, I want to include a file browser, ie connect a QPushButton to a QLineEdit and QFileDialog somehow.
I can open a QFIle dialog using the following line in the .cpp for the wizard
---From class in header------
#include <QWizard>
QT_BEGIN_NAMESPACE
class QCheckBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QRadioButton;
class QFileDialog;
class QDir;
QT_END_NAMESPACE...
class Page2: public QWizardPage
{
private:
// QPushButton *m_button;
QLabel *browseLabel;
QLineEdit *browseLineEdit;
QPushButton *browsePushButton;
QFileDialog *browseFileDialog;
};-------Implementation-----------
....
browseLabel = new QLabel(tr("Open file!: "));
browseLineEdit = new QLineEdit;
browsePushButton = new QPushButton;
browsePushButton->setText("Browse ...");
QString _File;
browseFileDialog = new QFileDialog;QString filename = browseFileDialog->getOpenFileName(this, "Open file", "~/","HDF5 files (*.h5);;All Files (*.*)");
This opens a dialog, but only because of the last line; not at the command of the button.
How can I link the pushbutton, to open browseFileDialog, and once it selects the file, ::getOpenFileName() on the result, and finally set the Text browseLineEdit to the result?
@kemizio said in Qt Wizard building:
How can I link the pushbutton, to open browseFileDialog, and once it selects the file, ::getOpenFileName() on the result, and finally set the Text browseLineEdit to the result?
Please take a look at http://doc.qt.io/qt-5/signalsandslots.html
If you have a lot of entries you should rather use a table.
-
@jsulm thanks. I got it half setup using
connect(browsePushButton, SIGNAL (released()),
this, SLOT (browseButton()))registerField("browseLabel*", browseLineEdit);
void DataLoaderPage::browseButton()
{
QString dataname = browseFileDialog->getOpenFileName(this, "Open file",
"~/","HDF5 files (.h5);;All Files (.*)");
browseLineEdit->setText(dataname); };But if I press the back button to the previous page, then go forward, it completely ignores the fact that the label is populated, and retains the first entry from the filedialog - how can I update it so when I go to the first page it empties the Qlineedit? Sorry for the constant questions!
-
Do you mean reset the wizard page when going back ?