0

here is similar problem, but I can't get answer from it.

I try official example and see following screenshot(in shot, the qt app system tray doesn't exist)

enter image description here

How to make system tray show?

here is my CMakeLists.txt

cmake_minimum_required(VERSION 3.3)
project(systray)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(Qt5Widgets_DIR /home/roroco/Qt/5.5/gcc_64/lib/cmake/Qt5Widgets)
set(Qt5Gui_DIR /home/roroco/Qt/5.5/gcc_64/lib/cmake/Qt5Gui)
find_package(Qt5Widgets)

add_executable(main main.cpp window.cpp systray.qrc)
target_link_libraries(main Qt5::Widgets)

my linux version(desktop environment is xfce)

roroco@roroco ~/Pictures $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 17.2 Rafaela
Release:    17.2
Codename:   rafaela
chikadance
  • 3,591
  • 4
  • 41
  • 73

1 Answers1

0

I get solution from this

Then under 'session & startup' I created a new autostart entry with the following command:

bash -c 'export DBUS_SESSION_BUS_ADDRESS="" && dropbox start -i'

so the ugly solution is make sure DBUS_SESSION_BUS_ADDRESS before you launch qt app, I hope someone can improve this answer and tell me its mechanism

chikadance
  • 3,591
  • 4
  • 41
  • 73