Results 1 to 4 of 4

Thread: QSplitter handle invisible on Win32

  1. #1
    Join Date
    Oct 2006
    Posts
    5
    Qt products
    Qt4

    Default QSplitter handle invisible on Win32

    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):
    Qt Code:
    1. #include <qapplication.h>
    2. #include <qframe.h>
    3. #include <qpushbutton.h>
    4. #include <qsplitter.h>
    5.  
    6. class gui : public QFrame {
    7. public:
    8. gui();
    9.  
    10. private:
    11. QSplitter* split;
    12.  
    13. QPushButton* left_button;
    14. QPushButton* right_button;
    15. };
    16.  
    17. gui::gui() {
    18. left_button = new QPushButton("Left");
    19. right_button = new QPushButton("Right");
    20.  
    21. split = new QSplitter(Qt::Horizontal, this);
    22. split->addWidget(left_button);
    23. split->addWidget(right_button);
    24. }
    25.  
    26. int main(int argc, char** argv) {
    27. QApplication app(argc, argv);
    28.  
    29. gui* w = new gui();
    30.  
    31. w->show();
    32.  
    33. app.exec();
    34.  
    35. delete w;
    36. return 0;
    37.  
    38. }
    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.

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplitter handle invisible on Win32

    I think that is how splitters are suppose to look on windows. The cursor changes when you mouse over it.

  3. #3
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSplitter handle invisible on Win32

    Hi
    I don't think it is the way it has to be on windows.
    And as Qt4.1.4 it showed a bar in raised style. Qt4.2 does not anymore
    Regards.

  4. #4
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSplitter handle invisible on Win32

    Use a QVBoxLayout to wrapper your splitter.

Similar Threads

  1. Override QSplitter to draw new handle
    By grogan in forum Qt Programming
    Replies: 4
    Last Post: 27th September 2006, 03:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.