首页 > 其他分享 >qtchooser -install qt6 $(which qmake6)

qtchooser -install qt6 $(which qmake6)

时间:2024-07-18 13:33:03浏览次数:6  
标签:qt6 install qtchooser qmake qmake6 conf

qtchooser -install qt6 $(which qmake6)

https://askubuntu.com/questions/1460242/ubuntu-22-04-with-qt6-qmake-could-not-find-a-qt-installation-of

 

In Ubuntu 22.04 after installing Qt6 using

sudo apt install qt6-base-dev

calling qmake results in an error message:

qmake: could not find a Qt installation of ''

or

qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory

It is however possible to call/run qmake6. How to make qmake work and point it to qmake6?

 

 

In Ubuntu 22.04 there is currently an open bug QtChooser doesnt support qt6.

So even if Qt6 has been installed using sudo apt install qt6-base-devqtchooser -l does not list a qt6 option and qmake outputs qmake: could not find a Qt installation of ''.

Assuming Qt6 is installed and qmake6 can be called, I believe there are two options:

1. Select Qt6 system-wide

Generate qt6.conf based on the path to qmake6

qtchooser -install qt6 $(which qmake6)

Move qt6.conf to system-wide dir

sudo mv ~/.config/qtchooser/qt6.conf /usr/share/qtchooser/qt6.conf

Set Qt6 as default option

sudo mkdir -p /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser
sudo ln -n /usr/share/qtchooser/qt6.conf /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser/default.conf

2. Select Qt6 for current user only

Generate qt6.conf based on path to qmake6

qtchooser -install qt6 $(which qmake6)

Select Qt6 as default (place in ~/.bashrc for persistence):

export QT_SELECT=qt6
  If you run qtchooser -install as root (eg, use sudo), it will add the configuration to the qt-default directory instead of a user's home directory, removing the need to move the conf file. This also means, for the purposes of creating a Docker image (as I am), you only need to do step 2 in the Dockerfile (that is RUN the command and set the ENV variable) for it to be functional container-wide. 

 

========== End

 

 

 

 

标签:qt6,install,qtchooser,qmake,qmake6,conf
From: https://www.cnblogs.com/lsgxeva/p/18309326

相关文章

  • QT6 CMake项目配置 (VSCode)
    QT6CMake项目配置(VSCode)这篇文章我们介绍一下在VSCode下的配置,大体上和VisualStudio上差不多,建议先把之前介绍在VS上的配置过程看一遍,VSCode安装这个就不用说了吧,无脑下一步插件安装先把CMake相关的插件装一下第一个是CMake语言的支持插件,装了这个写CMakeLists.txt就......
  • QT6 CMake项目配置 (Visual Studio)
    QT6CMake项目配置(VisualStudio)上一节已经编译好了动态和静态的QT库,接下来在CMake中引入。这边主要介绍使用VisualStudio的配置方法测试环境首先使用VS创建一个项目来测试CMake能否正常使用。如果是首次打开VS会有个配置主题的界面,自己选一下就好了首先我们来创建一个C......
  • Deepin23RC2 在线安装qt6.7.2
    摘要:        Deepin23RC2在线安装qt6.7.2及配置的操作记录1.下载在线安装器$wgethttps://ftp.fau.de/qtproject/official_releases/online_installers/qt-unified-linux-x64-online.run2. 安装c++/gdb/libxcb-util1/git$sudoaptupdate$sudoaptupgrade......
  • QT6.7.2 MSVC源码编译 静态库 动态库
    QT6.7.2MSVC源码编译静态库动态库也可以参考官方的文档https://doc.qt.io/qt-6/build-sources.html环境搭建为了操作更有可复制性,这里在虚拟机中采用全新安装的系统进行配置。系统镜像为:en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96_2.iso安装VisualStudio......
  • QT6安装Android SDK出现"Android SDK Command-line Tools run"出错解决办法
    前言以下提供的方案,是在QT6,Androidstudio均有安装的前提下,安装完javaJDK,在设置安卓SDK时出现的问题,具体表现如标题所言本文目的是以做笔记学习,交流为主,推荐参考参考链接参考链接https://blog.csdn.net/yy_xzz/article/details/132135255操作流程确定NDK路径......
  • Qt6 播放音视频
    一、概述QT6相较于Qt5引入了许多新特性和改进,包括对音视频开发的增强支持。QT6中的音视频支持QT6提供了一套完整的音视频处理功能,这些功能被整合在QtAV项目中。QtAV是一个基于Qt的音视频处理框架,用于处理音视频播放、录制、编解码、处理等任务。QT6对QtAV进行了进一步的集成......
  • 【QT6】pycharm集成qt desinger(非anaconda等环境下)
    前言已经安装好了PyQT6,如果没有,请自行选择在项目或者全局打开cmd并输入:pipinstallPyQt6来进行安装!开始安装确定自己是否有安装pyside6,如果有,直接跳到下一步。。如果你没有安装过pyside6,任意地方打开cmd,输入:pipinstallpySide6安装完毕后,找到你python的安装目录:然后点进......
  • Qt - Qt6中QTextStream类的setCodec方法没有了,怎么解决写中文文本乱码
    简介场景:程序在linux下运行,将中英文写入文本,将文本在windows上打开时,中文出现乱码 原Qt5中:QFilefile;file.open(QIODevice::WriteOnly|QIODevice::Text);QTextStreamtextStream(&file);textStream.setCodec("GBK");使用 QTextStream类的 setCodec方法即可解决上......
  • Pyqt6&PySide6 事件与事件的处理函数
    什么是事件?事件是程序收到外界的输入,处于某种状态时自动发送的信号。事件有固定的类型,每种类型有自己的处理函数,用户只要重写这些函数,即可达到特定的目的。通过事件可以用一个控件监测另外一个控件,并可过滤被监测控件发出的事件。事件的类型与处理函数事件的概念与实列外界对P......
  • Pyqt6&Pyside6 信号与槽详解
    信号与槽对于可视化编程,需要将界面上的控件有机结合起来,实现控件功能的联动和交互操作。比如点击按钮,实现某项功能。对按钮功能的定义,是通过信号(signal)与槽(slot)机制实现的。信号与槽是PySide6编程的基础,也是Qt的一大创新,有了信号与槽的编程机制,在PySide6中处理界面上各个控件......