Results 1 to 3 of 3

Thread: About the custom status bar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Post About the custom status bar

    Now I need a custom status bar, and I try to overload mouseMoveEvent(QMouseEvent *event), code is as follows:
    qDebug()<<QCursor:: pos().x()<<QCursor:: pos().y();
    QWidget *widget = QApplication::widgetAt(event->pos());
    if(widget == ui->pushButton)
    ui->statusbar->setToolTip(tr("button"));
    (I set mouse with tracking before this code, by setMouseTracking(true))
    When I move mouse over the pushbutton, and no display on the status bar, I'm very sad, what's happened??

    And I try to another method to solve the custom status bar, with eventFilter(QObject *obj, QEvent *event), code is as follows:
    if(obj == ui->pushButton)
    {
    if(event->type() == QEvent::Enter)
    {
    ui->statusbar->setToolTip(tr("over pushbutton"));
    }
    else if(event->type() == QEvent::Leave)
    ui->statusbar->setToolTip(tr(""));
    return true;
    }
    else
    {
    ui->statusbar->setToolTip(tr(""));
    return QWidget::eventFilter(obj,event);
    }
    With this method, prompts("over pushbutton") in the status bar, but the pushbutton isn't display in the window.
    Last edited by Hughen; 28th March 2013 at 14:18. Reason: 拼写更正

Similar Threads

  1. Replies: 3
    Last Post: 8th July 2010, 07:41
  2. Custom Model? Custom View? Custom Delegate?
    By Doug Broadwell in forum Newbie
    Replies: 4
    Last Post: 11th February 2010, 20:23
  3. Status Bar
    By waynew in forum Newbie
    Replies: 3
    Last Post: 21st November 2009, 09:07
  4. Status Bar in a SUB WINDOW.
    By Cutey in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2008, 07:42
  5. need help with the status bar
    By filmfreak in forum Qt Programming
    Replies: 2
    Last Post: 15th February 2006, 08:34

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
  •  
Qt is a trademark of The Qt Company.