QTabWidget tabs on the vertical, but text in horizontal

后端 未结 3 659
独厮守ぢ
独厮守ぢ 2021-02-05 15:52

I\'m trying to make an app in C++ Qt with a sidebar like this one:

\"Finder's

But when making

相关标签:
3条回答
  • 2021-02-05 16:12

    A bit of "advertising" for a WTFPL implementation here on assembla Any contribution will be much appreciated.

    exemple1 exemple2 exemple3

    0 讨论(0)
  • 2021-02-05 16:22

    use QProxyStyle, this function will rotate 180 for text, and you can rotate 90。

    void MyProxyStyle::drawItemText( QPainter* painter,
                                     const QRect&,
                                     int alignment,
                                     const QPalette& palette,
                                     bool enabled,
                                     const QString& text,
                                     QPalette::ColorRole textRole ) const
    {
        painter->save();
        painter->translate(160,50);
        painter->rotate(-180);
    
        QCommonStyle::drawItemText( painter,
                                    rectangle,
                                    alignment,
                                    palette,
                                    enabled,
                                    text,
                                    textRole );
    
        painter->restore();
    }
    
    0 讨论(0)
  • 2021-02-05 16:33

    You can use QListWidget to show the "tabs" (with some mods to make it look like you want) and QStackedWidget to handle switching between pages like normal tab widget does.

    0 讨论(0)
提交回复
热议问题