Results 1 to 3 of 3

Thread: qt manhattan style

  1. #1
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt5

    Default qt manhattan style

    Hello ,

    I ahve used qt manhattan style https://github.com/tegesoft/qt-manhattan-style to create a fancy tab widget, I have used a palette to change the color of the widget

    Manhattan::FancyTabWidget* ptab = new Manhattan::FancyTabWidget(this);
    QPalette* palette = new QPalette();
    QLinearGradient linearGradient(QPointF(50, 50), QPointF(200, 200));
    linearGradient.setColorAt(0, Qt::lightGray);
    linearGradient.setColorAt(1, Qt::gray);
    palette->setBrush(QPalette::Window,*(new QBrush(linearGradient)));
    ptab->setPalette(*palette);

    setCentralWidget(ptab);

    the pallete did not take effect. how can I change the back ground of the fancy tab widget to a gradient color.

    Regards

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qt manhattan style

    If you want to set the background then perhaps you want setBackgroundBrush().

    BTW: Don't allocate things on the heap if they do not need to be. The QPalette and QBrush in your code are memory leaks.

  3. #3
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt5

    Default Re: qt manhattan style

    Thanks for the reply, I have used setBackgroundBrush(), but also did not work. I think it is time to define my own style instead of reusing one.

    Regards

Similar Threads

  1. Replies: 6
    Last Post: 29th December 2011, 18:37
  2. How to apply style for widget over application style
    By muthu-ms in forum Qt Programming
    Replies: 5
    Last Post: 21st October 2011, 08:16
  3. Do Qt Style Sheets support List-style-image?
    By daiheitan in forum Qt Programming
    Replies: 6
    Last Post: 12th March 2010, 01:41
  4. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 12:48
  5. Replies: 1
    Last Post: 7th February 2007, 00:12

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.