Bitcoin Forum
May 05, 2024, 12:40:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to increase the size of icons in QToolbar?  (Read 172 times)
SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 18, 2019, 10:04:56 PM
Merited by ABCbits (1)
 #1

Maybe anyone will know, how do I increase the icon size on QToolbar?

I've found how to remove the text and I want to see a bit bigger icons. I've done some changes, but only the toolbar itself has grown in size. Icons of QToolbar stay at 24x24 px. I tried searching the code, but I just couldn't find it... Maybe anyone knows?


 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
1714912818
Hero Member
*
Offline Offline

Posts: 1714912818

View Profile Personal Message (Offline)

Ignore
1714912818
Reply with quote  #2

1714912818
Report to moderator
1714912818
Hero Member
*
Offline Offline

Posts: 1714912818

View Profile Personal Message (Offline)

Ignore
1714912818
Reply with quote  #2

1714912818
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714912818
Hero Member
*
Offline Offline

Posts: 1714912818

View Profile Personal Message (Offline)

Ignore
1714912818
Reply with quote  #2

1714912818
Report to moderator
1714912818
Hero Member
*
Offline Offline

Posts: 1714912818

View Profile Personal Message (Offline)

Ignore
1714912818
Reply with quote  #2

1714912818
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
January 18, 2019, 10:51:24 PM
 #2

Have you tried making bigger source images for the icons? IIRC the source images make that size. The icons are in src/qt/res/icons

SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 18, 2019, 10:53:23 PM
 #3

Hi. Thanks for the answer. Yes, I'm using 128x128 PNG actually. Also, I've noticed that even the standard PNG's are 32x32, while when the wallet is opened, it's 24x24, no matter what size PNG you have in the folder.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
January 18, 2019, 11:34:31 PM
 #4

Ah, I was mistaken. You are using the QIcon class for your icons. The size of the displayed icon is determined by the current active style. For a QToolbar, the size of an icon is default to 24x24. You can change this by using QToolBar::setIconSize(). I think that should work.

SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 19, 2019, 12:10:53 AM
 #5

Ah, I was mistaken. You are using the QIcon class for your icons. The size of the displayed icon is determined by the current active style. For a QToolbar, the size of an icon is default to 24x24. You can change this by using QToolBar::setIconSize(). I think that should work.

Thank you!

This should be set in somewhere here, right?


 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
January 19, 2019, 12:21:20 AM
 #6

This should be set in somewhere here, right?
Yes. Do it right after the toolbar is created.

SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 19, 2019, 08:56:50 AM
Last edit: January 19, 2019, 09:16:32 AM by SBDomains
 #7

This should be set in somewhere here, right?
Yes. Do it right after the toolbar is created.

Hmm, tried couple ways, but then it fails to compile when compiling bitcoingui.o

Running autogen.sh now, but not sure if that could fix the problem.

---

Nope, running autogen.sh did not fix that, still get the following:

Code:
qt/bitcoingui.cpp: In member function ‘void BitcoinGUI::createToolBars()’:
qt/bitcoingui.cpp:563:9: error: ‘toolBar’ was not declared in this scope
         toolBar->setIconSize(QSize(128, 128));
         ^~~~~~~
qt/bitcoingui.cpp:563:9: note: suggested alternative: ‘toolbar’
         toolBar->setIconSize(QSize(128, 128));
         ^~~~~~~
         toolbar
Makefile:7546: recipe for target 'qt/qt_libprontoqt_a-bitcoingui.o' failed
make[2]: *** [qt/qt_libprontoqt_a-bitcoingui.o] Error 1
make[2]: Leaving directory '/root/source_code/src'
Makefile:10568: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/source_code/src'
Makefile:688: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Tried some other ways:

Quote
qt/bitcoingui.cpp: In member function ‘void BitcoinGUI::createToolBars()’:
qt/bitcoingui.cpp:563:17: error: expected unqualified-id before ‘->’ token
         QToolBar->setIconSize(100,100);
                 ^~
Makefile:7546: recipe for target 'qt/qt_libprontoqt_a-bitcoingui.o' failed
make[2]: *** [qt/qt_libprontoqt_a-bitcoingui.o] Error 1
make[2]: Leaving directory '/root/source_code/src'
Makefile:10568: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/source_code/src'
Makefile:688: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3042


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
January 19, 2019, 09:27:42 AM
 #8

Code:
qt/bitcoingui.cpp:563:9: note: suggested alternative: ‘toolbar’
         toolBar->setIconSize(QSize(128, 128));
         ^~~~~~~
         toolbar
As the compiler suggestion suggests, names are case sensitive.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 19, 2019, 09:44:23 AM
 #9

Code:
qt/bitcoingui.cpp:563:9: note: suggested alternative: ‘toolbar’
         toolBar->setIconSize(QSize(128, 128));
         ^~~~~~~
         toolbar
As the compiler suggestion suggests, names are case sensitive.

Yeah, I also tried doing that, then it gives the following:

Code:
qt/bitcoingui.cpp: In member function ‘void BitcoinGUI::createToolBars()’:
qt/bitcoingui.cpp:563:37: error: no matching function for call to ‘QToolBar::setIconSize(int, int)’
         toolbar->setIconSize(100,100);
                                     ^
In file included from /root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/QToolBar:1:0,
                 from qt/bitcoingui.cpp:61:
/root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/qtoolbar.h:170:10: note: candidate: void QToolBar::setIconSize(const QSize&)
     void setIconSize(const QSize &iconSize);
          ^~~~~~~~~~~
/root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/qtoolbar.h:170:10: note:   candidate expects 1 argument, 2 provided
Makefile:7546: recipe for target 'qt/qt_libprontoqt_a-bitcoingui.o' failed
make[2]: *** [qt/qt_libprontoqt_a-bitcoingui.o] Error 1
make[2]: Leaving directory '/root/source_code/src'
Makefile:10568: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/source_code/src'
Makefile:688: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Tried doing "setIconSize(100);" instead of "setIconSize(100,100);" and it gives the same result.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
SBDomains (OP)
Sr. Member
****
Offline Offline

Activity: 630
Merit: 256



View Profile
January 19, 2019, 09:53:26 AM
 #10

Code:
qt/bitcoingui.cpp:563:9: note: suggested alternative: ‘toolbar’
         toolBar->setIconSize(QSize(128, 128));
         ^~~~~~~
         toolbar
As the compiler suggestion suggests, names are case sensitive.

Yeah, I also tried doing that, then it gives the following:

Code:
qt/bitcoingui.cpp: In member function ‘void BitcoinGUI::createToolBars()’:
qt/bitcoingui.cpp:563:37: error: no matching function for call to ‘QToolBar::setIconSize(int, int)’
         toolbar->setIconSize(100,100);
                                     ^
In file included from /root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/QToolBar:1:0,
                 from qt/bitcoingui.cpp:61:
/root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/qtoolbar.h:170:10: note: candidate: void QToolBar::setIconSize(const QSize&)
     void setIconSize(const QSize &iconSize);
          ^~~~~~~~~~~
/root/source_code/depends/i686-w64-mingw32/share/../include/QtWidgets/qtoolbar.h:170:10: note:   candidate expects 1 argument, 2 provided
Makefile:7546: recipe for target 'qt/qt_libprontoqt_a-bitcoingui.o' failed
make[2]: *** [qt/qt_libprontoqt_a-bitcoingui.o] Error 1
make[2]: Leaving directory '/root/source_code/src'
Makefile:10568: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/source_code/src'
Makefile:688: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Tried doing "setIconSize(100);" instead of "setIconSize(100,100);" and it gives the same result.

My bad! Actually it did work! Thanks for the help guys, I really appreciate it. I'm trying to learn some QT myself, so I really appreciate the help you've given! Smiley

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
CryptoTalk.org| 
MAKE POSTS AND EARN BTC!
🏆
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3042


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
January 19, 2019, 10:09:45 AM
Merited by ABCbits (1)
 #11

For the benefit of anyone from the future finding this thread after having a similar problem, what "actually worked" was using QSize instead of int(s):
Code:
toolbar->setIconSize(QSize(128, 128));

(Hint: when the compiler tells you one part of a statement/expression is wrong, try changing only the wrong part instead of other parts that may have been right the first time.)

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!