I'm working on a program that uses two QSplitters objects. Functionally this works without issue, but visually there is a significant difference between Linux and Windows.
On Linux, whatever theme I am currently using takes care of how to render the splitter handles. Here is a basic example:
On Linux:

However, in Windows, while the layout is the same, the handle that divides the sections is not visible.
On Windows:

Of course it is still there, but if one were to look at the program it would not be immediately obvious there was a splitter handle located there.
The problem is much more evident in a larger example.
On Linux:

On Windows:

I would like to see some sort of divider, perhaps something similar to how the QDockWidget's divider looks.
Here is the code I am using for the first example (written quickly since the 2nd example is too long to post):
#include <qapplication.h>
#include <qframe.h>
#include <qpushbutton.h>
#include <qsplitter.h>
public:
gui();
private:
};
gui::gui() {
split->addWidget(left_button);
split->addWidget(right_button);
}
int main(int argc, char** argv) {
gui* w = new gui();
w->show();
app.exec();
delete w;
return 0;
}
#include <qapplication.h>
#include <qframe.h>
#include <qpushbutton.h>
#include <qsplitter.h>
class gui : public QFrame {
public:
gui();
private:
QSplitter* split;
QPushButton* left_button;
QPushButton* right_button;
};
gui::gui() {
left_button = new QPushButton("Left");
right_button = new QPushButton("Right");
split = new QSplitter(Qt::Horizontal, this);
split->addWidget(left_button);
split->addWidget(right_button);
}
int main(int argc, char** argv) {
QApplication app(argc, argv);
gui* w = new gui();
w->show();
app.exec();
delete w;
return 0;
}
To copy to clipboard, switch view to plain text mode
Has anyone else had this problem?
I have tried QSplitter::setHandleWidth() but it doesn't seem to do anything.
Bookmarks