PDA

View Full Version : QDockWidget bugged??



valerianst
5th September 2013, 12:22
Hi there,

I have two question about QDockWidget. I hope I haven't found a bug!


1) I have a QDockWidget. I have set as widget a class derived from QWidget that contains 4 QFrames. Inside each frame there are different widgets.
My goal is to save vertical space, by making the widgets really close among them.

I have tried to use setSpacing(1) to the main QVBoxLayout (the one that separates the QFrames) and it works.

The problem is inside the QFrame.. if I try to do the same inside the QFrame it doesn't work. I have read other posts and it seems that dealing with QDockWidget is not simple.. is this a known bug?

2) I have set a background color for the QDockWidget doing:


QPalette playbackPalette(playbackManagementDock_->palette());
playbackPalette.setColor(playbackManagementDock_->backgroundRole(), QColor(207,205,202));
playbackManagementDock_->setAutoFillBackground(true);
playbackManagementDock_->setPalette(playbackPalette);

The background is correctly changed but there is a problem related to the various QLineEdits that it contains.
When one of these widgets changes text (using the setText() method), for some reason, a rectangular object (by the way, of a different color) is being drawn in correspondence of the widget. The QLineEdit has rounded borders.. it's like if a bounding rectangle is being drawn without reason..

Do you know a method to prevent this, possibly without setting properties on the various QLineEdit?


Cheers

wysota
5th September 2013, 15:44
Can you post a minimal compilable example reproducing the problem?

valerianst
5th September 2013, 17:00
Can you post a minimal compilable example reproducing the problem?

Hi,

it should be a lot of code but I think I'll try later..

Any quick idea or comment about them?

wysota
5th September 2013, 17:10
it should be a lot of code but I think I'll try later..
If you can't reproduce it using 50 lines of code then that's not a bug in Qt but rather in your code.