Results 1 to 5 of 5

Thread: Some menubar items can not be clicked

  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default Some menubar items can not be clicked

    Hello everyone,

    I upgrade an application from Qt3.3 to Qt4.4. Somehow, the first three items (File, Tools, Help) on menubar(see attached image file MenuQt4.4.jpg ) have no response after being clicked. Usually, they should be highlighted and submenu pops up. Now, they are not highlighted at all.

    However, the last item (test) works as normal. And, if I click the forth item (test) first, the other three menu items function as normal when I move my mouse to any one of them.

    I used the preview in Designer, it works very well and did not find anything to block the first three menu items in anybar.

    I recompile the ui file and still the same problem happen.

    Previously, in qt3.3, the menu item looks like attached image MenuQt3.3. There is always a gray bar showing right below the first three menu items. I don't know what it is and why it appears. But it doesn't affect the menu items. When mouse is over the three menu items, they all functioned well. After upgrading, the gray bar disappears, but first three menu items can't be clicked.

    I got this set of code from my previous colleague, I doubt if there is any additional code in the implementation (not in UI file) to create the gray bar in Qt3.3. After I upgraded to Qt4.4, it expanded by qt4.4 gui libarary and block the first three menu items?

    If any can give me some suggestion how to track the creation of the gray bar or give me some ideas, suggestions, or keywords to search, it is really highly appreciated!

    Thank you for any help !

    Richard
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Some menubar items can not be clicked

    Here's the problem:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. class MainWindow : public QMainWindow
    4. {
    5. public:
    6. MainWindow(QWidget* parent = 0) : QMainWindow(parent)
    7. {
    8. menuBar()->addMenu("File");
    9. menuBar()->addMenu("Edit");
    10. menuBar()->addMenu("Tools");
    11. menuBar()->addMenu("Help");
    12.  
    13. QWidget* widget = new QWidget(this);
    14. // change the color just to be able to see the widget
    15. widget->setStyleSheet("background: rgba(255,0,0,128)");
    16. // uncomment the following line and see the difference
    17. // setCentralWidget(widget);
    18. }
    19. };
    20.  
    21. int main(int argc, char* argv[])
    22. {
    23. QApplication app(argc, argv);
    24. MainWindow window;
    25. window.show();
    26. return app.exec();
    27. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Dec 2008
    Posts
    68

    Default Re: Some menubar items can not be clicked

    Thank you so much for the prompt help!

    I did it and same problem exists. Attached is the screenshot.

    BTW, in the existing code , the mainwindow and menu were designed in designer and compiled with UIC. But I tried the in your way by using addMenu of menubar. The same probelms happend only to the first three menu items. After the first three, everything is OK.

    Can you guess what the gray bar in the Qt3.3 implementation is? Or give me some clue what are the ways to create it so that I can search the code.

    Thank you again!
    Attached Images Attached Images

  4. #4
    Join Date
    Dec 2008
    Posts
    68

    Default Re: Some menubar items can not be clicked

    Does anyone have any thoughts about this issue?

    For the gray bar in Menu_qt3.3, what are the possible object or function will be used to create it?

    thank you!

  5. #5
    Join Date
    Dec 2008
    Posts
    68

    Default Re: Some menubar items can not be clicked

    I am still struggling with the problem...

    Can anyone help?

    Thank you!

Similar Threads

  1. Can't click menubar items / QPixMap doesn't show
    By richardander in forum Qt Programming
    Replies: 1
    Last Post: 30th December 2008, 10:45
  2. How to know wich item is clicked QTreeWidget
    By ^NyAw^ in forum Qt Programming
    Replies: 13
    Last Post: 6th November 2007, 23:47
  3. Light items for the graphicsView
    By maverick_pol in forum Qt Programming
    Replies: 12
    Last Post: 1st November 2007, 18:51
  4. Replies: 3
    Last Post: 27th July 2006, 12:48
  5. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 12:20

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.