Tooltips will not display in ubuntu 16.10 using Qt 5.8



  • Update: I've installed QT 5.9 and the result is still teh same. Tool tips and Status tips are not visible on Ubuntu 16.10.

    I'm currently using QT 5.8 I know it's not the latest version but it shouldn't matter unless my issue is a bug. I've tested this in a windows VM and everything works.

    It does "work" on Ubuntu 16.10 in the sense that it compiles and produces no errors. However, the tool tips and the status tips do not appear in Ubuntu. Furthermore, the menu actually cuts off the last three characters of the Window title (MainWindow). That can be fixed easily enough though.

    Has any one had this issue, if so does anyone know of a solution, or is this a bug? I realize I can upgrade to the newest version of QT and I will if I must. But I see no reason unless it's a bug why it wouldn't work the same in 5.8. Or I'm missing something completely which is a strong possibility!

    MainWindow.h

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include "QMenu"
    #include "QMenuBar"
    #include "QActionEvent"
    #include "QContextMenuEvent"
    #include "QActionGroup"
    #include "QObject"
    
    
    namespace Ui {
    class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
    
        void createActions(); // sets up all the actions
        void buildMenus(); // creates the menus
    
    
        QMenu *fileMenu;
        QMenu *editMenu;
        QMenu *settingsMenu;
    
    
        QAction *logDataAction;
        QAction *stopAnimationAction;
        QAction *startAnimationAction;
    
    };
    
    #endif // MAINWINDOW_H
    
    

    And MainWindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "QString"
    #include "QSizePolicy"
    #include "QMenu"
    #include "QMenuBar"
    #include "QActionEvent"
    #include "QContextMenuEvent"
    #include "QActionGroup"
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        createActions();
        buildMenus();
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::MainWindow::createActions()
    {
        logDataAction = new QAction(tr("&Log Data"), this);
        logDataAction->setShortcuts(QKeySequence::New);
        logDataAction->setStatusTip(tr("Save information to files"));
        logDataAction->setToolTip("Clicking this button will write all gathered information to files for easy viewing");
        // connect(logDataAction, &QAction::triggered, this, &MainWindow::); < action event
    
        startAnimationAction = new QAction(tr("&Play Animation"), this);
        startAnimationAction->setShortcuts(QKeySequence::New);
        startAnimationAction->setStatusTip(tr("Plays animation"));
        startAnimationAction->setToolTip("Clicking this button will play a looping animation untill stopped");
        // connect(startAnimationAction, &QAction::triggered, this, &MainWindow::); < action event
    
        stopAnimationAction = new QAction(tr("&Stop Animation"), this);
        stopAnimationAction->setShortcuts(QKeySequence::New);
        stopAnimationAction->setStatusTip(tr("Stops animation"));
        stopAnimationAction->setToolTip("Clicking this button will stop the animated background image; if it's alreayd playing");
        // connect(stopAnimationAction, &QAction::triggered, this, &MainWindow::); < action event
    
    }
    
    void MainWindow::MainWindow::buildMenus()
    {
        fileMenu = menuBar()->addMenu(tr("&File"));
        fileMenu->addAction(logDataAction);
        fileMenu->addSeparator();
        // add more actions
        fileMenu->setToolTipsVisible(true);
    
    
    
        editMenu = menuBar()->addMenu(tr("&Edit"));
        //Add actions
        editMenu->setToolTipsVisible(true);
    
        settingsMenu = menuBar()->addMenu(tr("&Settings"));
        editMenu->addAction(startAnimationAction);
        editMenu->addSeparator();
        editMenu->addAction(stopAnimationAction);
        // Add more actions
        settingsMenu->setToolTipsVisible(true);
    }
    
    

    As you can see it's a work in progress :)



  • Hi! Just tested it on Ubuntu, works fine for me (had to uncomment that "wccore.h"). What's your desktop environment? Unity?



  • @Wieland Huh very strange, yes Unity 7.5



  • Well, Unity has a billion bugs. Thank god it's dead now.



  • @Wieland ugh lol this is true but puts me into less than pleasant situation. I guess I'll have to change it and hope it works.



  • Did you install Qt via its online installer? If so, try the Qt libraries from Ubuntu's repositories, maybe those work.



  • @Wieland They don't I've tried. I'll just have to change things around. Thanks for the help though; least I know what the issue is now right :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.