Version: unspecified (using Devel) OS: Linux KConfigDialog manages various pages and displays at the left of the dialog a list of the pages, which can contain a text and an icon for each page. Reproducible: Always Steps to Reproduce: Use KConfigDialog::addPage() to add a new page. Actual Results: KConfigDialog::addPage() only accepts "const QString &pixmapName" to determine the icon that is displayed. To use a simple standard icon, you have to so something like KIconLoader iconloader; addPage(new settings_general_widget_saving(this), i18nc("@title of a page in the configuration dialog", "Saving"), iconloader.iconPath("document-save", KIconLoader::SizeEnormous * (-1))); This is not very practical. And above all you have to use a hardcoded icon size. Icon sizes should not be hardcoded, but they should be managed by the kdeui library. Expected Results: KConfigDialog::addPage() has overloaded functions that accept KIcon (or QIcon?) instead of the path to the icon file. The icon size is not hardcoded but determined by the kdeui library (like it is done for the icons in the toolbar) or by the widget style. (Would this be possible with QStyle? Some widget styles like "Skulpture" resize the icons in Buttons and Menus!) This is a spin-off bug of Bug 272266 The default icon size should be DPI sensitive. Maybe it could depend on QStyle/KStyle?
(In reply to comment #0) > KConfigDialog::addPage() only accepts "const QString &pixmapName" to determine > the icon that is displayed. To use a simple standard icon, you have to so > something like > > KIconLoader iconloader; > addPage(new settings_general_widget_saving(this), > i18nc("@title of a page in the configuration dialog", "Saving"), > iconloader.iconPath("document-save", KIconLoader::SizeEnormous * > (-1))); No that's wrong, "pixmapName" means the name of an icon in the current icon theme. Just one example of the okular sources: addPage( m_general, i18n("General"), "okular", i18n("General Options") ); (Oh, and a side note: creating a new KIconLoader is not the best idea, just use the global one you have at KIconLoader::global().)
Shame on me. I didn't even notice that it was possible to pass just the icon name. (I've yet changed the corresponding code in KStreamRipper, the program from which was taken the code example.)
I've made a patch that fixes the documentation: http://git.reviewboard.kde.org/r/101409/
Closing as INVALID because the requested behaviour exists yet.