Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Qt Message] of the QListWidget
Forum Updated to NodeBB v4.3 + New Features

[Qt Message] of the QListWidget

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 4 Posters 4.7k 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.
  • H Offline
    H Offline
    hisong1988
    wrote on last edited by
    #1

    Hello, everyone.

    I met some Qt Messages when I using list widget inherit from QListWidget.

    I want to add the gesture recognizer on QListWidget so I inherit the QListWidget. and I adds some functions as the Qt Qt assistant describes.
    @bool ImageWidget::event(QEvent event)
    {
    if (event->type() == QEvent::Gesture)
    return gestureEvent(static_cast<QGestureEvent
    >(event));
    return QWidget::event(event);
    }@

    @
    bool ImageWidget::gestureEvent(QGestureEvent *event)
    {
    if (QGesture *swipe = event->gesture(Qt::SwipeGesture))
    swipeTriggered(static_cast<QSwipeGesture *>(swipe));
    //else if (QGesture *pan = event->gesture(Qt::PanGesture))
    // panTriggered(static_cast<QPanGesture *>(pan));
    // if (QGesture pinch = event->gesture(Qt::PinchGesture))
    // pinchTriggered(static_cast<QPinchGesture >(pinch));
    /
    I just use the swipe gesture
    /
    return true;
    }
    @

    @
    void ImageWidget::swipeTriggered(QSwipeGesture *gesture)
    {
    if (gesture->state() == Qt::GestureFinished) {
    if (gesture->horizontalDirection() == QSwipeGesture::Left
    || gesture->verticalDirection() == QSwipeGesture::Up)
    goPrevImage();
    else
    goNextImage();
    update();
    }
    }
    @

    now I run the app with the QtCreator, the app at fist didn't show the widget,
    Application Output Window of the Creator show the message:
    @[Qt Message] QPainter::begin: Paint device returned engine == 0, type: 1@
    then I touched the screen, the list widget appeared
    and The Application Output Window of the Creator show the others:
    @
    [Qt Message] QPainter::begin: Paint device returned engine == 0, type: 1
    [Qt Message] QPainter::save: Painter not active
    [Qt Message] QPainter::setClipRect: Painter not active
    [Qt Message] QPainter::setPen: Painter not active
    [Qt Message] QPainter::pen: Painter not active
    [Qt Message] QPainter::pen: Painter not active
    [Qt Message] QPainter::restore: Unbalanced save/restore
    [Qt Message] QPainter::setPen: Painter not active
    [Qt Message] QPainter::pen: Painter not active
    [Qt Message] QPainter::restore: Unbalanced save/restore
    [Qt Message] QPainter::save: Painter not active
    [Qt Message] QPainter::setClipRect: Painter not active
    [Qt Message] QPainter::setPen: Painter not active
    [Qt Message] QPainter::pen: Painter not active
    [Qt Message] QPainter::restore: Unbalanced save/restore
    [Qt Message] QPainter::save: Painter not active
    [Qt Message] QPainter::setClipRect: Painter not active
    [Qt Message] QPainter::restore: Unbalanced save/restore
    [Qt Message] QPainter::save: Painter not active
    [Qt Message] QPainter::setClipRect: Painter not active
    [Qt Message] QPainter::setPen: Painter not active
    [Qt Message] QPainter::save: Painter not active
    .......
    @

    I don't know why the list widget can't appeared as the app run(I had set the list widget show in the constructor)?

    and the [Qt Message] is a normal phenomenon?

    Thanks for the replies

    best regards
    hisong

    I am still searching for....

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hisong1988
      wrote on last edited by
      #2

      anyone could help me? Is that s60v5 doesn't support Gesture Recognizer of Qt?

      I search much for the issue, It seems that the Gesture example didn't run well in s60v5,too.

      I am still searching for....

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtrahul
        wrote on last edited by
        #3

        I think it is available and work for desktop platform.
        http://qt.developpez.com/doc/4.6/qgestureevent/

        But for mobile and embedded it is in the development mode.
        otherwise it should be included in the mobility API,
        You can ask the same question in Forum Nokia.(If you need more detail).

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Hisong, it's holiday season - many regulars here on DevNet are on vacation for the next few days. Please stay tuned, I think from Monday on you can expect some more answers.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hisong1988
            wrote on last edited by
            #5

            Hey, Merry Christmas to all people in this forum.

            I am still searching for....

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kamalakshantv
              wrote on last edited by
              #6

              [quote author="hisong1988" date="1293242389"]Hey, Merry Christmas to all people in this forum.[/quote]

              Merry Christmas!

              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