Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Wizard building
QtWS25 Last Chance

Qt Wizard building

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kemizio
    wrote on last edited by kemizio
    #1

    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:

    1. 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.

    2. 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!

    jsulmJ 1 Reply Last reply
    0
    • K kemizio

      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:

      1. 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.

      2. 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!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @kemizio

      1. Yes, QFileDialog can be used. I don't know what HDF5 is, probably you will need to use some libraries to read it.
      2. You can use http://doc.qt.io/qt-5/qcheckbox.html if the amount of entries isn't big

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        I confirm for hdf5, you'll have to grab the library from the hdfgroup.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kemizio
          wrote on last edited by
          #4

          @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?

          jsulmJ 1 Reply Last reply
          0
          • K kemizio

            @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?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kemizio
              wrote on last edited by kemizio
              #6

              @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!

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Do you mean reset the wizard page when going back ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kemizio
                  wrote on last edited by
                  #8

                  That's one possibility, I guess that is simpler than just resetting the QLineEdit

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved