Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QIcon set default size
Forum Updated to NodeBB v4.3 + New Features

QIcon set default size

Scheduled Pinned Locked Moved General and Desktop
qicon
2 Posts 2 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • metaDomM Offline
    metaDomM Offline
    metaDom
    wrote on last edited by
    #1

    Hey guys,

    after setting the iconsize via "setIconSize(QSize(screenY/30, screenY/30));", I would like to set it back to default.

    Any idea how to?

    Thanks in advance!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      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);
      }
      

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved