This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Window move on mouseReleaseEvent implementation?

Tags: None
(comma "," separated)
udx6bs
Registered Member
Posts
11
Karma
0
OS
Hi there,
I have a weird problem with QT 4.6.2 and KDE 4.5 beta2 on Kubuntu Lucid.

If I define "void mouseReleaseEvent(QMouseEvent *);" for a widget and single click on that widget the window will be grabbed for moving by KDE.

Here I created a basic Project:

main.cpp
Code: Select all
#include <QtGui/QApplication>
#include "mainwindow.h"

int main(int argc, char *argv[]){
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}

mainwindow.h
Code: Select all
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>

class MainWindow : public QMainWindow{
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
};

class CTestClick : public QWidget{
  Q_OBJECT
public:
  CTestClick();
protected:
//  void mouseReleaseEvent(QMouseEvent *);
};

#endif

mainwindow.cpp
Code: Select all
#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
  CTestClick *widget = new CTestClick;
  this->setCentralWidget(widget);
}


CTestClick::CTestClick(){}

//void CTestClick::mouseReleaseEvent(QMouseEvent *){}


If I uncomment the two lines in "mainwindow.cpp" and "mainwindow.h", window gets grabbed on a single click if i leave it in the comments than the window doesn't get grapped.


Am I not understanding something here or is this some sort of bug in QT or KDE? Maybe some sort of KDE setting? Should I even be asking for help if I use KDE4.5 beta2 or should I wait for a stable release and test it there and come back if my problem is still there?

In the meantime I will use a QPushButton for my purposes.

Thx in advance for any replies.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This is a bug in the Oxygen style, whose behaviour has been adjusted in KDE 4.5 Trunk.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
udx6bs
Registered Member
Posts
11
Karma
0
OS
Thanks for the fast reply
udx6bs
Registered Member
Posts
11
Karma
0
OS
This bug is solved in KDE 4.5 RC1. It behaves just like it should.
Thanks again for the answer.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]