Results 1 to 9 of 9

Thread: Flickable area not working

  1. #1
    Join Date
    Jun 2016
    Posts
    99
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Flickable area not working

    I'm trying to implement a flickable area on my table view for touch screen scrolling... but it doesn't seem to work

    Qt Code:
    1. Rectangle {
    2. width: 990
    3. height: 490
    4. anchors.centerIn: parent
    5. color: "transparent"
    6. radius: 4
    7. border.color: "lightsteelblue"
    8. border.width: 5
    9. visible: true
    10. //---Create a flickable area---//
    11. Flickable {
    12. id: tableViewFlickable
    13. height: tableView.height
    14. width: tableView.width
    15. contentHeight: tableView.height
    16. contentWidth: tableView.width
    17. anchors.centerIn: parent
    18. interactive: true
    19. boundsBehavior: Flickable.StopAtBounds
    20. TableView {
    21. id: tableView
    22. width: 980
    23. height: 480
    24. anchors.centerIn: parent
    25. sortIndicatorVisible: true
    26. sortIndicatorOrder: 1
    27. sortIndicatorColumn: 1
    28. model: UserEventLog
    29. style: TableViewStyle {
    30. headerDelegate: Rectangle {
    31. height: textItem.implicitHeight * 1.2
    32. width: textItem.implicitWidth
    33. color: "lightsteelblue"
    34. border.color: "black"
    35. border.width: .5
    36. Text {
    37. id: textItem
    38. anchors.centerIn: parent
    39. text: styleData.value
    40. color: "black"
    41. font.bold: true
    42. }
    43. }
    44. }
    45. TableViewColumn {
    46. role: "id"
    47. title: "id"
    48. width: 100
    49. }
    50. TableViewColumn {
    51. role: "userName"
    52. title: "User Name"
    53. width: 200
    54. }
    55. TableViewColumn {
    56. role: "eventMessage"
    57. title: "Event Message"
    58. width: 372
    59. }
    60. TableViewColumn {
    61. role: "dateTime"
    62. title: "Date Time"
    63. width: 201
    64. }
    65. }
    66. }
    67. }
    To copy to clipboard, switch view to plain text mode 

  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: Flickable area not working

    What do you mean with "it doesn't work"?

    Are you sure you want the scrollable content to be the same size as the visible area?

    Cheers,
    _

  3. #3
    Join Date
    Jun 2016
    Posts
    99
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Flickable area not working

    from my understanding the scrollable content need to be smaller than the visible area ? mine is same size ...

    I tried changing size of content:

    Qt Code:
    1. contentHeight: tableView.height * .9
    2. contentWidth: tableView.width *.9
    To copy to clipboard, switch view to plain text mode 

    I cant scroll-drag the table in the tableView by touch or by mouse drag....

    I want to use the flickable area to make the tableView scrollable by touch (app will be running on touch screen)

    I tried out putting some text to the log and don't get anything to out put

    Qt Code:
    1. onFlickStarted: {
    2. console.log("area flicked");
    3. console.log(tableViewFlickable.dragging)
    4. }
    To copy to clipboard, switch view to plain text mode 

    I'm starting to think it might not be possible to use flickable to scroll the tableView rows

    when I wrap the tableView inside the flickable area It works kind of but the hole table moves instead of the rows scrolling in the tableView it self

    I tried wrapping just the tableViewColumns in the flickable area that didn't work no data from model displays

    Tried moving the flickable obj inside the tableView obj didn't seem to work either

    I discovered: TableView inherits ScrollView. I don't think flickable will work with tableView it will work with listView because it is inherited by listView. TableView doesn't inherit flickable..... is this correct?
    Last edited by jfinn88; 23rd September 2016 at 23:57.

  4. #4
    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: Flickable area not working

    Quote Originally Posted by jfinn88 View Post
    from my understanding the scrollable content need to be smaller than the visible area ? mine is same size ...
    Usually the content is larger, otherwise you wouldn't need to scroll.

    You set the visible size to be the same as the content size, so your content will always be visible fully.

    Quote Originally Posted by jfinn88 View Post
    I want to use the flickable area to make the tableView scrollable by touch (app will be running on touch screen)
    Any specific reason for using a Flickable? The TableView already scrolls its content itself, why do you also need to move the view itself?

    Cheers,
    _

  5. #5
    Join Date
    Jun 2016
    Posts
    99
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Flickable area not working

    I thought I would have to use the flickable area to make the tableView scroll by touch...

  6. #6
    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: Flickable area not working

    A view that can't scroll by itself would be pretty useless IMHO.

    Cheers,
    _

  7. #7
    Join Date
    Jun 2016
    Posts
    99
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Flickable area not working

    I agree and it dose provide scroll bars by its self I get that, I'm not sure about the touch screen side though...

  8. #8
    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: Flickable area not working

    I would be equally surprised if any QtQuick component would not work with touch screen, after all that's the main use case for this UI technology.

    Cheers,
    _

  9. #9
    Join Date
    Jun 2016
    Posts
    99
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Flickable area not working

    right! that’s why I chose to use it. I have found a know bug when using ScrollView will disable a flickable area in a listView. I'm wondering if there is something messing with my tableViews flickable inheritance that is similar to the listView issue. I'm making progress on my UI thanks for the help

    was able to find property for enabling flickable area with ScrollView:

    soln: flickableItem.interactive: true - allows flickable are in listView with ScrollView

    not sure how to get tableView flickable to work now....
    Last edited by jfinn88; 27th September 2016 at 19:01.

Similar Threads

  1. Flickable mouse dragging not working
    By pconfig in forum Qt Quick
    Replies: 0
    Last Post: 14th March 2015, 13:06
  2. mousearea outside flickable not working
    By joko in forum Qt Quick
    Replies: 3
    Last Post: 15th December 2014, 16:36
  3. Replies: 0
    Last Post: 16th September 2012, 10:28
  4. Scrollbar in scroll area not working
    By ada10 in forum Newbie
    Replies: 2
    Last Post: 30th August 2010, 12:39
  5. Replies: 10
    Last Post: 2nd August 2010, 14:07

Tags for this Thread

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.