Supercollider crowds out my text when qt GUI widgets are made either by me or by sc itself.
Text crowding in SC's FFT Inspecter
I cannot find the proper formatting settings to fix this either in the QT5 settings manager, or in Suppercollider.
Has anyone else experienced or overcome this problem?
Related
I am new to Qt in general, and I have been playing with it to get to learn about it since I have to develop a very specific text editor.
I want to know if anyone could help me understand which one is better (or the most indicated) for the development of a rich text editor. I have worked before with C and C++ but Qt Widgets seems like a very step hill for the time being and I am completely new to javascript in general.
Some of the settings that I would need to implement on the text editor for better context are:
Look for the user to be always connected to internet.
Transfer and receive data from another program.
Grant read only to the opened files and then permission to write on them when a button is clicked.
Has to work on linux and windows.
Needs to look great.
My context:
So far I have done a few little applications and even a little rich text editor on Qt Widgets, but since I was having problems with the GUI implementation that I wanted, I started looking for a way to solve it and found that Qt Quick might be the solution.
I have been trying Qt Quick, and for now on looks great, but I do not know if it has the capabilities to do what I have explained before. Or if it is better to use one or another.
I decided to create a new post since the one that I found looking for something similar is from 2014.
Also, the text editor for now only needs to work on desktop, but in a future might be on other devices and embedded systems.
I'm working on a program in QT Creator as well as in QT Designer. This is my first experience with the QT family, and I've been working on this for about 3 weeks now. I have to design a variety of menus for a study I've been assigned to make this thing for.
I'm using the QT Designer / QT Creator built-in drag-and-drop to make the biggest pieces and then using code to change some things during runtime (some rich text labels change after user input, for example). My problem is that I'm working on a two-monitor setup. One monitor is 1920 by 1080, and the other is 3840 by 2160. When I drag the running program from the 1920/1080 screen to the other, the sizing just goes all to hell. Text in the LineEdit gets cut off and often the labels just get screwy.
I'm using the "QT Widget Application" project as a base in QT Creator and all of the UI forms are .ui files, NOT .qml files. I have a substantial portion of this already done, so I need to either keep everything in .ui while fixing this or find an easy way to convert to a better format AND fix the problem.
What's very weird is that QT Designer's preview screen of the form looks the same on both screens. I can drag the main menu preview between the 1920/1080 screen and the 3840/2160 screen and there's only very minor changes. Meanwhile the running program in QT Creator has massive disparities in appearance depending on the screen.
Here's a picture to hopefully explain it better, visually:
These are just two print-screens, cropped down to show one of the things that's changing. The top half is the running program, and the bottom half is the preview, both on the same screen at the same screen size (maximized). I've tried changing the horizontalStretch and verticalStretch for various elements in the Designer but it's still borked.
This is probably a rookie problem, but I am in fact a rookie with QT. I'm just trying to make sure that no matter what screen size we run this thing on, it looks the same no matter what.
Looks like a problem related to widget themes in Qt.
Qt Designer shows you the form preview using the fusion style, but when you run your program Qt will select the best match for your platform. This could explain the differences that you see. You can override this behavior forcing the fusion style.
Edit: Another thing that you can try is to enable the Hi-DPI screen support for rendering, if not set yet.
Just add this line to your main function like this:
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setStyle(QStyleFactory::create("Fusion")); // these lines before the next
QApplication a(argc, argv);
You will need to add #include <QStyleFactory> on top to make it work.
For anyone who's facing the same issue and using PyQt. Here's the solution.
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
app = QtWidgets.QApplication(sys.argv)
You just need to set an environment variable :)
I'm trying to get Qt and EGL to work together. I'm working on a program that uses EGL to draw, and I have to use Qt to create a GUI overlay.
The current solution was to turn a QWidget into a native window, and pass it's window handle to EGL. This works, but it's difficult to work with. Qt isn't aware that the widget is being drawn in by something else. So when another widget is overlaid, even if it's transparent, the image drawn by EGL is erased. The only way to get them to work is if I jigsaw the buttons and other GUI elements in a way that they don't overlap the parts of the native window I want to show. However this means that I can't use layouts or QML or any of the tools that would make creating different GUIs easy.
So my question is, how can I draw with EGL into Qt in a more usable way.
I'm working with Qt 5.4.2 by the way. If absolutely necessary, I might be able to upgrade to 5.5, but newer versions won't work.
I was looking into QOpenGLContext, and ways to make it use the context created by EGL, but I can't seem to find any good examples on how to actually go about doing this.
I'm using three different QGLWidgets in the same main thread, preferably rendered at 60fps but I cannot achieve more than 20fps. It seems that this is caused by Vsync as each widget probably tries to synchronize with the refresh rate independently and therefore they lock somehow. If I only use two widgets I achieve 30fps. Or if I fix the update rate of one widget to, let's say 10fps, I reach 25fps on the others (10+25+25=60). swapInterval() always returns 0, independent of the value I set with setSwapInterval(int). Any ideas? Can I disable Vsync? Or might the problem be caused by something different?
It seems that its currently the bug from Qt 5.0 - https://bugreports.qt.io/browse/QTBUG-29073
Turning the Vsync off will solve the problem with dividing update rate between QGLWidgets, your graphics card will render to screen as fast as you tell it to or as fast as it can. But you must disable the VSync in graphics card settings. Just setting fmt.setSwapInterval(0) will do nothing.
Unfortunately another problem raises, if you are painting video that contains horizontal moves, tearing will appear.
Hopefully the Qt 5.3 shall fix this bug.
For those who are still struggling with this issue, my short answer is: before trying anything else: install Qt 5.4.
Longer answer:
I never had any issue to disable VSync with Qt 4.8.
Using Qt 5.3.1 (in Kubuntu 14.04 64bit), I have never been able to force my QGLWidget not to sync at VBlank, which means that swapBuffers() was blocking no matter what. I disabled VSync both in the "Desktop effect" panel and the NVidia control panel, and setSwapInterval(0) to no avail. Therefore my fps have always been clamped to 60fps/numOfQGLWidget (unless I used SingleBuffering, but the flickering was not tolerable in my applications). Using multi-threading, it should theoretically be possible to have VSync enabled (hence no tearing), and achieve 60fps for multiple QGLWidget, but I failed to have that working as well.
Today, I just installed Qt 5.4, and it magically solved the issue: I can successfully have a non-blocking swapBuffers(), as I used to in Qt 4.8. I think Qt 5.3 forced VSync somehow no matter what you driver settings were. But it is no longer the case in Qt 5.4, at least in my configuration. It seemed the Qt team did a lot of work to improve OpenGL for Qt 5.4 (notably, they introduced the QOpenGLWidget class), so my advice to anyone using OpenGL with Qt would be to make the update to Qt 5.4, it will likely make your life easier.
Who knows QML scrollbar component with the standard Windows style?
See the blog entry QML Components for Desktop? in the Qt Labs Blog. But beware: this is unfinished code and in my installation (Qt 4.7.2, Vista, MSVC-2008) the example did not work out of the box for me.
You probably don't need this anymore, but I just stumbled into the same problem and this post might be useful to whoever have the same needs. It contains a scrollbar qml source that worked pretty well for me. It doesn't have the standard windows style though, so you'd have to tweak its appearance a little.