Results 1 to 2 of 2

Thread: Migration from Qt 5.15.7 to Qt 6.7.0 and a small problem with QTreeWidget

  1. #1
    Join Date
    Apr 2024
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Migration from Qt 5.15.7 to Qt 6.7.0 and a small problem with QTreeWidget

    Hi everybdy,

    I'm now developping with Qt since 2010, I think (something like that), my last project has been developped with Qt 5.15.7 and I now need to convert it to Qt 6.7.0 for some reasons.

    The problem I got is wit the QTreeWidget, and especially the items.

    A simple example :

    Qt Code:
    1. QTreeWidget* tree = new QTreeWidget(this);
    2. tree->setColumnCount(2);
    3. setCentralWidget(tree);
    4.  
    5. item->setText(0, "blablabla");
    6. item->setText(1, "blablabla");
    7. tree->addTopLevelItem(item);
    8. item->setForeground(0, QBrush(Qt::red));
    9. item->setBackground(1, QBrush(Qt::red));
    To copy to clipboard, switch view to plain text mode 

    is giving me this :

    testFG.jpg

    As you can see, the background is set in red (setBackground ok), but not the text (setforeground nok).
    Of course, it was working flawlessly with Qt 5.15.7 (and it's a very basic thing, so...). Do I miss something? Did you find thins kind of problem and do you have any idea how to solve it? I've fixed all the other inconveniances I've found, due to the upgraded Qt, but this one...

    Thanks everyone!

    Qt 6.7.0 / Windows / MSVC2019
    Last edited by AgentX; 18th April 2024 at 21:24.

  2. #2
    Join Date
    Apr 2024
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Migration from Qt 5.15.7 to Qt 6.7.0 and a small problem with QTreeWidget

    [solved] : just a problem with the style, everything is perfect with WindowsVista style

Similar Threads

  1. A small annoying problem in my QGraphicsScene
    By AtlasS in forum Qt Programming
    Replies: 5
    Last Post: 27th January 2013, 14:53
  2. Small problem
    By NewLegend in forum Qt Programming
    Replies: 1
    Last Post: 23rd July 2010, 21:52
  3. Qt4 migration
    By grsandeep85 in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2009, 07:31
  4. i have a problem in a very small application?
    By coder1985 in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2007, 17:09
  5. QPainter problem - migration from qt3 [SOLVED]
    By tpomorsk in forum Qt Programming
    Replies: 7
    Last Post: 28th August 2006, 14:43

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.