Forum > QT

Where are the images of MenuItem?

(1/2) > >>

Yakumo500:
Hi,
I'm using QT under Linux because it draws faster text than GTK2. However now I want to use a mainmenu and i recognize that the QT mainmenu doesn't support images.

Is there a way to show images in menuitems?

Ocye:
I guess icons are shown if item is disabled (-> Thread: Icons and QT).

Blaazen:

--- Quote ---Is there a way to show images in menuitems?
--- End quote ---
Probably no. You can use TToolBar instead of TMainMenu and assign some images from your TImageList to TToolButtons and show their captions. You can create TPopupMenus and assign them to TToolButtons (as their DropDownMenu property).

Avishai:
If you are willing to put in the effort, you can construct your own with a combination of TPanels, TImages, TLabels and TPopupMenus.  But it sounds like a lot of work just to get some Icons.

JuhaManninen:

--- Quote from: Yakumo500 on November 06, 2011, 04:51:24 pm ---Hi,
I'm using QT under Linux because it draws faster text than GTK2. However now I want to use a mainmenu and i recognize that the QT mainmenu doesn't support images.

Is there a way to show images in menuitems?

--- End quote ---

All sub-menuitems in MainMenu do supports images. Set Images property in MainMenu and ImageIndex property in MenuItems.
Top-level menuitems do not support images in a portable way but GTK2 and Windows seem to draw them. LCL MainMenu for Windows  is actually a custom-drawn control because some Windows versions don't support images in menus at all.

QT bindings seem to have a bug. If you set ImageIndex for a top-level menuitem then no images are shown even in sub-menus.
You could make a bug report of this.

Juha

Navigation

[0] Message Index

[#] Next page

Go to full version