Important: Please read the Qt Code of Conduct -

All problems I need help about QTreeWidget and QToolBar

  • Hi,every guys.I have some problems about my software development.I tried many method,but failed,so disappointed.

    *QToolBar's will hide actions i added in it when i adjust mainwindow width. Just like QT doc sayes:
    "When a toolbar is resized in such a way that it is too small to show all the items it contains, an extension button will appear as the last item in the toolbar. Pressing the extension button will pop up a menu containing the items that does not currently fit in the toolbar."

    Now, i don't want to this feature. I want to show all actions,widget added in it,if i adjust window size,width is too slow,just show part of them,such like just part length of lineedit.
    I tried set ToolBar fixed width,but after it i just can't adjust window size,this is annoyed.

    *Problems about QTreeWidget
    I drag a item to another widget,but when my drag process still in the QTreeWidget. It's show a forbidden symbol. How to hide this forbidden symbol?

  • Lifetime Qt Champion


    Drag&Drop: did you read the documentation: ?
    You have to accept the drop like:

    Window::Window(QWidget *parent)
        : QWidget(parent)
    void Window::dragEnterEvent(QDragEnterEvent *event)
        if (event->mimeData()->hasFormat("text/plain"))

  • @jsulm
    Thank you!
    I did solve second problem through read the documentation.
    About first problem,do you have any suggestion?

  • Lifetime Qt Champion

    Sorry, I don't know.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You'll have to implement your own QToolBar for that. Note that you are likely going against the platform human interface guidelines doing so.

    Out of curiosity, why do you want to do that ?

  • @SGaist
    Thx for you reply.Maybe I need implement my own QToolBar to achieve this goal.
    This project we are developing by imitate another commercial software,we found it's toolbar has this feature. So I found all QToolBar doc and failure.

    By the way,do you know another strange featue,make the vertical scrollbar in the left of the QListWidget, otherwise in the right of QListWidget default ,I found it's also a difficult task for me.

    Another problem is How do you think use QML in the PC software development through QQuickWidget? Because i found document says QML is mainly used for mobile applications where touch input, fluid animations (60 FPS) and user experience are crucial.

    Forgive my poor english,Thank you again for your patience!

  • Lifetime Qt Champion

    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.

Log in to reply