Results 1 to 5 of 5

Thread: Qt 4.1.3 - XP - TrayIcon

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt 4.1.3 - XP - TrayIcon

    I have a successfull prototype for the TrayIcon code that I try to integrate to my main application. I get the following strange compile errors :

    Qt Code:
    1. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text+0x100) In function `ZNK17ApplicationWindow10metaObjectEv':
    2. 46 C:\root\dev\Qt\sms data\sms\moc_mainwindow.cpp multiple definition of `ApplicationWindow::metaObject() const'
    3. 59 C:\root\dev\Qt\sms data\sms\moc_menu.o(.text+0x100):C:\root\dev\Qt\sms data\sms\moc_menu.cpp first defined here
    4. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text+0x10a) In function `ZN17ApplicationWindow11qt_metacastEPKc':
    5. 51 C:\root\dev\Qt\sms data\sms\moc_mainwindow.cpp multiple definition of `ApplicationWindow::qt_metacast(char const*)'
    6. 64 C:\root\dev\Qt\sms data\sms\moc_menu.o(.text+0x10a):C:\root\dev\Qt\sms data\sms\moc_menu.cpp first defined here
    7. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text+0x158) In function `ZN17ApplicationWindow11qt_metacallEN11QMetaObject4CallEiPPv':
    8. 59 C:\root\dev\Qt\sms data\sms\moc_mainwindow.cpp multiple definition of `ApplicationWindow::qt_metacall(QMetaObject::Call, int, void**)'
    9. 72 C:\root\dev\Qt\sms data\sms\moc_menu.o(.text+0x158):C:\root\dev\Qt\sms data\sms\moc_menu.cpp first defined here
    10. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text$_ZN17ApplicationWindowD0Ev[ApplicationWindow::~ApplicationWindow()]+0x0) In function `ZThn8_N17ApplicationWindowD1Ev':
    11. 72 C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text$_ZN17ApplicationWindowD0Ev[ApplicationWindow::~ApplicationWindow()]+0x0) multiple definition of `ApplicationWindow::~ApplicationWindow()'
    12. 136 C:\root\dev\Qt\sms data\sms\menu.o(.text+0x44e4):C:\root\dev\Qt\sms data\sms\menu.cpp first defined here
    13. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text$_ZN17ApplicationWindowD1Ev[ApplicationWindow::~ApplicationWindow()]+0x0) In function `ZThn8_N17ApplicationWindowD1Ev':
    14. 136 C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.text$_ZN17ApplicationWindowD1Ev[ApplicationWindow::~ApplicationWindow()]+0x0) multiple definition of `ApplicationWindow::~ApplicationWindow()'
    15. 136 C:\root\dev\Qt\sms data\sms\menu.o(.text+0x3eb8):C:\root\dev\Qt\sms data\sms\menu.cpp first defined here
    16. C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.data+0x0) In function `ZThn8_N17ApplicationWindowD1Ev':
    17. 136 C:\root\dev\Qt\sms data\sms\moc_mainwindow.o(.data+0x0) multiple definition of `ApplicationWindow::staticMetaObject'
    18. 2493 C:\root\dev\Qt\sms data\sms\moc_menu.o(.data+0x0):C:\Dev-Cpp\include\c++\3.4.2\bits\locale_facets.tcc first defined here
    19. 2493 C:\root\dev\Qt\sms data\sms\moc_menu.o(.data+0x0):C:\Dev-Cpp\include\c++\3.4.2\bits\locale_facets.tcc ld returned 1 exit status
    20. C:\root\dev\Qt\sms data\sms\Makefile [Build Error] [sms.exe] Error 1
    To copy to clipboard, switch view to plain text mode 

    I don't where to start looking for the problem.
    Do you ?
    Do you want me to sow some of my code ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.1.3 - XP - TrayIcon

    Check whether HEADERS and SOURCES variables in your .pro file don't contain duplicate entries.

  3. The following user says thank you to jacek for this useful post:

    incapacitant (31st May 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt 4.1.3 - XP - TrayIcon

    They do, but I did not find right away. Thanks

  5. #4
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt 4.1.3 - XP - TrayIcon

    Strange behaviour

    If I code :
    Qt Code:
    1. connect(pbClose, SIGNAL(clicked()), SLOT(showMinimized()));
    To copy to clipboard, switch view to plain text mode 

    The application is minimized as any other application, but if I double-click on the icon it is restored. It is displayed both as minimized application and iconfied.

    If I code
    Qt Code:
    1. connect(pbClose, SIGNAL(clicked()), SLOT(toggleVisibility()));
    To copy to clipboard, switch view to plain text mode 

    The application is correctly iconfied only but when I double-click on the icon it is reminimized without me doing anything. It won't stay restored.

    I am lost.

  6. #5
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt 4.1.3 - XP - TrayIcon

    Hello

    Here is the connect code for the trayicon :
    Qt Code:
    1. connect(mTray, SIGNAL(clicked(const QPoint &, int)), SLOT(toggleVisibility()));
    2. connect(pbClose, SIGNAL(clicked()), SLOT(showMinimized()));
    3. connect(mTray, SIGNAL(closed()), SLOT(slotTrayClosed()));
    4. connect(aQuitAction, SIGNAL(triggered()), SLOT(close()));
    To copy to clipboard, switch view to plain text mode 


    All works well but there are two problems :
    - the application is both minimized in the task bar and iconfied
    - then when I click on the icon to close, it closes the application but the icon remains until you hover about it, then it goes.

Similar Threads

  1. contextMenuEvent has issues since 4.1.3
    By momesana in forum Qt Programming
    Replies: 9
    Last Post: 31st May 2006, 18:27
  2. trayicon port to QT4
    By ykohn in forum Qt Programming
    Replies: 10
    Last Post: 21st April 2006, 16:11
  3. TrayIcon with Qt4
    By naresh in forum Qt Programming
    Replies: 7
    Last Post: 15th February 2006, 19:54

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.