I'm trying to active a Qt Virtual Keyboard whenever user touch a any textinput.
I Can call Qt Virtual Keyboard like this command :
os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
In Ubuntu and Xubuntu Virtual Keyboard works fine.Here is the result :
But in Lubuntu virtual keyboard looks like this :
I can see the output of virtual keyboard in Xubuntu and Ubuntu but i cannot see in Lubuntu.
What could be reason for this bug and how can i fix it ?
Related
In my app i want to open ssh in terminal-emulator for user. Now i'am using QProcess like this:
QProcess _localhostConnection;
_localhostConnection.start(QString("gnome-terminal"), QStringList("--command=ssh 127.0.0.1"));
But the problem is there can be no gnome-terminal on another computer. Another computer has Ubuntu. How can i get installed terminal's list in Qt on Ubuntu?
Try calling x-terminal-emulator instead. Almost all Debian-based systems use the update-alternatives package (in conjunction with virtual packages like x-terminal-emulator) to bookkeep programs with similar functions, such as Internet browsers, editors, command shells, et cetra. Calling x-terminal-emulator will launch the default terminal emulator set by the user.
Read more about update-alternatives here: https://manpages.ubuntu.com/manpages/xenial/en/man1/update-alternatives.1.html
However, hardcoding --command=ssh 127.0.0.1 isn't very wise if you are aiming to support all terminal emulators. XTerm, for example, won't accept that parameter syntax.
I installed Anaconda 3 in Linux and tried to open Jupyter notebook in browser by typing 'jupyter notebook' in terminal.
But what I've got is the screen I added below.
As I guess, Jupyter Notebook is currently opened via 'Elinks', but I have no idea about what this is.
Do you know how to open Jupyter Notebook in the browser I want, such as Firefox or Chrome?
I wanted to add some information in case you wanted to later access juypter notebook via elinks (or any other text-based web browser in terminal).
I will also go over opening jupyter notebook with Anaconda Navigator.
First, You need to first install Node.js Javascript Runtime Environment by running this command in terminal.
sudo apt-get install node.js
Next, close and reopen terminal (I always do this when installing new software via command line).
When you next try to access your jupyter notebook via elinks it will ask for a token or password.
Option 1 : Token.
Find the token by entering jupyter notebook list in terminal.
Option 2 : Password.
You can create a password for jupyter notebook by entering jupyter notebook password in the terminal.
You can now use the token or your newly created password in order to access jupyter notebook via full-featured text web browser such as elinks.
If you want to access jupyter notebook via Firefox, Chrome, etc. then just use anaconda. This will automatically open jupyter notebook in your standard web browser.
Enter anaconda-navigator in terminal.
Once anaconda navigator opens, simply launch jupyter notebook from the selection.
You can set Firefox or Chrome as default browser, then it should open directly in it.
If it still doesn't, you can always copy the URLs which are displayed when jupyter notebook is started, and paste it in your browser.
To access the notebook, open this file in a browser:
file:///home/harshit/.local/share/jupyter/runtime/nbserver-2985-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=9fc770713dbd755750bbe842896420ecfa7abc038581fc04
or http://127.0.0.1:8888/?token=9fc770713dbd755750bbe842896420ecfa7abc038581fc04
By the way, jupyter notebook doesn't work, because, by default, JS is not enabled in eLinks browser (you can enable it).
I created file dialogs to select files within a Qt application. When migrating to Qt5 I encounter a regression, the file dialog is much poorer when linking against Qt5 rather than Qt4:
Qt4
Qt5
For example it is very hard for an user to navigate to the network mounted share directories.
The code is as simple as this:
QString path;
path = QFileDialog::getExistingDirectory(this, tr("Pick a file"));
QFileDialog::DontUseNativeDialog does not change anything.
My OS is Ubuntu 16.04, I have both nautilus (3.14.3) and nemo (2.8.7) installed. nemo is configured to be the default file manager:
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
Every other application seems to use the same dialog as the Qt4 file dialog screenshot.
How do I get the "old" file dialog in Qt5?
If I try with QT_QPA_PLATFORMTHEME= ./my_app then I get this:
The following works for me on Ubuntu 16.04 – it is more of a workaround than an actual solution, though:
Edit: First make sure that the package libqt5libqgtk2 is installed. It brings the GTK2 bindings for Qt5. If the package is not installed, the file choosers will look like the last screenshot shown in the question above.
Then, assuming you want to launch your application my_app from a terminal, launch it as follows (mind the space after =):
$ QT_QPA_PLATFORMTHEME= my_app
This is because, according to a bug report on launchpad, there seems to be a problem with the Ubuntu package appmenu-qt5: the package forces Qt5 dialogs to become non-native as a side effect of explicitly setting QT_QPA_PLATFORMTHEME=appmenu-qt5 via /etc/profile.d/appmenu-qt5.sh. Unsetting the platform theme via QT_QPA_PLATFORMTHEME= before launching your application changes this behavior locally.
Edit: When using the described approach, however, the global menu might not work in my_app.
I have just installed the latest versions of R (3.1.0) and Rstudio (v0.98.507) on a Windows 7 machine, 64 bit.
The R GUI works OK, but when I open the RStudio.exe only a blank window opens. I've tried re-installing R and RStudio.
Any suggestions?
By choosing the R version I wanted to use I was able to use Rstudio again.
To choose the R version you want to use with Rstudio do the following;
Click the CTRL key (don't let go)
Click on the Rstudio icon
Choose the version you want in the pop-up window.
For Ubuntu users where #neal's solution doesn't work.
$ rstudio --no-sandbox
related to: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468
Download the 64bit version and reinstall it.
The same for Linux
FOR LINUX: this happens to me on cloud instances. A solution is forcing software rendering of RStudio. You need to start RStudio, get to the black screen, close Rstudio black screen, do my solution below in the terminal with Rstudio closed, then start Rstudio again.
In terminal:
sudo nano ~/.config/RStudio/desktop.ini
APPEND THE FOLLWING TO [General] section (leave whatever is there and add the line below):
[General]
desktop.renderingEngine=software
Again this is for Linux, but there may be a similar issue in Windows and you may be able to force software rendering.
Press down Ctrl key and then click on RStudio icon to launch. A dialog box asks you about the R version. Choose the one that actually exists (you might see an R version which does not exist; confusing RStudio)
For Windows10 64bit.
After following the hold Ctrl and clicking RStudio icon.
Change the Rendering Engine: to Software.
This fixed the problem on my machine.
I recently began developing in Qt, but I am having an issue with console projects. When I run my program (Console Program), terminal opens and then immediately closes so I cannot see the output.
Here is the code that I am using:
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "In the stream";
return a.exec();
}
I looked in my project’s .pro file and it seems to be setup correctly (it is configured to use the console with CONFIG += console). I am not sure why the terminal window won’t stay open. I have tried adding system("PAUSE)
This does not work however. I am using Ubuntu and the default Qt Creator settings.
When I run the project I use the default run button, but I have also tried the debug button. The terminal window still just flashes open and then closes before I can see the output. The Application Output pane at the button just says that it is starting the application. This is what my terminal settings look like in QtCreator: x-terminal-emulator -e (this is default)
My QtCreator version is 2.4.1
Could someone tell me how to keep the console/terminal open so I can see the qdebug() output?
Thanks
Install xterm (sudo apt-get install xterm)
Go to project's run settings and check 'Run in terminal'
Now your console application will use xterm to show itself, but it will fail to debug. The other - safe - way to see console output is to open 'Application Output' (Alt+3). Though it cannot be closed by Ctrl+c (you'll have to use 'stop' button in QtCreator).
I've had this problem multiple times before, and it usually means that you're missing a dependency (which is not uncommon on Linux).
How to solve this:
Run the executable from the command line. It usually outputs an error message, that could give you additional info onto what the problem actually is
If that doesn't work or you need more info, use the ldd command to check dependencies:
ldd < path to your executable >
This will display all the dependencies required and their location - and will also tell you if it can't find one
Once you find the missing dependency (if that's the problem), you can most certainly install it with apt or apt-get