crossplatform.ru

Здравствуйте, гость ( Вход | Регистрация )

> Qt и иконки Windows, Как загрузить в QIcon файл .ico
0xF
  опции профиля:
сообщение 24.6.2008, 23:42
Сообщение #1


Студент
*

Группа: Участник
Сообщений: 71
Регистрация: 12.11.2007
Пользователь №: 20

Спасибо сказали: 0 раз(а)




Репутация:   0  


Сабж. Нужно загрузить в него виндозную иконку. А как я понял конструктор хавает только всякие png, jpg и др.
Как заюзать .ico? И можно ли?
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение
 
Начать новую тему
Ответов
ViGOur
  опции профиля:
сообщение 25.6.2008, 8:05
Сообщение #2


Мастер
******

Группа: Модератор
Сообщений: 3296
Регистрация: 9.10.2007
Из: Москва
Пользователь №: 4

Спасибо сказали: 231 раз(а)




Репутация:   40  


Вот что пишется в Setting the Application Icon on Windows
Цитата
Setting the Application Icon on Windows

First, create an ICO format bitmap file that contains the icon image. This can be done with e.g. Microsoft Visual C++: Select File|New, then select the File tab in the dialog that appears, and choose Icon. (Note that you do not need to load your application into Visual C++; here we are only using the icon editor.)

Store the ICO file in your application's source code directory, for example, with the name myappico.ico. Then, create a text file called, say, myapp.rc in which you put a single line of text:

IDI_ICON1 ICON DISCARDABLE "myappico.ico"

Finally, assuming you are using qmake to generate your makefiles, add this line to your myapp.pro file:

RC_FILE = myapp.rc

Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.

If you do not use qmake, the necessary steps are: first, run the rc program on the .rc file, then link your application with the resulting .res file.


Как вариант для коммерческой версии Qt: ICO Image Format
Перейти в начало страницы
 
Быстрая цитата+Цитировать сообщение

Сообщений в этой теме


Быстрый ответОтветить в данную темуНачать новую тему
Теги
Нет тегов для показа


1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0




RSS Текстовая версия Сейчас: 19.4.2024, 14:55