qt5

Cmake Qt5 | undefined reference to `QPrinter::QPrinter(QPrinter::PrinterMode)

孤人 提交于 2020-01-30 00:21:49
问题 I am preparing cmake build for qt application. where I am using following structure .. libMyApp which uses SET(QT5_MODULES Widgets PrintSupport Network XmlPatterns) FIND_PACKAGE(Qt5 REQUIRED COMPONENTS ${QT5_MODULES}) and TARGET_LINK_LIBRARIES( ${TARGET_NAME} Qt5::Widgets Qt5::PrintSupport Qt5::Network Qt5::XmlPatterns ) libMyApp build successfully and generated libMyApp.a (static library) Now I am using this library in my application MyApp which uses SET(QT5_MODULES Widgets PrintSupport

Qt: How to detect which version of OpenGL is being used?

大兔子大兔子 提交于 2020-01-29 13:11:05
问题 There are several ways that Qt can use OpenGL: desktop (native), ANGLE, ES... and now there's 'dynamic' which can choose at runtime. Within an app, is there a way that you can detect which one is in use? Either within C++ or within QML? e.g. something equivalent to the global declarations that let you detect OS 回答1: To detect the OpenGL version in QML, there is OpenGLInfo in C++, there is QOpenGLContext::openGLModuleType() in the OpenGL C++ library, there is glGetString(GL_VERSION) see also

Qt5 - QML: Button does not show up after triggered

家住魔仙堡 提交于 2020-01-25 11:10:37
问题 I am writing a project that is using Qt5-QML . In order to shrink the problem I prepared a small example that replicates the problem. 1) I have an application on a Page1 . That carries a Button as shown in the below print screen below: 2) After the user pushes the button goes on Page2 shown below which carries different Buttons . Let's say Button A it is the user's choice: 3) The final screen represented by Page1 is the correct choice, which is the the button selected The problem I have is

Qt5-QML: automatic authentication username and password with on a third party device

喜夏-厌秋 提交于 2020-01-25 04:14:26
问题 After understanding how to integrate JavaScript functions into Qt-QML I am now trying to apply what I have learned in my previous post to a small real world example in my lab. I am trying to access to my robots via wi-fi using using a third party device present in my lab. I have a log-in form provided by the device as shown in the print screen given below. The address is, for example, https://123.456.789.123:7878 (which I made up but it is for understanding the idea): After navigating the

Qt5 installation problems

谁说我不能喝 提交于 2020-01-24 21:00:08
问题 I am trying to install Qt5 on OS-X 10.7.5, using the prebuilt binary version. Everything seems to be OK, QtCreator is installed and it works. However when I create a new project, I get the error: "No valid kit found". The Qt version detected seems to be the old Qt4 one only. The file I used for the installation is the one that contains everything: Qt5, QtCreator, ... (398 MB), but when installed only the directory with QtCreator seems to be available. Should I uninstall Qt4 first? Is it a

QPainter painter object outside paintevent

自作多情 提交于 2020-01-24 20:57:25
问题 I am trying to draw a simple two dimensional figure in a QWidget window. There is a paintEvent defined and a painter object of the QPainter class is also defined. My drawing contains elements which I need to draw more than once at various locations, such as lines, text etc. For this purpose, I am using functions to draw these lines with varying positions. Similarly for text. In order to make the program shorter, also modular. The paintEvent function is calling functions which are used to

Get active Tab from TabView and change item property

柔情痞子 提交于 2020-01-24 09:31:07
问题 In the context of a dual-pane file manager, I have two TabView items side by side, each contains multiple tabs of course, and each Tab loads a TableView showing the content of a specific directory using FolderListModel . SplitView TabView Tab Tab TabView Tab My current task is to implement a toolbar button to toggle the showHidden property of the FolderListModel instance shown in the active tab. Therefore, I need a way to find out what the currently active tab is. Next, once I get the active

使用Visual Studio 2015开发Qt程序

孤街浪徒 提交于 2020-01-24 08:46:32
0、开发环境及工具   操作系统:Windows 7 x64   编译器:Visual Studio 2015 社区版   Qt版本:5.6.0   编程助手:Visual Assist X 2074。 1、安装   需要依次安装以下工具:vs2015、Qt 5.6.0 for Windows 32-bit (VS 2015)、Perl。   Qt安装路径:D:\Qt\Qt5.6.0_x86。安装完毕后添加如下路径到系统环境中:D:\Qt\Qt5.6.0_x86\5.6\msvc2015\bin。   Perl安装路径:C:\Perl。 2、安装插件   为了在vs2015中使用Qt5,需要首先安装插件。在visual studio 2015中依次点击“工具”-“扩展和更新...”,打开管理窗口。在左侧栏中点击“联机”标签,在搜索中输入Qt5,可以找到扩展包Qt5Package,如下图:      安装后可以在Visual Studio 2015的IDE菜单中看到“QT5”项。点击“QT5”-“Qt Option...”,打开管理窗口。点击按钮“Add”,选择Qt5安装路径。注意,是包含msvc2015的全路径,下图是我的安装路径。因为我同时安装了32位和64位版本的,所以会看到两行的配置内容。    3、配置Visual Assist X       4、安装QtCharts组件

How to set 3-key sequence shortcut with two key modifiers in Qt?

99封情书 提交于 2020-01-24 03:51:06
问题 I have been trying to set a shortcut as Ctrl + Shift + C . I have tried the following ways: QAction *generalControlAction = new QAction(this); generalControlAction->setShortcut(QKeySequence("Ctrl+Shift+c")); connect(generalControlAction, &QAction::triggered, this, &iBexWorkstation::onGeneralConfiguration); QShortcut *generalControlShortcut = new QShortcut(QKeySequence("Ctrl+Shift+C"), this); connect(generalControlShortcut, &QShortcut::activated, this, &iBexWorkstation::onGeneralConfiguration)

QPainter and OpenGL native code in QOpenGLWidget class

坚强是说给别人听的谎言 提交于 2020-01-23 11:09:08
问题 I am preparing a desktop application to draw some 2D plots. I am using C++: Qt 5 and visual studio 2013. I created a simple GUI and put myQOpenGLWidget in it. I am already drawing the plots, axes and ticks using my own openGl shaders. Everything works fine and now I want to add the description to my axes and ticks to make the graph possible to analysis. As in OpenGL itself there is no dedicated functions to render text, I came up with using QPainter object just to add the desired description