qt5

Qt 5.7 QDockWidget default size

北慕城南 提交于 2020-01-17 12:38:25
问题 I am trying to have following setup: at start (when main window is opened) I want to have 2 QDockWidgets at left with width 400px and height 1/2 (each) of QMainWindows height. At the left, 3 QDockWidgets with width 400px and height 1/3 (each) of QMainWindows height. All of 5 widgets have to be resizable . That means using setFixSize() won't work in this case. So far I've tried changing Geometry>Width and Gemetry>Height in designed -> didn't work. Then I tried using resize() in main window

Qt 5.7 QDockWidget default size

限于喜欢 提交于 2020-01-17 12:37:28
问题 I am trying to have following setup: at start (when main window is opened) I want to have 2 QDockWidgets at left with width 400px and height 1/2 (each) of QMainWindows height. At the left, 3 QDockWidgets with width 400px and height 1/3 (each) of QMainWindows height. All of 5 widgets have to be resizable . That means using setFixSize() won't work in this case. So far I've tried changing Geometry>Width and Gemetry>Height in designed -> didn't work. Then I tried using resize() in main window

inject code to webpage using QWebEnginePage::runJavaScript()

为君一笑 提交于 2020-01-17 01:33:10
问题 When QWebEngineView starts loading a web page , I want to inject a web page progress bar to it, my code as the following , but I cannot see the progress bar during loading , so what's wrong ? import sys from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWebEngineCore import * from PyQt5.QtCore import * class WebEngineView(QWebEngineView): def __init__(self, parent=None): super().__init__(parent) self.webPage = self.page() self.webPage.runJavaScript(''' var

Qt's nativeEvent() is never called

非 Y 不嫁゛ 提交于 2020-01-16 18:06:32
问题 I am trying to recieve windows messages in my Qt App. I first started with winEvent() function but it was never called and I learned in Qt 5.4 it is recommended to use nativeEvent() however it is also never called as well? The following is my code, it is bare bone application, I just want to catch messages like WM_PAINT and also system message when USB device is plugged in. // mainwindow.h #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q

How to set a basic GridLayout with Buttons, GroupBox, Text and ProgressBar in QML

試著忘記壹切 提交于 2020-01-16 08:37:08
问题 Sorry if this question is simple but I am reviewing the official documentation on how to set up a GridLayout with Buttons , Text , GroupBox and a ProgressBar in QML . The layout I am trying to achieve is the following below: The problem I have is that I am struggling to achieve the layout above. I am having some problems understanding how to position the elements in the correct way inside the page. What I have done so far: 1) I found a very useful example which I replicated successfully in

Can i set a breakpoint inside Qt itself?

扶醉桌前 提交于 2020-01-16 07:53:32
问题 As a sub-question to this, I want to know, since Qt5 is distributed with full source code, is it possible to set up debugger break-points inside Qt itself ? Is there a symbol file shipped with Qt5 for the binary build? Do I have to build my own Qt to do this? What is the fastest way to have breakpoints inside Qt5 working with QtCreator on Ubuntu? 回答1: You need to configure and build qt yourself with debug symbols. ( -debug ) Then in QtCreator you can go to Options > Debugger > General and "

Specifying OpenGL Desktop instead of ES for Qt5

[亡魂溺海] 提交于 2020-01-16 05:35:33
问题 I am finally trying to wrap my head around shaders, using a tutorial I found. I decided to start with Qt5 (Windows) since I'm familiar with it and can focus on learning GLSL itself to start with. The only difference between what I'm doing and the tutorial is that I'm working with a QOpenGLWidget rather than a QOpenGLWindow (I just have a form with one widget on it, nothing special). To get started with a fragment shader, in Qt I added a new desktop (not ES) fragment shader to my project, and

QToolButton with icon + text: How to center both?

陌路散爱 提交于 2020-01-15 18:48:14
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to

QToolButton with icon + text: How to center both?

青春壹個敷衍的年華 提交于 2020-01-15 18:47:23
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to

QToolButton with icon + text: How to center both?

大城市里の小女人 提交于 2020-01-15 18:47:13
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to