Navigation

    Qt Forum

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

    • UNSOLVED Why my scrollbars are not updating their total scroll size when content size changes?
      QML and Qt Quick • size zoom scroll scroll bar page • • jeanmilost  

      2
      0
      Votes
      2
      Posts
      64
      Views

      @jeanmilost Your logic seems to be correct. What you have to do is to move the re-calculation of Scrollbar size & position to the Rectangle rcPageContainer because you are applying scale for that. Rectangle { id: rcPageContainer objectName: "rcPageContainer" ... /// called when page viewport width changed onWidthChanged: { sbHorz.size = rcPageViewport.width / rcPageContainer.width sbHorz.position = Math.min(Math.max(sbHorz.position, 0.0), 1.0 - (sbHorz.size)); } /// called when page viewport height changed onHeightChanged: { sbVert.size = rcPageViewport.height / rcPageContainer.height sbVert.position = Math.min(Math.max(sbVert.position, 0.0), 1.0 - (sbVert.size)); } }
    • SOLVED MouseArea prevents the parent scrolling to work properly
      QML and Qt Quick • tableview mouse mousearea scroll mouseevents • • jeanmilost  

      2
      0
      Votes
      2
      Posts
      279
      Views

      Finally I searched a while by myself, and I think I may answer my own question. Although I couldn't completely resolve my issue, I noticed that the answer is hidden in the other MouseArea events. For example, by handling the onPressed event and adding the mouse.accepted in several key locations, I could let the component take care of the scrolling when the left mouse button is pressed, whereas the right click opens a popup menu. My conclusion is that there is no ready-to-use way, i.e there is no parameter to activate in the MouseArea itself which may resolve this kind of issue, and the solution is a good balance between activating different parameters in the different functions.
    • UNSOLVED Disable scroll area in QTableView/QTableWidget
      General and Desktop • qtableview qscrollarea scrollarea scroll viewport • • Maluna34  

      4
      0
      Votes
      4
      Posts
      3977
      Views

      Unfortunately it seems that it's not enough to trigger the scrollbar of the parent. The solution I found is to set the fixedWidth of the table like this : int size{ 0 }; for (int i = 0; i < table->columnCount(); ++i) size += table->columnWidth(i); table->setFixedWidth(size);
    • UNSOLVED Get scroll position of ScrollArea
      QML and Qt Quick • scroll • • Stefan Monov76  

      1
      0
      Votes
      1
      Posts
      546
      Views

      No one has replied

    • UNSOLVED Culling items that are outside the visible area
      QML and Qt Quick • scroll culling • • Stefan Monov76  

      1
      0
      Votes
      1
      Posts
      322
      Views

      No one has replied

    • UNSOLVED Programmatically send commands (i.e. scroll) to the topmost active widget
      General and Desktop • widget focus scroll • • McLion  

      4
      0
      Votes
      4
      Posts
      1340
      Views

      Yes, it returns NULL if the cast failed. As for the type, this might also work: QObject *obj = widget; objType = obj->metaObject()->className(); if (objType == "QPlainTextEdit") { QPlainTextEdit *textEdit = qobject_cast<QPlainTextEdit*>(obj); //do something } Never tried it though. If it works, you won't have to make multiple casts. But you will still have to check which className it has.
    • UNSOLVED Scroll mobile webpage in QWebView - no scrollbars
      General and Desktop • qwebview scroll mobile webpage • • McLion  

      5
      0
      Votes
      5
      Posts
      1740
      Views

      Could not find anything.
    • QCombobox scrolling in touchscreen device
      General and Desktop • qcombobox scroll touch screen • • marlenet15  

      5
      0
      Votes
      5
      Posts
      3932
      Views

      I solve it I use the same thing ui->comboBox->view()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); if there is a better solution please post it Thanks
    • UNSOLVED Draggable and scrollable timeline
      General and Desktop • drag scroll painter timeline • • dridk  

      3
      0
      Votes
      3
      Posts
      1707
      Views

      @SGaist Thanks Champion! I will try !
    • UNSOLVED section-wise scrolling in TableView
      QML and Qt Quick • qml tableview scroll section • • iridefix  

      3
      0
      Votes
      3
      Posts
      1323
      Views

      @SGaist That's pretty close to what I like to achieve. Unfortunately I am using a QML TableView. The only difference to the FrozenColumnExample is that my Frozen Rows have a dynamic count. A binary role in my table model determines to which section the entry belongs to. I will try to adapt the FrozenColumnExample to my case in QML. That was my idea anyway, but I was hoping for more simple solution ;) Substituting the sections with seperate TableViews and using a QSortFilterProxyModel to simulate the section behavior is the way to go I guess. Thx for your tip.
    • QScrollBar - Hiding add-line and sub-line when moved
      General and Desktop • qscrollbar scrollbar scroll • • mat_de_b  

      2
      0
      Votes
      2
      Posts
      4336
      Views

      Hi and welcome I think you might need to set margin for inner area The following works for me with 32x32 images for the ends /*inner area*/ QScrollBar::vertical { border: 1px solid #a5a5a5; background: none; width: 65px; margin: 42px 0 42px 0; /* match top/lower area*/ } /*the knob*/ QScrollBar::handle:vertical { background: #d5d5d5;; border: 2px solid #000000; min-height: 60px; border-radius: 12px; } /*lower arrow area*/ QScrollBar::add-line:vertical { border: 0px solid grey; background: NONE; height: 40px; subcontrol-position: bottom; subcontrol-origin: margin; } /*top arrow area*/ QScrollBar::sub-line:vertical { border: 0px solid grey; background: none; height: 40px; subcontrol-position: top; subcontrol-origin: margin; } /*arrows*/ QScrollBar::up-arrow:vertical { image: url(:/GFX/sbar/up_arrow_scrollbar.png); } /*pressed*/ QScrollBar::up-arrow:vertical::pressed { image: url(:/GFX/sbar/up_arrow_scrollbar_pressed.png); } QScrollBar::down-arrow:vertical::pressed { image: url(:/GFX/sbar/down_arrow_scrollbar_pressed.png); } QScrollBar::down-arrow:vertical { /* border: 2px solid grey; width: 3px; height: 23px; */ image: url(:/GFX/sbar/down_arrow_scrollbar.png); } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }
    • QScrollArea & Vertical Scroll Bar - How To
      General and Desktop • scrollbar scrollarea scroll vertical • • jelicicm  

      7
      0
      Votes
      7
      Posts
      10165
      Views

      Hi, The focus changed when you clicked the button. What you can do is to keep track on the currently focused QLineEdit in a member variable so you can use it at deletion time. Or you could add a remove button besides your QLineEdit and use that to remove them.
    • MouseMoveEvent when scrolling
      General and Desktop • event qt 5.4.2 scroll mousemove • • petoknm  

      1
      0
      Votes
      1
      Posts
      899
      Views

      No one has replied