# ctkMenuButton vs QToolButton with MenuButtonPopup mode

**URL:** <https://discourse.slicer.org/t/ctkmenubutton-vs-qtoolbutton-with-menubuttonpopup-mode/32187>\
**Category:** Development\
**Created:** [October 12, 2023, 1:21pm UTC](https://discourse.slicer.org/t/ctkmenubutton-vs-qtoolbutton-with-menubuttonpopup-mode/32187 "2023-10-12T13:21:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 12, 2023, 1:21pm UTC](https://discourse.slicer.org/t/ctkmenubutton-vs-qtoolbutton-with-menubuttonpopup-mode/32187/1 "2023-10-12T13:21:46Z")

</div>

Does anyone know why one might use a ctkMenuButton over a QToolButton with MenuButtonPopup mode set?

They appear to be virtually the same so I was curious why ctkMenuButton might have been created and what advantages it has that I might be missing.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c2bcd0a870a6bc289c405fd75aeaacb43c254fb2.png)

> <https://github.com/commontk/CTK/blob/b9ef9b8aa1938676ce0ac105a3deb0e1bfc235a1/Libs/Widgets/ctkMenuButton.cpp>

> **[QToolButton Class | Qt Widgets 6.6.0](https://doc.qt.io/qt-5/qtoolbutton.html#ToolButtonPopupMode-enum)**
>
> The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [October 12, 2023, 9:04pm UTC](https://discourse.slicer.org/t/ctkmenubutton-vs-qtoolbutton-with-menubuttonpopup-mode/32187/2 "2023-10-12T21:04:00Z")

</div>

Although QToolButton has more options to have Icon Only or the text next to it below it, etc, maybe the reason for ctkMenuButton is to have the icon and button text centered in the object? The QToolButton seems to only support left aligned text+icon.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/4/f49d66c8732bd21f431aac09cf1e62ed58999d60.png)
