qt5

QLabel not giving updated txt

混江龙づ霸主 提交于 2020-06-23 18:04:10
问题 I added a QLabel inside my widget and it is editable through UI, able to set new text also, but not able to retrieve the updated text using function text(); QLabel *m_ColorName = new QLabel("_________"); m_ColorName->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextEditable); In UI i am able to edit to new text but by calling function m_ColorName->text(); Its giving default txt _________ Code H file class CascadeColorHighlightWidgetItem : public QWidget { Q_OBJECT public:

What is the rule for choosing “central widget” in QMainWindow? and why is it important?

血红的双手。 提交于 2020-06-23 02:13:36
问题 I understand setCentralWidget is required in QMainWindow implementation, and at first sight, it seemed extremely self-explaining what central widget means. But is there a more strict definition of " central "? Say, I have several equally important widgets located in the central area of the window, should I always find a way to group them together and set the group to be the central widget? or I could just randomly choose one? More importantly, what happens to the non-central widgets? Are

What is the rule for choosing “central widget” in QMainWindow? and why is it important?

≡放荡痞女 提交于 2020-06-23 02:12:58
问题 I understand setCentralWidget is required in QMainWindow implementation, and at first sight, it seemed extremely self-explaining what central widget means. But is there a more strict definition of " central "? Say, I have several equally important widgets located in the central area of the window, should I always find a way to group them together and set the group to be the central widget? or I could just randomly choose one? More importantly, what happens to the non-central widgets? Are

Is there a way to take screenshot of a window in pyqt5 or qt5?

﹥>﹥吖頭↗ 提交于 2020-06-22 12:42:31
问题 #!/usr/bin/env python3 from PyQt5.QtGui import * from PyQt5.QtWidgets import QApplication, QWidget import sys app = QApplication(sys.argv) screen = QApplication.primaryScreen() widget = QWidget() screenshot = screen.grabWindow(0, 0, 0, 100, 100) screenshot.save('shot', 'jpg') How can i use this to get a window? it only get a part of screen: screenshot = screen.grabWindow( widget.winId() ) I need a crossplataform method.. 回答1: Ref: http://doc.qt.io/qt-5/qscreen.html#grabWindow You say you

Qt error : The program has unexpectedly finished. The process was ended forcefully

戏子无情 提交于 2020-06-17 13:33:30
问题 I Started new project with Qt5 , and tried Qt Quick Project( QML ) on Windows10(64bit). Because I want to use various animations & effects. But I hit a brick wall, that I can't run & debug QML projects. First, I want to use swiping so I try swipe example, but the project makes an error. The run error is first image, and the debug error is second image. p.s - I tried somthing to solve the errors, which are updating NVIDIA driver, trying to release mode and making a new Qt Quick Application

Qt error : The program has unexpectedly finished. The process was ended forcefully

浪尽此生 提交于 2020-06-17 13:33:25
问题 I Started new project with Qt5 , and tried Qt Quick Project( QML ) on Windows10(64bit). Because I want to use various animations & effects. But I hit a brick wall, that I can't run & debug QML projects. First, I want to use swiping so I try swipe example, but the project makes an error. The run error is first image, and the debug error is second image. p.s - I tried somthing to solve the errors, which are updating NVIDIA driver, trying to release mode and making a new Qt Quick Application

Project ERROR: Unknown module(s) in QT: websockets

送分小仙女□ 提交于 2020-06-15 05:51:11
问题 I'm trying to run a simple client example using QTWebsockets using Qt Creator, already add the QT += websockets But it throws this when i run build or qmake :-1: error: Unknown module(s) in QT: websockets I tried QT += core websockets Then realized that since installed Qt Creator from the repositories it wasn't up to date, so I reinstalled it from the Qt website but the problem persisted, I then ran pkg-config --modversion QtCore and it returns 4.8.6, thing is, in the QT version tab of qt

cLion + Qt5 - exit code -1073741515 (0xC0000135)

对着背影说爱祢 提交于 2020-06-13 11:12:12
问题 I'm trying to run simple test using QT5 and cLion but I run in to the exit code wall... Here is my envi : cLion 2017.2 minGw 5.0 < according to cLion cMake 3.8.2 Qt 5.9.0 CMakeList.txt cmake_minimum_required(VERSION 3.8) project(testWindotQt) set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp ) add_executable(testWindotQt ${SOURCE_FILES}) if (WIN32) # If you

Unable to implement Google Sign-In using QOAuth2AuthorizationCodeFlow

给你一囗甜甜゛ 提交于 2020-06-13 08:20:48
问题 The issue is with redirect URIs, I don't know what to set it to. Hase ANYONE been able to figure this out? I get an error in Qt Creator's output pane that looks like this: qt.networkauth.oauth2: Unexpected call qt.networkauth.replyhandler: Error transferring https://oauth2.googleapis.com/token - server replied: Bad Request Here's my code, a function called grant() that will return true open successful authentication. The helper class OAuth2Props returns all the data from the JSON file

Why do I get this “error: undefined reference to `qt_version_tag' ”?

若如初见. 提交于 2020-06-10 03:53:40
问题 I am using Qt 5.7 on Ubuntu 16 LTS machine. I get this error: (.qtversion[qt_version_tag]+0x0):-1: error: undefined reference to `qt_version_tag' This error comes only when I use SDL libraries. 回答1: I realize this is an old thread but you may be able to avoid it by defining QT_NO_VERSION_TAGGING; that is, by passing the option: -DQT_NO_VERSION_TAGGING to gcc. 来源: https://stackoverflow.com/questions/39871879/why-do-i-get-this-error-undefined-reference-to-qt-version-tag