开发者

Qt TrayIcon when Minimizing the Window

开发者 https://www.devze.com 2023-03-19 12:41 出处:网络
Well i have this piece of code: void MainWindow::ev开发者_StackOverflow中文版ent(QEvent *event) {

Well i have this piece of code:

void MainWindow::ev开发者_StackOverflow中文版ent(QEvent *event)
    {
        if(event->type() == QEvent::WindowStateChange) {
            if(isMinimized()) {
                trayIcon->show();
                hide();
                event->ignore();
            }else{
                event->accept();
            }
        }
    }

Well, basically yes. I'm trying that when the Window is minimized, it creates the tray Icon and hides the application from Taskbar. Whatever, i keep getting "No 'void MainWindow::event(QEvent *)' member function declared in class 'MainWindow'" When the autocomplete shows it.

Any idea?

0

精彩评论

暂无评论...
验证码 换一张
取 消