Skip to content
  • 0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi,

    You can try implementing a QStyledDelegateItem and paint only the icon.

    Hope it helps

  • 0 Votes
    5 Posts
    3k Views
    J

    @mrjj @jsulm Thanks you for your replies. As it turns out, the crash I mentioned was actually caused by a subtle, yet important bug in our test infrastructure: we have a special fixture that will instantiate and destruct the QApplication instance before respectively after each test case. We initiated the argc and argv parameters with variables local to the constructor. For some reason creating a QIcon causes Qt to access argv, in other words: a crash.

    Short story: both your suggestion, but also my original approach work perfectly!

  • 0 Votes
    3 Posts
    2k Views
    mrjjM

    @Aram
    Its completely ok.
    Just mark it as SOLVED and all will be happy

  • 0 Votes
    2 Posts
    2k Views
    M

    Hi,

    you can store the old values and restore them later

    class MyWindow: public MainWindow { .... private: QSize _originalSize; }; void MyWindow::changeIconSize() { _originalSize = iconSize(); setIconSize(...); } void MyWindow::restoreSize() { setIconSize(_originalSize); }