Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qtoolbar
    Log in to post

    • UNSOLVED Deselection event for QTableWidgetItem
      General and Desktop • qtablewidget qtoolbar qtablewidgetit • • ArthurLodbrock  

      2
      0
      Votes
      2
      Posts
      31
      Views

      As I already wrote on SO use selectionChanged() / itemSelectionChanged() signals ... when nothing is selected, you can't deselect items so how do you want to achieve a deselect here?
    • UNSOLVED How to Add multiple Qtoolbar in QtabWidget
      General and Desktop • qt5 qtabwidget qtwidgets qtoolbar tabs • • vicky_mac  

      4
      0
      Votes
      4
      Posts
      623
      Views

      @vicky_mac A QStackedWidget works like a book. You have pages with your content. You can flip these pages to change your widget inplace (without opening another window or something else). So one possibility is to put one of each QTabWidget (each with a different tabBar position) on a page of a QStackedWidget. You could flip the pages by clicking a dummy tab on each tabBar or you use a button to go to the next page. I know, this is not exactly what the widget in your image looks like :) @vicky_mac said in How to Add multiple Qtoolbar in QtabWidget: Haven't used QT much If you want a widget, that looks exactly like the one shown above, you could still try to subclass and create your own, custom TabWidget, but I fear, that it might be a little too challenging. Here's all you need to know about QStackedWidget (https://doc.qt.io/qt-5/qstackedwidget.html#details)
    • SOLVED Add QWidget above QToolBar in QMainWindow
      General and Desktop • qmainwindow qtoolbar layouts • • Rizwan94  

      5
      0
      Votes
      5
      Posts
      424
      Views

      @Rizwan94 May I ask what was your final implementation? I'm trying to setup a frameless window and add my title/close buttons on top of an existing QMainWindow (from .ui) Thanks in advance
    • UNSOLVED QWidgetAction & QToolBar - no actionTriggered signal...
      General and Desktop • qtoolbar qwidgetaction • • Dariusz  

      5
      0
      Votes
      5
      Posts
      182
      Views

      @jsulm said in QActionWidget & QToolBar - no actionTriggered signal...: @Dariusz Maybe I'm blind but I can't find an addAction() overload with a QAction parameter. All I can see is: addAction(const QString &) : QAction * addAction(const QIcon &, const QString &) : QAction * addAction(const QString &, const QObject *, const char *) : QAction * addAction(const QIcon &, const QString &, const QObject *, const char *) : QAction * addAction(const QString &, Functor ) : QAction * addAction(const QString &, const QObject *, Functor ) : QAction * addAction(const QIcon &, const QString &, Functor ) : QAction * addAction(const QIcon &, const QString &, const QObject *, Functor ) : QAction * addActions(QList<QAction *> ) https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwidget.cpp.html#_ZN7QWidget9addActionEP7QAction (press enter 2x in search input www as for some reason it does not scroll to right spot) Edit I just noticed I messed up title... corrected to QWidgetAction sorry!
    • UNSOLVED Stacking toolbars?
      General and Desktop • qtoolbar stackedwidget • • Dariusz  

      3
      0
      Votes
      3
      Posts
      152
      Views

      @SGaist said in Stacking toolbars?: Hi, AFAIK, no there's not. What kind of interface are you looking for ? Hey Woah this one slipped my fingers... I think it would look like QTabWidget with only QToolbars as its children, each toolbar being 1 other widget. But with difference that that the QTab"ToolBar" would be a toolbar so I could place it like toolbar widget... ? Perhaps I will need to somehow extend QToolbar with QTabBar and somehow make it work mhmm
    • UNSOLVED add a QToolbar as a child of a QGraphicsItem
      General and Desktop • qgraphicsitem qtoolbar mousepressevent maptoscene • • sayan275  

      2
      0
      Votes
      2
      Posts
      283
      Views

      Hi, What about QGraphicsProxyWidget ?
    • UNSOLVED QAction system in QT - LOGIC - is this how it works?
      General and Desktop • qtoolbar qaction qtoolbutton qwidgetaction • • Dariusz  

      9
      0
      Votes
      9
      Posts
      551
      Views

      QObject are not copiable, see here for the why.
    • UNSOLVED QWidgetAction how to use properly?
      General and Desktop • qtoolbar qaction qwidgetaction • • Dariusz  

      1
      0
      Votes
      1
      Posts
      273
      Views

      No one has replied

    • SOLVED QToolbar: Changing widget in toolbar
      General and Desktop • qtoolbar • • Ankit.Jain  

      8
      0
      Votes
      8
      Posts
      1589
      Views

      @ambershark I apologize for the late reply, I fell sick. Anyway, yea using StackWidget did the job. Thanks
    • SOLVED QToolbar stylesheet
      General and Desktop • qtoolbar styesheet • • Gianluca86  

      7
      0
      Votes
      7
      Posts
      4054
      Views

      Ok, I tried this: // MyStyle.h #include <QStyle> class MyStyle : public QStyle { public: MyStyle(); virtual int pixelMetric(PixelMetric pm, const QStyleOption* option, const QWidget* widget) const ; }; // MYStyle.cpp #include "MyStyle.h" MyStyle::MyStyle() { } int MyStyle::pixelMetric(PixelMetric pm, const QStyleOption* option, const QWidget* widget) const { if (pm == QStyle::PM_ToolBarExtensionExtent) return 50; return QStyle::pixelMetric(pm, option, widget); } Is it correct? The line return QStyle::pixelMetric(pm, option, widget); give me this error: error: undefined reference to `QStyle::pixelMetric(QStyle::PixelMetric, QStyleOption const*, QWidget const*) const'
    • SOLVED Add more toolbar
      General and Desktop • qtoolbar • • Gianluca86  

      3
      0
      Votes
      3
      Posts
      577
      Views

      It works perfectly, thanks a lot.
    • Custom QWidgetAction To Differ on Vertical QToolBar and/or Different QToolButton Styles
      General and Desktop • qcombobox qtoolbar style qtoolbutton qwidgetaction • • Erika  

      3
      0
      Votes
      3
      Posts
      1158
      Views

      @SGaist Thanks. That's definitely another option. I suppose these approaches are as good as it gets for having a toolbar item auto-adjust to horizontal vs. vertical. Thanks again.
    • UNSOLVED Adding central toolbar to QMainWindow with QDockWidgets
      General and Desktop • qdockwidget qtoolbar • • j-b-m  

      2
      0
      Votes
      2
      Posts
      604
      Views

      Hi and welcome to the forum. This isn't directly supported, but you can achieve similar result if you make your central widget another QMainWindow. This has the downside that you can't move the toolbars between the two QMainWindows, unless you manage to reparent them dynamically while dragging (should be possible but I haven't tried it).
    • UNSOLVED All problems I need help about QTreeWidget and QToolBar
      General and Desktop • qtoolbar qtreewidget • • nashge  

      7
      0
      Votes
      7
      Posts
      1830
      Views

      Depending on your needs you might be interested by DevMachines's QTitanRibbon which seems to be doing what you want. Note that it's a commercial product. What exactly are you trying to achieve with putting the scroll bar to the left ? There are already several applications written in QML for desktop. It really depends on what you want to do.
    • UNSOLVED QToolBar widgets spacing
      General and Desktop • qtoolbar content margins • • Joel Bodenmann  

      2
      0
      Votes
      2
      Posts
      3683
      Views

      Did you try doing it outside of the QToolBar? QWidget* spinWidget = new QWidget; QHBoxLayout* spinLay = new QHBoxLayout(spinWidget); spinLay.addWidget(new QSpinBox(spinWidget)); spinLay.setContentsMargins(0,0,10,0); // Here you set the spacing QToolBar* toolbarDocument = new QToolBar; toolbarDocument->addWidget(spinWidget ); toolbarDocument->addWidget(new QComboBox); addToolBar(toolbarDocument);
    • SOLVED QToolBar::clear(), can't add widget anew ?
      General and Desktop • qtoolbar • • Proteos  

      12
      0
      Votes
      12
      Posts
      3310
      Views

      In fact, it removes the action from the toolbar itself. It calls QWidget::removeAction. I also haven't yet found how the parenting is modified.
    • SOLVED How to restore hidden QToolbar non-programatically on Mac OS X
      General and Desktop • qt5 mac qtoolbar • • AndyBrice  

      12
      0
      Votes
      12
      Posts
      2629
      Views

      Might not be completely intuitive. That something you can bring to the attention of the NodeBB folks :)
    • UNSOLVED QToolbar on OSX: no hover effect
      General and Desktop • desktop os x qtoolbar icon qaction • • Xanx  

      5
      0
      Votes
      5
      Posts
      1724
      Views

      Please have some patience, this forum is community driven and not all users live in the same timezone as you. The picture you are linking to doesn't show a hovered button but a checked button. You will have that visual effect if you set the checkable property of the action to corresponding to the button as true and you check it.
    • UNSOLVED QToolBar with drag and drop icons (movable buttons)
      General and Desktop • qtoolbar • • ravas  

      2
      0
      Votes
      2
      Posts
      883
      Views

      Hi, I can't guarantee they have implement it but I'd take a look at the Caligra suite for inspiration
    • UNSOLVED Problem with styleSheet spacing parameter
      General and Desktop • stylesheet qtoolbar spacing • • Esteban.Moss  

      1
      0
      Votes
      1
      Posts
      389
      Views

      No one has replied

    • QToolButton and QMainWindow::setIconSize()
      General and Desktop • qmainwindow qdockwidget qtoolbar qtoolbutton • • ravas  

      3
      0
      Votes
      3
      Posts
      1383
      Views

      @SGaist The icon size is saved via QSettings in a QDialog called from a QMainWindow subclass. After the dialog is closed, QMainWindow::setIconSize() is called.
    • QToolbar Expanding/Extention Action "qt_toolbar_ext_button". How does it worK?
      General and Desktop • qtoolbar • • JakeWade  

      1
      0
      Votes
      1
      Posts
      785
      Views

      No one has replied

    • How to change QMenu behavior
      General and Desktop • qdialog qmenu qtoolbar qaction • • tema_tema  

      10
      0
      Votes
      10
      Posts
      3884
      Views

      For now I found following solution to prevent GUI from freeze: { Q_OBJECT public: QCustomMenu(QObject *parent = 0){}; void showEvent(QShowEvent *) { emit show(); QMenu::closeEvent(new QCloseEven()); QMenu::hideEvent(new QHideEvent()); } signals: void show(); }; And also now I've changed logic: on show() signal I exec() my dialog: QCustomMenu *menu = new QCustomMenu(toolbar); connect(menu, SIGNAL(show()), this, SLOT(execMyMenu())); But after closing my dialog UI waits for mouse click somewhere to start responding for further actions. May be it is possible to make programmatically click somewhere ? I didn't find any solution yet.
    • QToolBar - real Icon Size / Minimum Size
      General and Desktop • qtoolbar size icon qaction sizepolicy icons sizehint • • Cluosh  

      2
      0
      Votes
      2
      Posts
      1928
      Views

      The thing is that toolbars don't really display icons. They display widgets (that can have icons). By default when you add an action to a toolbar a QToolButton is created for it, but you are not limited to that and can add any widget e.g. an expanding line edit, combobox or a button with an icon and text. All of these can have different size policies, be expanding or have a custom stylesheet applied. All of this makes calculating such size not feasible because how would you calculate it if a widget can change its size. What I'm saying is that yours is a special, very specific case (with just icons), and as such you need to handle it yourself if you want to. To answer your questions: It's not one thing that adds the space. There are couple of aspects that can contribute. You can control some(or all?) of them with stylesheets e.g. set padding of the toolbar and toolbuttons to 0 and margins and borders of the toolbuttons. By default all of these depend on a style and will vary across computers. You also need to be careful to consider the size of the toolbar handle (if it's movable) as its size depends on the active style. You also need to consider that if the icon is narrower than the iconSize then there's gonna by space left anyway. nope, AFAIK it can vary from one item of the toolbar to another if you set it this way nope and just out of curiosity - why do you need that? The bar will display an arrow button that will let you see the overflowing items. Also such calculated size would be useless as the window can be resized and thus the toolbar too (unless you're doing some really fancy layout).
    • How can i hide a QAction in the QToolbar?
      General and Desktop • button qtoolbar qaction hide • • nickvan86  

      4
      0
      Votes
      4
      Posts
      5248
      Views

      Yes, that is the way it should work. You can hide also anything based on QWidget Sometimes you have more than one possibility. So there is also some redundancy.
    • Hiding/removing toolbar from QMainWindow
      General and Desktop • python qmainwindow qtoolbar • • Boman  

      6
      0
      Votes
      6
      Posts
      6999
      Views

      What kind of indicator do you mean ?
    • [SOLVED] QToolbar separator visibility not being saved
      General and Desktop • qtdesigner qtoolbar separator • • A Former User  

      3
      0
      Votes
      3
      Posts
      967
      Views

      Could you provide some more background on your problem? Are you using QML or Qt Widgets? Could you share the part of the code that designer is generating from your change? It is really hard to say anything based on one sentence.
    • How to implement a Adobe Photoshop Elements like toolbox in QT
      General and Desktop • qdockwidget qtoolbar toolbox • • shengfa.zhang  

      1
      0
      Votes
      1
      Posts
      872
      Views

      No one has replied