Results 1 to 4 of 4

Thread: QToolbar in a QDialog (OS X)

  1. #1
    Join Date
    Aug 2015
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QToolbar in a QDialog (OS X)

    Hello everyone. In one of my dialogs I have set QToolbar as a menu bar:

    Qt Code:
    1. TagsEditDialog::TagsEditDialog(int type, const QString &caption,
    2. const QStringList &list,
    3. const QString &text, bool p,
    4. QWidget *parent) : QDialog(parent)
    5. {DD;
    6. setWindowTitle(caption);
    7. setWindowModality(Qt::WindowModal);
    8. //...
    9. QToolBar *operationsToolBar = new QToolBar(this);
    10. operationsToolBar->addWidget(toggleCharsButton);
    11. operationsToolBar->addSeparator();
    12.  
    13. operationsToolBar->setMovable(false);
    14. operationsToolBar->setIconSize(QSize(16,16));
    15. //...
    16. this->layout()->setMenuBar(operationsToolBar);
    17. }
    To copy to clipboard, switch view to plain text mode 

    Everything works fine in Windows and Linux, but in OS X (with Qt 5 only) toolbuttons of this toolbar don't receive mouse click events. Can anyone help me to solve this issue? I've tried not to use setMenuBar method, but QToolButtons placed into QBoxLayout are just the ugliest ones in OS X.

    Thanks,
    Alex.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QToolbar in a QDialog (OS X)

    What if you just place the toolbar as first widget in a vertical box layout?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2015
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolbar in a QDialog (OS X)

    Quote Originally Posted by anda_skoa View Post
    What if you just place the toolbar as first widget in a vertical box layout?

    Cheers,
    _
    I've tried it, but the buttons (QToolButton) in it looks quite bad in OS X.

  4. #4
    Join Date
    Aug 2015
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolbar in a QDialog (OS X)

    Actually, as I've discovered, no QToolBar in a QDialog (anywhere - as a manuBar, in a layout or elsewhere) works properly in OS X (Qt5). I've created some workaround, so I suggest to consider the topic closed.

Similar Threads

  1. Replies: 2
    Last Post: 10th October 2013, 15:08
  2. Replies: 1
    Last Post: 26th March 2013, 02:04
  3. Replies: 9
    Last Post: 25th March 2011, 21:22
  4. QDialog.exec() exiting without calling QDialog::accept()
    By doggrant in forum Qt Programming
    Replies: 3
    Last Post: 2nd February 2011, 11:35
  5. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.