qwidget

Qt Widgets FullScreen Margin

穿精又带淫゛_ 提交于 2019-12-20 05:47:25
问题 I want to create a program that loads google in literally full screen, so I achieved opening my qt program in full screen using w.showFullScreen(); and it works perfectly, however when I add the QWebView and set it to centralWidget like this: but when I run the program, I get some margins on the sides of the window, in other words the QWebView isn't literally in fullScreen harmoniously with the window which is, it looks like this: I don't think my code is mistaken but here it is untitled.pro:

How to insert QML view in a QWidget

可紊 提交于 2019-12-19 11:32:22
问题 I am a beginner in QML and try to insert a QML View in QWdiget but I don't understand why it doesn't work. Here is a simple example of my qml file ( this is not the real file ): import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.2 import QtQml.Models 2.1 ObjectModel { id: itemModel Rectangle { color: "orange" anchors.fill: parent } Rectangle { color: "orange" anchors.fill: parent } Rectangle { color: "orange" anchors

How to insert QML view in a QWidget

让人想犯罪 __ 提交于 2019-12-19 11:30:34
问题 I am a beginner in QML and try to insert a QML View in QWdiget but I don't understand why it doesn't work. Here is a simple example of my qml file ( this is not the real file ): import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.2 import QtQml.Models 2.1 ObjectModel { id: itemModel Rectangle { color: "orange" anchors.fill: parent } Rectangle { color: "orange" anchors.fill: parent } Rectangle { color: "orange" anchors

Programmatically promote QWidget

断了今生、忘了曾经 提交于 2019-12-19 03:43:09
问题 I have an ui file with a QProgressBar in a QWidget . Moreover, I've created my custom progress bar component that inherits from QProgressBar . In QT Designer, I can promote the QProgressBar widget to my custom widget. Is there a way to do this in the widget cpp file instead of using QT Designer? In other words, is there a way to programmatically promote a QWidget into an another custom widget of the same type (a sort of morphing )? Here follows an example: class MyProgressBar : public

Qt Widgets and derived classes

我怕爱的太早我们不能终老 提交于 2019-12-18 09:44:07
问题 I am wondering if there is a way to do this. I create a Qt Application (using Creator 3.6.1, Qt 5.6.0). I add a widget to the main window. For example a QGraphicsView called myView. I create a C++ class derived from QGraphicsView (called DerivedView) code of DerivedView class: class DerivedView : public QGraphicsView { ... I would like my new DerivedView class to control this widget. I can access a pointer to the object through ui->myView. Is there any way to do get my derived class to work

Is there a way to access the image on the QWidget's backing store?

故事扮演 提交于 2019-12-17 09:57:35
问题 I'm doing some compositing inside the paintEvent() in a custom widget. Some of the compositing is done when some areas are already painted, and I need access to the current contents painted so far. So, I'm looking for a way to access the image contents of the current backing store during a paintEvent . I've looked at QBackingStore, but there's nothing there that directly gives me access to the backing store bitmap. Is there some API, perhaps private, that could be used to provide that? If not

How to show output video of other application in Qt?

醉酒当歌 提交于 2019-12-14 03:36:31
问题 I am creating a GUI application in Qt. This application is to display output of a application X which is not related to Qt hence i cant integrate it. X will output a video . This video do not have a path since it is a real-time display of X output. I want to show this output in Qt (along with some background GUI support). So as far as my knowledge one way to do this is to get the window id of video and display that same window in QWidget. How to do this? EDIT : I am using Ubuntu. I am able to

clicked() signal for QWidget breaks stylesheets

£可爱£侵袭症+ 提交于 2019-12-13 19:38:12
问题 I want to connect clicked() signal of QWidget-container to my slot. So I wrote this code: hpp: class LinkWidget : public QWidget { Q_OBJECT public: explicit LinkWidget(QWidget * parent = 0 ); ~LinkWidget(); signals: void clicked(); protected: void mousePressEvent(QMouseEvent * event ) ; }; cpp: LinkWidget::LinkWidget(QWidget * parent) : QWidget(parent) { } LinkWidget::~LinkWidget() { } void LinkWidget::mousePressEvent(QMouseEvent * event) { emit clicked(); } Everything works fine, but I can't

Floating sub QMainWindow (QMainWindow as child widget of main QMainWindow)

痞子三分冷 提交于 2019-12-13 16:25:59
问题 I use a QMainWindow as child of my main QMainWindow . By that I get an other area which I can use for dockable widgets ( QDockWidget ). According to the following posts this is OK, it also works perfectly for me. https://qt-project.org/forums/viewthread/17519 http://www.qtcentre.org/threads/12569-QMainWindow-as-a-child-of-QMainWindow To make the QMainWindow behaving as a normal widget, I unset the window flag, this trick is mentioned in one of the posts above. Now I also want to be able to

qt - what's the purpose of initialising child widgets in parent window/widget class?

无人久伴 提交于 2019-12-13 15:01:47
问题 In the VideoWidget and the Secure Socket Client examples in Qt, the code presented there initalises the child widgets in the parent widgets, like so: SslClient::SslClient(QWidget *parent) : QWidget(parent), socket(0), padLock(0), executingDialog(false) and VideoPlayer::VideoPlayer(QWidget *parent) : QWidget(parent) , mediaPlayer(0, QMediaPlayer::VideoSurface) , playButton(0) , positionSlider(0) , errorLabel(0) However, further down the code, I see the following: playButton = new QPushButton;