qevent

How to use focusInEvent and focusOutEvent [duplicate]

你离开我真会死。 提交于 2020-01-23 23:25:32
问题 This question already has answers here : How to resize the QToolButton when focus is coming on that QToolButton (2 answers) Closed 6 years ago . I am implementing an application in which i am having 3 QToolButton and when the focus is coming on any QToolButton it should resize . One of my friend has given me answer but i am unable to figure it out as i am inheriting QMainWindow class as well in my mainWindow. He is telling to inherit QToolButton too. But multiple inheritance problem will

How to use focusInEvent and focusOutEvent [duplicate]

江枫思渺然 提交于 2020-01-23 23:24:09
问题 This question already has answers here : How to resize the QToolButton when focus is coming on that QToolButton (2 answers) Closed 6 years ago . I am implementing an application in which i am having 3 QToolButton and when the focus is coming on any QToolButton it should resize . One of my friend has given me answer but i am unable to figure it out as i am inheriting QMainWindow class as well in my mainWindow. He is telling to inherit QToolButton too. But multiple inheritance problem will

Qt5.5 How to override MousePress event coordinates at Application level

帅比萌擦擦* 提交于 2020-01-17 13:46:12
问题 I'm developing an application on a small Embedding Linux device with Qt5.5. I need to be able to modify the mouse press coordinates received from Linux ( tslib ) in my application. I've tried implementing an event filter in my main view that modifies the mouse coordinate received, creates a new mouse event and submits the new event to the widget. However, in the widget's mousePressEvent function, I see the debug message only once, and it is for the original coordinates received, not my

Getting Pixmap is a null pixmap on calling a function 500 times

≡放荡痞女 提交于 2020-01-06 19:31:43
问题 I am showing a image in qt label. Below is my code: void MyClass::onPushButtonClicked(QString myurl) { this->setCursor(Qt::WaitCursor); ui.qtImageLabel->clear(); qDebug()<<QTime::currentTime()<<"MyClass: onPushButtonClicked"; QNetworkAccessManager *qnam_push_button_clicked_show_image; QNetworkReply *reply; QNetworkRequest request; request.setHeader( QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded" ); QUrl url(myurl); request.setUrl(url); qnam_push_button_clicked_show

Getting Pixmap is a null pixmap on calling a function 500 times

泪湿孤枕 提交于 2020-01-06 19:31:04
问题 I am showing a image in qt label. Below is my code: void MyClass::onPushButtonClicked(QString myurl) { this->setCursor(Qt::WaitCursor); ui.qtImageLabel->clear(); qDebug()<<QTime::currentTime()<<"MyClass: onPushButtonClicked"; QNetworkAccessManager *qnam_push_button_clicked_show_image; QNetworkReply *reply; QNetworkRequest request; request.setHeader( QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded" ); QUrl url(myurl); request.setUrl(url); qnam_push_button_clicked_show

Qt mouse move events not caught by an event filter

半世苍凉 提交于 2020-01-02 05:25:14
问题 I can't seem to catch QEvent::MouseMove typed events in my eventFilter. Here's my event filter: bool MapWidget_c::eventFilter( QObject *obj, QEvent *ev ) { if( obj == graphicsGeoMap_mp || obj == graphicsScene_mp || obj == graphicsView_mp ) { if( ev->type() == QEvent::MouseMove ) { QMouseEvent *mouseEvent = static_cast< QMouseEvent* >( ev ); mouseMoveEvent( mouseEvent ); return true; } else { return false; } } else { // pass the event on to the parent class return QWidget::eventFilter( obj, ev

What's the QMetaCallEvent for and how to access its details?

元气小坏坏 提交于 2019-12-29 00:44:07
问题 I have an event filter and I noticed when I click to expand/collapse a tree branch I get QEvent::MetaCall . I was thinking about using this to roll my own expand/collapse code, but I don't know how to get any information, such as the index of the item. Is there anything available from this MetaCall event type? I found someone had asked this same question on another site, but without an answer, here: http://www.qtcentre.org/threads/37525-How-to-filter-QEvent-MetaCall What is this event

Get visible area of QPainter

半城伤御伤魂 提交于 2019-12-24 01:42:51
问题 I have an owner-drawn QWidget inside a QScrollArea , so when painting, and I want to paint only the parts that are visible. To do so, I need to have the rectangle of the visible area of the QPainter . The only candidates were QPainter::viewport() , QPainter::window() , and QPainter::clipBoundingRect() , so I put this code to log their output: setMinimumHeight(3000); setMinimumWidth(3000); } void MyWidget::paintEvent(QPaintEvent *) { QPainter painter(this); qDebug() << painter.viewport() <<

Pass Events Between QML Objects

寵の児 提交于 2019-12-23 04:21:09
问题 I have a situation where I would like to pass a QML event to another QML item in the middle of the initial event handler. e.g. Item { id: item1 Keys.onPressed: { // Pre-process... passEventToObject(event, item2); // Post-process based on results of event passing... } } TextInput { id: item2 // Expect key press event to be handled by text input } What can I do to acheive passEventToObject ? Notes: I don't have access to modify Keys.onPressed inside item2 , it's a QML built-in ( TextInput ).

Why pressing of “Tab” key emits only QEvent::ShortcutOverride event?

我的未来我决定 提交于 2019-12-18 13:23:14
问题 Background Hi guys. I've made a custom widget with QLineEdit and several QPushButtons to use it with custom item delegate: class LineEditor : public QWidget { public: explicit LineEditor(QWidget *parent = 0) : QWidget(parent) { setLayout(new QHBoxLayout); layout()->setContentsMargins(0, 0, 0, 0); layout()->setSpacing(0); QLineEdit *edit = new QLineEdit(this); layout()->addWidget(edit); layout()->addWidget(new QPushButton(this)); layout()->addWidget(new QPushButton(this)); setFocusProxy(edit);