Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Make Widget visible in QScrollArea (by Layout)

Make Widget visible in QScrollArea (by Layout)

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    blueSpirit
    wrote on last edited by
    #1

    Hello,

    I ve implemented a FlowGridLayout (similar to http://doc.trolltech.com/4.7/layouts-flowlayout.html) and added some cursor functionality (pressing left-key will focus the left element, pressing down-key will focus the bottom element) to the layout, since it's the only object which knows the row-/column-count.

    How can I make an item visible, when it's hidden by a QScrollArea? Since I only have a pointer to the item, I have no access to the scroll area. With setting "QScrollArea::setWidget()", the widget is only assigned to the viewport (widget) - but not to the scroll area.

    I found a very very very ugly workaround:
    @
    if( pNewWidget != NULL )
    {
    pNewWidget->previousInFocusChain()->setFocus();
    pNewWidget->previousInFocusChain()->setEnabled( false );
    // Now the 'pNewWidget' is visible
    pNewWidget->previousInFocusChain()->setEnabled( true );
    pNewWidget->setFocus();
    }
    @

    But there must be a better solution...!

    Best Regards,
    Charly

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved