QT C++ graphics display WIDGET
- Reinhard
- Offline
- Platinum Member
Less
More
- Posts: 508
- Thank you received: 94
30 Aug 2021 19:10 #219185
by Reinhard
Replied by Reinhard on topic QT C++ graphics display WIDGET
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
30 Aug 2021 20:45 #219189
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi Reinhard,
I looks like we have to try it. Did you already used it in your app?
I looks like we have to try it. Did you already used it in your app?
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
30 Aug 2021 21:39 - 30 Aug 2021 23:22 #219195
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi,
A video of the widget:
user-images.githubusercontent.com/448801...89b-8cbdac8a2e88.mp4
A picture of the widget:
A video of the widget:
user-images.githubusercontent.com/448801...89b-8cbdac8a2e88.mp4
A picture of the widget:
Attachments:
Last edit: 30 Aug 2021 23:22 by Grotius.
The following user(s) said Thank You: phillc54, tommylight, bkt
Please Log in or Create an account to join the conversation.
- Reinhard
- Offline
- Platinum Member
Less
More
- Posts: 508
- Thank you received: 94
31 Aug 2021 02:29 #219211
by Reinhard
Replied by Reinhard on topic QT C++ graphics display WIDGET
Hi Grotius,
impressive work
Some words about dro style of gmoccapy:
*imho* its a big wastage of space. You don't need relative and absolute coordinates at the same time. Showing G54 does not make sense, as linux backend does not update that value in time.
And a symbol for hitting limit switch? - That situation is a vital error, which should stop the machine imediatelly.
The old machines I use at work have to be turned off to clear limit switch errors. So for that error you could use a fullscreen error message. Its not needed to waste space of graphical widget.
impressive work
Some words about dro style of gmoccapy:
*imho* its a big wastage of space. You don't need relative and absolute coordinates at the same time. Showing G54 does not make sense, as linux backend does not update that value in time.
And a symbol for hitting limit switch? - That situation is a vital error, which should stop the machine imediatelly.
The old machines I use at work have to be turned off to clear limit switch errors. So for that error you could use a fullscreen error message. Its not needed to waste space of graphical widget.
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 4023
- Thank you received: 1733
31 Aug 2021 06:06 #219220
by Aciera
Replied by Aciera on topic QT C++ graphics display WIDGET
I actually quite like the dro style. All information in one space.
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Reinhard
- Offline
- Platinum Member
Less
More
- Posts: 508
- Thank you received: 94
31 Aug 2021 14:41 #219254
by Reinhard
Replied by Reinhard on topic QT C++ graphics display WIDGET
Hi Grotius,
a quick shot at QOpenGLWidget - no problem creating transparent overlay widgets.
So if QOpenGLWidget is usable as base for graphic output, then dro and graphic widgets could be separated and i.e. make it configurable, if dro should be painted at overlay location or outside of graphic widget.
Changed code looks like:
and changed constructor:
Cheers Reinhard
a quick shot at QOpenGLWidget - no problem creating transparent overlay widgets.
So if QOpenGLWidget is usable as base for graphic output, then dro and graphic widgets could be separated and i.e. make it configurable, if dro should be painted at overlay location or outside of graphic widget.
Changed code looks like:
class Window : public QWidget
{
Q_OBJECT
public:
Window(MainWindow *mw);
protected:
void keyPressEvent(QKeyEvent *event) override;
private slots:
void dockUndock();
private:
QSlider *createSlider();
GLWidget *glWidget;
QSlider *xSlider;
QSlider *ySlider;
QSlider *zSlider;
QPushButton *dockBtn;
QLabel *overlay;
MainWindow *mainWindow;
};
and changed constructor:
Window::Window(MainWindow *mw)
: mainWindow(mw)
{
glWidget = new GLWidget;
xSlider = createSlider();
ySlider = createSlider();
zSlider = createSlider();
connect(xSlider, &QSlider::valueChanged, glWidget, &GLWidget::setXRotation);
connect(glWidget, &GLWidget::xRotationChanged, xSlider, &QSlider::setValue);
connect(ySlider, &QSlider::valueChanged, glWidget, &GLWidget::setYRotation);
connect(glWidget, &GLWidget::yRotationChanged, ySlider, &QSlider::setValue);
connect(zSlider, &QSlider::valueChanged, glWidget, &GLWidget::setZRotation);
connect(glWidget, &GLWidget::zRotationChanged, zSlider, &QSlider::setValue);
#ifdef REDNOSE
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *container = new QHBoxLayout;
container->addWidget(glWidget);
container->addWidget(xSlider);
container->addWidget(ySlider);
container->addWidget(zSlider);
QWidget *w = new QWidget;
w->setLayout(container);
mainLayout->addWidget(w);
dockBtn = new QPushButton(tr("Undock"), this);
mainLayout->addWidget(dockBtn);
#else
QGridLayout* mainLayout = new QGridLayout;
overlay = new QLabel(tr("Hello"));
overlay->setStyleSheet("color: white; background: rgba(255,255,255,100);");
overlay->setFont(QFont(overlay->font().family(), 34, QFont::Bold));
mainLayout->setColumnStretch(0, 1);
mainLayout->setColumnStretch(1, 1);
mainLayout->setColumnStretch(2, 1);
mainLayout->addWidget(glWidget, 0, 0, 3, 3);
mainLayout->addWidget(overlay, 0, 2);
mainLayout->addWidget(xSlider, 0, 3, 3, 1);
mainLayout->addWidget(ySlider, 0, 4, 3, 1);
mainLayout->addWidget(zSlider, 0, 5, 3, 1);
dockBtn = new QPushButton(tr("Undock"), this);
mainLayout->addWidget(dockBtn, 4, 0, 1, -1);
#endif
setLayout(mainLayout);
connect(dockBtn, &QPushButton::clicked, this, &Window::dockUndock);
xSlider->setValue(15 * 16);
ySlider->setValue(345 * 16);
zSlider->setValue(0 * 16);
setWindowTitle(tr("Hello GL"));
}
Cheers Reinhard
Attachments:
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
31 Aug 2021 18:34 #219268
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Attachments:
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
03 Sep 2021 14:13 #219520
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Hi,
Before finishing the c++ widget i thought maybe test the widget first if it's compatible with Python3.
You know, i'm no Python guru. But it would'nt be my style to leave it that way.
I don't know how Chris would make the interface with python, but i had to investegate this, and picked up a try :
I came accros this python example that creates a Python lib from a C++ lib : github.com/eyllanesc/Qt5toPyQt5/tree/master/src
Offcourse it did'nt work right away. I had to download and compile from source : sip-4.19.25 and PyQt5-15.4
Then it didn't work.
I had to include extra lib path's in the configure.py file of the github.com/eyllanesc/Qt5toPyQt5/tree/master/src example.
Attached the edited configure.py file for info.
Then i got the python modules and created a test script : test.py
Please don't look at my fragile python code style.
The python gui loaded and displaying the opencascade widget.
Trough the property system i could set the opencascade background picture.
So the QProperty system is also working oke for Python.
Before finishing the c++ widget i thought maybe test the widget first if it's compatible with Python3.
You know, i'm no Python guru. But it would'nt be my style to leave it that way.
I don't know how Chris would make the interface with python, but i had to investegate this, and picked up a try :
I came accros this python example that creates a Python lib from a C++ lib : github.com/eyllanesc/Qt5toPyQt5/tree/master/src
Offcourse it did'nt work right away. I had to download and compile from source : sip-4.19.25 and PyQt5-15.4
Then it didn't work.
I had to include extra lib path's in the configure.py file of the github.com/eyllanesc/Qt5toPyQt5/tree/master/src example.
Attached the edited configure.py file for info.
Then i got the python modules and created a test script : test.py
Please don't look at my fragile python code style.
The python gui loaded and displaying the opencascade widget.
Trough the property system i could set the opencascade background picture.
So the QProperty system is also working oke for Python.
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
03 Sep 2021 14:17 #219521
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
Please Log in or Create an account to join the conversation.
- Grotius
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 2244
- Thank you received: 1984
03 Sep 2021 14:19 #219523
by Grotius
Replied by Grotius on topic QT C++ graphics display WIDGET
In the Python code, the opencascade widget is named clock (from the example). Offcourse we have to edit this later on.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Time to create page: 0.343 seconds