qt5.3

QML ListView method positionViewAtEnd() does exactly the opposite

喜欢而已 提交于 2019-12-05 14:02:56
问题 I'm going crazy. I have a ListView inside a ScrollView, hooked up to a model that inherits QAbstractListModel. When objects are added to the model, the ListView shows them using a delegate. So far, so good. But I really want the view to stay scrolled to the bottom (like a chat window), and I'm having a very difficult time making that happen. Here is the relevant QML code: Rectangle { ScrollView { [anchor stuff] ListView { id: messageList model: textMessageFiltered delegate: messageDelegate }

Pasting emoji in QT QTextEdit

一曲冷凌霜 提交于 2019-12-04 12:36:39
问题 I'm trying to paste emoji's in the QT QTextEdit box but it's not getting recognized and it's showing as ??? or [][] I'm not talking about smiley, I'm talking about emoji. How can I go about making sure that QT's QTextEdit accepts emoji and displays them correctly? Thank you. Got it based on the helpful answer below: SOLUTION: QFontDatabase fontDB; fontDB.addApplicationFont(":/Resources/fonts/seguisym.ttf"); QApplication::setFont(QFont(QStringLiteral("Segoe UI Symbol"))); 回答1: A considerable

Pasting emoji in QT QTextEdit

早过忘川 提交于 2019-12-03 08:08:39
I'm trying to paste emoji's in the QT QTextEdit box but it's not getting recognized and it's showing as ??? or [][] I'm not talking about smiley, I'm talking about emoji. How can I go about making sure that QT's QTextEdit accepts emoji and displays them correctly? Thank you. Got it based on the helpful answer below: SOLUTION: QFontDatabase fontDB; fontDB.addApplicationFont(":/Resources/fonts/seguisym.ttf"); QApplication::setFont(QFont(QStringLiteral("Segoe UI Symbol"))); mhcuervo A considerable number of emoji characters are in the Unicode Standard . If you're, for example, developing with Qt

Qt stylesheet in derived class in C++ namespace (selector)

假装没事ソ 提交于 2019-11-30 21:00:29
I want to use my global qss stylesheet with a derived class. I understand I have to override the paintEvent ( style sheet reference , or here ). void CustomWidget::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); // tried initFrom too, same result=>not working QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } However, it does not seem to work. With CDerived:QWidget and the following style sheet lines I face: CDerived { background-color: black; } // no effect QWidget { background-color: black; } // works CDerived implements paintEvent as above. Anything

Qt stylesheet in derived class in C++ namespace (selector)

China☆狼群 提交于 2019-11-30 05:40:50
问题 I want to use my global qss stylesheet with a derived class. I understand I have to override the paintEvent (style sheet reference , or here). void CustomWidget::paintEvent(QPaintEvent *) { QStyleOption opt; opt.init(this); // tried initFrom too, same result=>not working QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } However, it does not seem to work. With CDerived:QWidget and the following style sheet lines I face: CDerived { background-color: black; } // no

QT and native OpenGL support in MS Windows

走远了吗. 提交于 2019-11-28 12:11:33
问题 I'm trying to import the cube example in MS visual studio 2013 via the QT add-in. Unfortunately, when trying to open the .pro file I get the following error: Project ERROR: This example requires Qt to be configured with -opengl desktop Doing a little research in the web I realized that by default QT OpenGL support is build on ANGLE-library which as I realized is an OpenGL to DirectX9.0 kind of translator. Thus, I have two options (link): Install ANGLE. Recompile QTv5.3 with option -opengl

Serious rendering issues with OpenGL 4.1 and Qt 5

冷暖自知 提交于 2019-11-28 10:00:51
问题 I've seen some promising references to being able to run Qt5 on modern OpenGL. I'm using the following code to set my QQuickView to OpenGL 4.1 Core (the latest supported on OSX 10.9 with my MacBook). QSurfaceFormat sf = g_mainView->format(); sf.setProfile(QSurfaceFormat::CoreProfile); sf.setVersion(4, 1); g_mainView->setFormat(sf); Major issues. First, the app crashes entirely when trying to render text. If I happen to only have images, rectangles, etc in my QML, I get a ton of fragment

Translations of QMessageBox not work in Qt5.3

走远了吗. 提交于 2019-11-28 09:01:28
问题 I'm a fan of Qt and update it frequently, Qt5.1->5.2->5.3. However, the tranalations of Standard buttons like "Ok" "Cancel" "Save" do not work anymore in Qt5.3. They are not translated, but just plain English. The Code for translations does NOT change through each version of Qt. like: TRANSLATIONS = qt_fr.ts QTranslator trans trans.load("qt_fr"); a.installTranslator(&trans); any idea? [Update] AFAIN, it might be a bug. Go back to Qt5.1 is a slution if U dont have to use some improvements in