Your images do not clearly show what you mean. There is no obvious QDockWidget in either.
The separator handle goes between dock widgets, or between dock widgets and the central widget, and allows you to resize the adjoining areas. Clearly that is not possible if the dock widget is fixed size. If it is not possible to resize a dock widget/dock widget area then there is no separator handle and no background color for it, although the space is still reserved.
Experiment with this code and move the resizable dock 2 around to see where the handles become visible/invisible.
#include <QtGui>
Q_OBJECT
public:
setStyleSheet("QMainWindow::separator { background-color: red; width: 30; height: 30px; }");
label->setFixedSize(50, 50);
dock->setWidget(label);
addDockWidget(Qt::TopDockWidgetArea, dock);
label
= new QLabel("Dock 2",
this);
dock->setWidget(label);
addDockWidget(Qt::TopDockWidgetArea, dock);
}
};
int main(int argc, char *argv[]) {
MainWindow m;
m.show();
return app.exec();
}
#include "main.moc"
#include <QtGui>
class MainWindow: public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *p = 0): QMainWindow(p) {
setCentralWidget(new QTextEdit(this));
setStyleSheet("QMainWindow::separator { background-color: red; width: 30; height: 30px; }");
QDockWidget *dock = new QDockWidget(this);
QLabel *label = new QLabel("Dock 1", this);
label->setFixedSize(50, 50);
dock->setWidget(label);
addDockWidget(Qt::TopDockWidgetArea, dock);
dock = new QDockWidget(this);
label = new QLabel("Dock 2", this);
dock->setWidget(label);
addDockWidget(Qt::TopDockWidgetArea, dock);
}
};
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
MainWindow m;
m.show();
return app.exec();
}
#include "main.moc"
To copy to clipboard, switch view to plain text mode
Bookmarks