Skip to content

Qt Development

Everything development. From desktop and mobile to cloud. Games, tools, 3rd party libraries. Everything.
142.2k Topics 711.5k Posts

Subcategories


  • This is where all the desktop OS and general Qt questions belong.
    82k Topics
    451k Posts
    S

    Many thanks JonB.
    I used the solution without layout.
    Actually, before posting here, I had already tried to do it, but it wasn't working for me even though the solution wasn't very different from the code you see below that works.
    Probably due to fatigue and too many attempts, my brain had started to lose its edge :D
    Thanks again.

    This code works:

    #include <QFrame> #include <QLabel> #include "widget.h" Widget::Widget(QWidget *parent) : QWidget(parent) { QFrame *frame = new QFrame(this); frame->setStyleSheet("background-color: grey"); frame->setFixedSize(300, 200); QLabel *lbl1 = new QLabel("Label1", frame); lbl1->setStyleSheet("color: red"); QLabel *lbl2 = new QLabel("label2", frame); lbl2->setStyleSheet("color: green"); QLabel *lblCentered = new QLabel("CENTERED TEXT", frame); lblCentered->setStyleSheet("color: black"); QFont font = lbl2->font(); QFontMetrics fontMetrics(font); lbl1->move(10,180); lbl2->move(300-fontMetrics.horizontalAdvance(lbl2->text())-10,180); lblCentered->move((300-fontMetrics.horizontalAdvance(lblCentered->text()))/2, (200-fontMetrics.height())/2); }
  • The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
    14k Topics
    62k Posts
    SGaistS

    Hi,

    Do you mean something like QCA ?

  • Looking for The Bling Thing(tm)? Post here!
    20k Topics
    76k Posts
    mzimmersM

    Both of my models properly implement the setData() function as far as I can tell.

    Maybe I'm doing my proxy model incorrectly. The proxy model is set on an EquipmentModel (derived from a QAbstractListModel), but it's my SpaceModel (another QAbstractListModel) that actually sends the dataChanged() signal (hence the connection I show above). Does the signal need to come from the model that the proxy model is set on?

    The SpaceModel also emits a equipmentListChanged() signal when the list changes, and I connect that signal to my proxy model in its constructor (as shown above). Is this not sufficient to provoke the screen update?

  • Have a question about Qt Creator, our cross-platform IDE, or any of the other tools? Ask here!
    7k Topics
    34k Posts
    SGaistS

    Hi,

    Can you provide a minimal sample code that reproduces this behaviour ?

  • Your Qt just doesn't want to build? Your compiler can't find the libs? Here's where you find comfort and understanding. And help.
    10k Topics
    50k Posts
    JonBJ

    @grimvian Oh, I believe Qt Creator (that's what the IDE is) is known for fixing a broken arm, so all the best :)

  • What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
    844 Topics
    4k Posts
    D

    Thank you @Christian-Ehrlicher it worked!
    Could it be considered as a bug? (I would expect the cmake files of Qt to link openGL as I'm using Qt6::OpenGL)

  • Questions about Qt WebKit and related topics? Post here!
    2k Topics
    6k Posts
    SGaistS

    Hi and welcome to devnet,

    Are you thinking about the WASM platform ?

  • Discussions and questions on QtWebEngine
    1k Topics
    4k Posts
    Christian EhrlicherC

    Which script? Did you properly open the visual studio command prompt so all is correctly set up?

  • You're using Qt with other languages than C++, eh? Post here!
    856 Topics
    3k Posts
    PedromixP

    Next version of QtJambi is out now: 6.8.1. Download binaries on Maven Repository and find sources here: https://github.com/OmixVisualization/qtjambi/tree/v6.8.1
    QtJambi_release.png

  • Combining Qt with 3rd party libraries or components? Ask here!
    1k Topics
    5k Posts
    X

    @JonB Hi these I have already included.
    Also, I have seen a few examples at Github. I have tried to compile with MSVC as well as MinGW.
    These are the errors:

    moc_india_map_test.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsVectorLayer::staticMetaObject" (?staticMetaObject@QgsVectorLayer@@2UQMetaObject@@B) moc_india_map_test.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsRasterLayer::staticMetaObject" (?staticMetaObject@QgsRasterLayer@@2UQMetaObject@@B)

    after I try to run the project.

  • For discussion and questions about Qt for Python (PySide 2)

    3k Topics
    14k Posts
    SGaistS

    The thing is you call start and right after your write something to the stdin however there's no guarantee that your script has started at this point.
    You should use the started signal to then write to the process and you should also connect the errorOccurred signal because you never know what might go wrong.

  • Specific issues when using Qt for WebAssembly

    435 Topics
    2k Posts
    J

    Confirmed:Qt6.8.1, it's finally possible to input Chinese.
    Thanks for all.

  • Discussions and questions about Qt Quick Ultralite and using Qt on microcontrollers in general

    130 Topics
    434 Posts
    M

    @jsulm said in Using LIRC in Qt creator:

    @markolino_it said in Using LIRC in Qt creator:

    I don't know if in my old version of qt5 there is the package manager.

    @SGaist was talking about the packet manager of your Linux distribution!
    Sinse Raspbian is a Debian derivate you have to use apt.
    All you have to do is:
    sudo apt install liblirc-dev

    Oh sorry, now I understand. Yes i use it a lot of course...for the other packages, sorry for that I am a noob of Linux! So I will test the Lirc-less solution and Lirc solution and I let you know.

    Thank you.

  • The forum for discussing the Qt Digital Advertising Platform

    16 Topics
    40 Posts
    E

    @nayka Can I use QtDigitalAdvertising on PC applications? Or is it only allowed for use on Android or iOS mobile devices?

  • For discussion and questions about Qt Insight

    9 Topics
    12 Posts
    vicnguyenV

    Qt Insight 1.9 has been released. Qt Insight has new additions to the funnels and filters, allowing you to make deeper discoveries about your application usage. Two different funnel analytics, finer-grained geographic filtering options for regions, and many smaller improvements and bug fixes will enhance your insight.

    Read more details in the 1.9 release blog post.

  • Forum general guide

    Pinned
    22
    13 Votes
    22 Posts
    17k Views
    kshegunovK

    @Nils-A said in Forum general guide:

    @AnneRanch seriously? That's five years ago, four years before you joined.

    Nor is it relevant to your question.

    @AnneRanch said in Forum general guide:

    This in not the place to make sermons or trying to push your social opinions.
    Here is a "how to " borrowed form another site

    This isn't "another site", this site has a code of conduct, which's been established, reviewed and approved by a number of people and it certainly isn't under debate in this thread. If you have a specific complaint about a specific person/post bring it to the attention of the moderators directly by flagging it/them.