Now my viewport gets painted exactly where I want it to, and the extra buttons can be placed in area where I want it to (b is the button) + its all nice all in one widget. I can expose needed controls for b as pert spec but drawing is as it should. Yay!
I said 'Maybe you've a typo...'
The problem with auto-connect is that you can not be sure if it is really connected (e.g. when there is a typo somewhere in the functions signature or the ui element name) and it easily breaks (e.g. when renaming an ui element).
First thing, please don't delete all that stuff in your destructors. Qt has a pattern that is based on parent widget (the parameter "this" in widget constructors) that take care of destructing all the children automatically when the parent is deleted: http://doc.qt.io/qt-5/objecttrees.html
Now regarding your problem, only one widget can have focus at the same time. For the focus part, you can use setFocusPolicy on your widgets, giving an enum that tells more about the behavior you expect.
For what I have experienced, playing with opacity and trying to give a modern look to a desktop software is kind of a pain. Long story short: there is no user friendly API to do so, or at least as user friendly as what QML provides. This is either because the widgets part is late compared to the QML one, or because "modern" has been associated with app, browsers, Internet, but not with desktop. Nonetheless, things might evolve in the future, since Qt developers have communicated about resuming the widgets development. This doesn't solve your problem, but could explain why you are having so much trouble trying to code an overlay that behaves with good focus policy, and using low level code such as QPalette that is always a sign you're doing something wrong, or at least not initially intended. Which could be fine, if you really know what you're doing, and you are aware that you'll have to deal with a lot of work to make your application look the same on every platform.
So I created a project with your code and here are some remarks:
1 Do not set a layout to your main window, just set the central widget with, well
2 qreal is an alias for double, so instead of qreal(100)/100 just write 1.0; same for qreal(50)/100, just write 0.5 and it will be perfectly fine.
3 No need to use "this->" you are coding in C++, not JAVA ;)
For your problem, I think I don't really get what you are expecting. Just an overlay when the setting widget pops? If so, maybe working with a QDialog (a modal one) would be better.
(The vec4 can hold "rgba" values if that's what you put in it - the example there just calls it "xyzw" because the data type generically handles any 4 floats.)
Basically, start from an example that draws an image with a simple glsl shader as a texture. Then hack on the shader until it flips around the colors like you want when it draws the texture. Then use your code that gets the image over the network to upload the image as the OpenGL texture every frame.
1st of all, thanks for your effort, I use LyX myself.
The doc says:
this indicates that the widget will paint over its entire area with opaque colors. The widget's area will initially be uninitialized
set the widget's Qt::WA_OpaquePaintEvent, avoiding any unnecessary overhead associated with repainting the widget's background
Meaning it is saying it won't bother painting a background but it's not committing to leaving the old painted background in place so I still think you are relying on undefined behaviour.
On the other hand, I think this also impacts the performance of widgets with Qt::WA_OpaquePaintEvent on macOS so it is probably worth highlighting it with a bug report and/or an email on the mailing list
Yeah i feel like i do sudo apt-get update && upgrade at least once a day. I just checked about SIP and i compiled it from source but i cant remember if i actually used the command make and make install. Does that mean i have to reinstall pyqt5 again? I guess i just open a new thread. Thanks for all the help @SGaist
It might not be the answer but it is a answer. I declare my charts using QML to maintain declarative / visual design.
I only control them from C++ with C++ data. I do all the processing of dynamic axis ranges inside that, I do stupidly high frequency updates.
I'd recommend, if you very frequently update your line series like I do to use: void QXYSeries::replace(QVector<QPointF> points) (or QList...)
and also set your LineSeries to use open GL either from QML or C++ works fine, you do lose some functionality but it saves using canvas (which is slower) if you have lots of points of data, with many fast updates.
I have found a solution that kind of does the job, although takes three times as much memory.
Every update I calculate the difference between the new and the old saturation matrix, this eliminates 60% of the nonzero values, which means it gets drawn that much faster.
As a second layer of optimization I call repaint with a rectangle describing the most important zone, and call update every 60ms.
Actually I did try setting QTabWidget setAutoFillBackground(True) previously, but it didn't work.
Now I tried set VGroupBox setAutoFillBackground(True), then the color changed to light grey which is the exact default color I need.
Thanks so much, raven-worx.
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.