Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7625463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:11:44+00:00 2026-05-31T05:11:44+00:00

I have a mainwindow and I’m trying to show in statusarea message when user

  • 0

I have a mainwindow and I’m trying to show in statusarea message when user is trying open file that don’t exist.

void MainWindow::onOpenClicked(){
    if(QFile(ui->lineEditCapture->text()).exists()){
        // allow opening for analyze
    }else{
        setStatusTip("Can't open file, check if the file name is correct");
    }
}

The problem is that the statustip is shown only after the mouse pointer leaves the window and return.

Also when I do

setStatusTip("Can't open file, check if the file name is correct");

in constructor then the statustip is shown right away.

What could be wrong?

EDIT:
It looks like if I do setStatusTip in slot then it’s not working as it should, however if the setStatusTip is in normal method then it works as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:11:44+00:00Added an answer on May 31, 2026 at 5:11 am

    Use the showMessage function instead of the setStatusTip. This way you can control how long the message will be displayed:

    If timeout is 0 (default), the message remains displayed until the
    clearMessage() slot is called or until the showMessage() slot is
    called again to change the message.

    if (statusBar())
        statusBar()->showMessage("Can't open file, check if the file name is correct");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a View Controller inside my MainWindow.xib file that loads the nib Cover
I have a KMainWindow: //file.h class MainWindow: public KMainWindow { public: MainWindow(QWidget *parent =
I have a view that is loaded in the MainWindow.xib. It is just a
I have MainWindow and 2 user controls. In Main Window there is Tab Control
I have a simply MainWindow file created by the Interface Builder in black background.
I have MainWindow with a statusbar and multiple user controls in it. Each user
I have a user control, call it UserControl , that has a grid with
I have one MainWindow.xib file. I have one label and one button on first
I have a MainWindow with a table that shows all books in an overview.
I have a NavigationController in MainWindow.xib. It loads a RootViewController that basically manages a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.