Invisible text in QTextEdit
-
@Alp-Hancioglu Does it work if you don't set any font? Do other Qt apps work (like VCL)?
Also: how did you install Qt? -
It doesn't work if I don't set any font.
Do you mean VLC media player? I just installed VLC and it also doesn't display any text. It only displays window headers and menu items.
I built qt from source as I said in my post. -
Hmm.. according to your code:
When you do not set a text in the QTextEdit-Control (textEdit.setPlainText)
there will be no visible text in the control! -
@karlheinzreichel I don't understand what you mean exactly but textEdit.append("some"); call doesn't display any text either. It moves the cursor but no text is shown.
-
@Alp-Hancioglu
in your code above there is no append (or did I miss something ?) -
@karlheinzreichel I tried the append call at some point but forgot to add it to the post. The issue seems much more bigger than QTextEdit though as there is also no text shown in VLC media player.
-
As you build qt from scratch, the question :
Have you installed the libconfig libraries before ... ?(probably not)
regards
karl-heinz -
@karlheinzreichel I didn't explicitly install libconfig library myself. I don't know if other program installed it as prerequisite.
In order to build, I downloaded qt-everywhere-opensource-src-5.9.1.tar.xz file and extracted it.
Then called ./configure and make on bash. -
So I would reccomend to check the build requierments for QT
(see http://doc.qt.io/qt-5/linux-requirements.html)
before building the qt libsregards
Karl-Heinz -
@Alp-Hancioglu Try to start your app with QT_DEBUG_PLUGINS environment variable set and check the output in the console. Looks like something is wrong with your system.
-
@Alp-Hancioglu Are there any errors/warnings?
-
@karlheinzreichel I checked every package and its dev version listed in requirements list and they are all installed and at newest version so there is no need to install or upgrade any of them. Some packages don't have the exact same name on my machine: libfontconfig is listed as libfontconfig1 on mine, libfreetype is listed as libfreetype6 on mine but the descriptions match.
I built Qt a week ago so they were most probably at newest version at time of compilation so I don't think they are related to the issue I have. -
@Alp-Hancioglu If you execute configure script before building Qt you will get a summary what was found and enabled. You can execute configure again with -v parameter and see whether fontconfig was really enabled.
-
@jsulm Thanks for the continued support jsulm.
I used ./configure -v and saw that fontconfig is disabled in build options:
Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no
Then I used ./configure -v -fontconfig to enable it but it didn't work with error:
ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
Then I run following to make sure libfontconfig is installed:
sudo apt install libfontconfig1 [sudo] password for alp: Reading package lists... Done Building dependency tree Reading state information... Done libfontconfig1 is already the newest version (2.11.94-0ubuntu1.1). 0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
I also run ./configure -system-freetype -fontconfig but it doesn't make a difference with resulting errors:
ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed. ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
Make sure freetype is installed:
sudo apt install libfreetype6 Reading package lists... Done Building dependency tree Reading state information... Done libfreetype6 is already the newest version (2.6.1-0.1ubuntu2.3). 0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
-
@Alp-Hancioglu You need to install the dev package for fontconfig. Something like libfontconfig1-dev.
-
@jsulm It is already installed:
sudo apt install libfontconfig1-dev [sudo] password for alp: Reading package lists... Done Building dependency tree Reading state information... Done libfontconfig1-dev is already the newest version (2.11.94-0ubuntu1.1). 0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
I checked every dev package in the requirements list and they are all installed with newest versions
-
@Alp-Hancioglu If you execute configure with -v you should get more output. Can you post it here?
-
I uninstalled Qt build with make uninstall and then fonts in VLC appeared. I am guessing Qt code in VLC was referencing Qt build libs in /usr/local/Qt-5.9.1/lib directory, which are deleted after uninstall, and this was causing the missing font in VLC. After uninstall VLC started referencing libs in /usr/lib/x86_64-linux-gnu/ which work and fonts appeared.
I tried compiling against headers and libs in qt-everywhere-opensource-src-5.9.1 directory, which is downloaded from qt website:
g++ -Wall -fPIC -c -g -I/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/include -I/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/include/QtWidgets main.cpp -o main.o
g++ -g -Wl,--trace main.o ext/printer.o -o main -L/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/lib -lQt5Gui -lQt5Core -lQt5Widgets
/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/6/crtbegin.o
main.o
ext/printer.o
-lQt5Gui (/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/lib/libQt5Gui.so)
-lQt5Core (/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/lib/libQt5Core.so)
-lQt5Widgets (/home/alp/Downloads/qt-everywhere-opensource-src-5.9.1/qtbase/lib/libQt5Widgets.so)
-lstdc++ (/usr/lib/gcc/x86_64-linux-gnu/6/libstdc++.so)
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libmvec.so.1
libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so.1)
/lib/x86_64-linux-gnu/libc.so.6
(/usr/lib/x86_64-linux-gnu/libc_nonshared.a)elf-init.oS
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so.1)
/usr/lib/gcc/x86_64-linux-gnu/6/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.oWhen I run with ./main following errors appear:
./main: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version
Qt_5' not found (required by ./main) ./main: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version
Qt_5' not found (required by ./main)
./main: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: versionQt_5.9' not found (required by ./main) ./main: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version
Qt_5' not found (required by ./main)which makes me guess that libs in qt-everywhere-opensource-src-5.9.1 are empty and g++ references the libs in x86_64-linux-gnu which are not the latest version 5.9 as expected.