qt5

Failure on building Qt5 from source on Windows

会有一股神秘感。 提交于 2020-01-15 14:26:02
问题 As I would like to build my Windows version of Qt5 application (C++) statically, I downloaded the source of Qt5 from git. Installed all dependencies like Python, Perl, etc. When I ran the following command configure.bat -static -opensource -release -nomake examples -nomake tests -platform win32-g++ -c++11 -opengl desktop -no-icu -skip qtwebkit Everything was fine and the config program said "Qt is now configured for building. Just run mingw32-make." When I execute as requested, it ran for

Failure on building Qt5 from source on Windows

北城余情 提交于 2020-01-15 14:24:11
问题 As I would like to build my Windows version of Qt5 application (C++) statically, I downloaded the source of Qt5 from git. Installed all dependencies like Python, Perl, etc. When I ran the following command configure.bat -static -opensource -release -nomake examples -nomake tests -platform win32-g++ -c++11 -opengl desktop -no-icu -skip qtwebkit Everything was fine and the config program said "Qt is now configured for building. Just run mingw32-make." When I execute as requested, it ran for

Automatically resizing a window based on its contents

拥有回忆 提交于 2020-01-15 12:37:08
问题 I have a QDialog subclass that contains a spacer as its only immediate child; all of the window’s UI elements are contained in the spacer. The user cannot change the window size directly, but UI elements will be shown or hidden as the user interacts with the window. I’d like the dialog to resize each time this happens so that the spacer (and the dialog itself) always takes up the minimum possible amount of space. How can I configure my dialog and my spacer to get the desired behavior? (This

How to set the size of image and text inside QTextEdit using QTextDocumentFragment

亡梦爱人 提交于 2020-01-15 12:15:13
问题 Following my previous post I am implementing a command log using QTextEdit . The way it works is that every time the user interacts with the user interface the action is recorded inside a QTextEdit Command Log shown below. I successfully associate an image to every action (e.g. pushing a button, checking a box etc) but as you see in the print screen below the image is not resizing and everytime the user does something, instead of having an additional line, the image is put next to the other:

Qt5 and QML: How to automatically input username and password using WebEngine Quick Nano Browser

二次信任 提交于 2020-01-15 08:23:10
问题 I am writing a small application using Qt and QML that uses the example in the Qt documentation WebEngine Quick Nano Browser. In this example I am trying to access to my email. I can do it, but I am trying to enter username and password automatically so that I can instantly log into my emails. Basically as an example, after launching the application (my email address is hard-coded) I can see the username page of gmail , but here I have to type my username to access to the next page that has

Qt5 and QML: How to automatically input username and password using WebEngine Quick Nano Browser

半世苍凉 提交于 2020-01-15 08:22:07
问题 I am writing a small application using Qt and QML that uses the example in the Qt documentation WebEngine Quick Nano Browser. In this example I am trying to access to my email. I can do it, but I am trying to enter username and password automatically so that I can instantly log into my emails. Basically as an example, after launching the application (my email address is hard-coded) I can see the username page of gmail , but here I have to type my username to access to the next page that has

Restrict qDateTimeEdit to 15 minutes

耗尽温柔 提交于 2020-01-15 06:49:27
问题 In http://qt-project.org/doc/qt-5/qabstractspinbox.html#specialValueText-prop there is an example of how to restrict a QSpinBox. It says: zoomSpinBox->setSingleStep(10); My problem is that I would like to have a QDateTimeEdit where the user can only specify date times by quarter hours aka 15 minutes. Like 2014-12-12 12:30:00 is valid and possible but 2014-12-12 12:10:00 is not. Is there any easy way to accomplish this, as I couldn't find a way. One rather complicated solution would be to

detect when mouse cursor is over an irregular shape picture in Qt5 and QML

社会主义新天地 提交于 2020-01-15 06:18:09
问题 I'm developing a little application with Qt5 and QML (QtCreator and C++). I would like to display a map with countries and when user passes the mouse over a country I would like to change the color of the country, thought it would be easy, and it is if all countries were rectangles. Image { id: mycountry width: 250 height: 250 source: "images/myCountry_gray.png" MouseArea { anchors.fill: parent hoverEnabled : true onEntered: { region.source = "images/myCountry_red.png" } onExited: { region

Where is glGenBuffers in Qt5?

别等时光非礼了梦想. 提交于 2020-01-14 13:18:26
问题 I can't seem to find the glGenBuffer function in Qt5, my include list looks like #include <QtOpenGL/qgl.h> #include <QtOpenGL/qglbuffer.h> #include <QtOpenGL/qglcolormap.h> #include <QtOpenGL/qglframebufferobject.h> #include <QtOpenGL/qglfunctions.h> #include <QtOpenGL/qglpixelbuffer.h> #include <QtOpenGL/qglshaderprogram.h> #include <GL/GLU.h> I am trying to do something like the following example: http://qt-project.org/doc/qt-5.0/qtopengl/cube.html Where is it? 回答1: I know I'm late, but

Find screen a QWidget is located on

我是研究僧i 提交于 2020-01-14 10:29:08
问题 with functions QApplication::desktop()->screenCount(); QApplication::desktop()->screenGeometry(); I find how much screens exist on my system and on which screen coordinates they are located. Now I want to find out on which screen a QWidget is located at. How can I do that? Do I have to check the coordinates of the QWidget against the screen-coordinates or is there a more elegant way for this which returns the screen-number directly? Thanks! 回答1: I think the function you should be looking for