implementing a dynamic display
-
So the serial port has a reduce set of possible interactions but they are all available through the network interface, correct ?
Are all your devices connected to both a serial port and the network when operated ?
-
So the serial port has a reduce set of possible interactions but they are all available through the network interface, correct ?
Are all your devices connected to both a serial port and the network when operated ?
@SGaist said in implementing a dynamic display:
So the serial port has a reduce set of possible interactions but they are all available through the network interface, correct ?
Correct.Are all your devices connected to both a serial port and the network when operated ?
No. In fact, both connections are brief. The serial port functionality is used for preliminary configuration, either at the factory, or by an OEM technician. The network interface is used for diagnostics or for changing configurations.
-
Ok, it's clearer, so in fact you could have a QListView with all of your available devices and then when you select it, you can show the "configuration" widget loaded with the information of that specific device.
-
Ahh...that sounds like a good idea. Might be overkill, but I'm willing to go with it.
So, before the main display is drawn, I'll have a preliminary display with which the user makes a product selection?
I've never worked with multiple windows before. Do I create a form analogous to that defined in my widget.ui file? And would this be in another .ui file?
-
Ahh...that sounds like a good idea. Might be overkill, but I'm willing to go with it.
So, before the main display is drawn, I'll have a preliminary display with which the user makes a product selection?
I've never worked with multiple windows before. Do I create a form analogous to that defined in my widget.ui file? And would this be in another .ui file?
Sorry to interject, but it's still not quite clear to me if you have a way to determine what kind of device you're connected to through either interface? Or are you supposed to chose that and then establish the connection?
Btw, I'd've put both type of interfaces in one application. It's a matter of designing the class hierarchy but you could in principle put it all - communication interfaces and application types - together and with abstract classes adding implementations should be rather easy. At a later stage you could even load the actual implementations on demand via plugins.
-
So indeed, a plugin based architecture might be best suited for that.
-
Kind of an unrelated note.
It sounds like the application is for specialist use only. Can you go and ask one of the end users what they really want to do and in what order they would like to do it?So the products broadcast or reply to a broadcast on the network, so they can be identified? This would make it much easier for the network case.
From the architecture side, a plugin approach makes most sense, especially as you expect future additions and changes.
-
Kind of an unrelated note.
It sounds like the application is for specialist use only. Can you go and ask one of the end users what they really want to do and in what order they would like to do it?So the products broadcast or reply to a broadcast on the network, so they can be identified? This would make it much easier for the network case.
From the architecture side, a plugin approach makes most sense, especially as you expect future additions and changes.
@tekojo I wish I could poll the user community on this matter -- I always like hearing from end-users before implementing an app. Unfortunately that option isn't available to me at this time.
Regarding using plugins: that might be overkill, given that there are only two levels of user access, and only a few levels of app functionality. I also need to be concerned with distribution, and I'm not really familiar with plugins, but a plugin exists in a separate file, right? So can I still do a static build to create a monolithic distribution entity?
-
I've decided to implement the additional fields using a QDialog object. I created a second form for this dialog, but then realized I don't know how to access this form programmatically. Can someone point me to some directions on this? I've done some looking but haven't found anything that tells me how to connect up a second form.
Clarification: I know that I want the form to be enabled when a button push delivers a signal, but I don't know how to "point to" this form programatically. I hope this makes sense; I've been struggling to find the right words to explain what I'm looking for.
Thanks...
-
You usually subclass QDialog and give it the necessary API to access what you want. Depending on what you want to add, you can also simply hide what should not be used.
-
You usually subclass QDialog and give it the necessary API to access what you want. Depending on what you want to add, you can also simply hide what should not be used.
-
Just to be sure we are talking about the same thing, what do you mean by form ?
-
Then that's the most common use case. You create as many "Forms" you need and give them the API you need.
-
I see. So, when I created this project, I selected Qt Widgets Application, and Creator automatically set up the form and the class for me. Should I use that class as a model for my new form?
I still don't quite understand how the program "knows" to use the .ui file. I don't see the connection anywhere in my code.
-
It's just a starting point. Nothing forbids you to have several forms.
The .uil file is processed by
uic
to generate code (a bit likemoc
for QObject based classes) then theui.setupUi(this);
line does the "magic" to setup everything you prepared with Designer. -
I've tried to implement a new class (patterned after my main form)...obviously I don't understand something.
Here's the header:
#ifndef CREDENTIALS_H #define CREDENTIALS_H #include <QWidget> namespace Ui { class Credentials; } class Credentials : public QWidget { Q_OBJECT public: explicit Credentials(QWidget *parent = nullptr); private: Ui::Credentials *uiCredentials; }; #endif // CREDENTIALS_H
and here's the source:
#include "credentials.h" #include "ui_credentials.h" Credentials::Credentials(QWidget *parent) : QWidget(parent), uiCredentials(new Ui::Credentials) { uiCredentials->setupUi(this); }
I'm getting an error "invalid use of incomplete type 'class Ui::Credentials'. Why is it incomplete?
-
I've tried to implement a new class (patterned after my main form)...obviously I don't understand something.
Here's the header:
#ifndef CREDENTIALS_H #define CREDENTIALS_H #include <QWidget> namespace Ui { class Credentials; } class Credentials : public QWidget { Q_OBJECT public: explicit Credentials(QWidget *parent = nullptr); private: Ui::Credentials *uiCredentials; }; #endif // CREDENTIALS_H
and here's the source:
#include "credentials.h" #include "ui_credentials.h" Credentials::Credentials(QWidget *parent) : QWidget(parent), uiCredentials(new Ui::Credentials) { uiCredentials->setupUi(this); }
I'm getting an error "invalid use of incomplete type 'class Ui::Credentials'. Why is it incomplete?
#include "ui_credentials_form_file_name.h"