Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Best way to draw gps point with qt

    Unsolved
    4
    0 Votes
    4 Posts
    417 Views
    B
    @Christian-Ehrlicher Ho thanks I will try this widget. It look like is what I need at firt sight.
  • ActiveQt / dumpcpp type library - skipping event interface

    Solved
    7
    0 Votes
    7 Posts
    846 Views
    G
    I use the boost::intrusive_ptr because the VC com smart pointer CComPtr ist not available in mingw (at least I did not find a header, but maybe missed it) and a sort of smart pointer seems to be needed with com. I choose intrusive_ptr because COM already counts the references internally. Here you will find some explanation: https://dieboostcppbibliotheken.de/boost.smartpointers-spezielle-smartpointer -> it is german, but maybe you can translate it. Do you know where I can find CComPtr in mingw? //----------------------------------------------------------------- Here is my workaround/solution for the initial topic (The skipped event interface) for others who have this problem. I recognized that I can connect a generic signal handler to the com component (QAxObject) which contains the skipped event interface and can catch the events there. Something like this: connect( m_qaxobject, SIGNAL(signal(const QString&, int, void*)), this, SLOT(eventSink(const QString&, int, void*)) ); void AClass::eventSink( const QString & name, int argc, void * argv ) { // See what events fired qDebug() << "Event: " << name << "argc:" << argc; if( name == "EventInterfaceEvent()" ) { ... } } I have another issue with the wrapper which the dumpp utility created, therefore I will open another topic.
  • How to access variable from one slot to another slot

    Solved
    6
    0 Votes
    6 Posts
    529 Views
    T
    @Christian-Ehrlicher said in How to access variable from one slot to another slot: You already explain why it does not work. You assign the pointer to a temporary which is not available later on. Ahh I got it. Thanks alot.
  • Building QSQLCipher trouble on MacOS.

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    Christian EhrlicherC
    I don't know dbeaver but since it looks like it can open all kinds of databases it should also have a plugin for sqlcipher
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    29 Views
    No one has replied
  • QListWidget doesn't highlights selected item :(

    12
    0 Votes
    12 Posts
    2k Views
    mrjjM
    @Ebrahim-Karimi Hi Yes, that is the normal way. Also so the Widget is owned and handled by the QListWidget like its items. I understand your rationale for then combining them into one class but if you then reuse the Widgets in another context, they are also half a QListWidgetItem and if you later wanted to use the View version of the List widget with a custom model, then the QListWidgetItem part is also not needed. Overall, in OOP we use inheritance when we have something we can say "is a" and i think what i find odd with it - is that we say the QListWidgetItem is now a QWidget which means it can no longer be copied and radically changed the expected contract of items. Like you could new a MyObjectWidget and place it on a form. But I dont think any part of Qt, include proxies will try to copy QListWidgetItems, so I dont think it will come back and haunt you :) So my comment was more out of o.O surprise of such a combination than out of fear or experience - that it will burnšŸ’„ later.
  • Support and slice file 3d

    Unsolved
    1
    0 Votes
    1 Posts
    110 Views
    No one has replied
  • Missing bluetooth module

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    SGaistS
    No, you are mixing Qt Creator and Qt itself again. These are two different things. Qt Creator is an IDE built with Qt. This is the list of plugins of Qt Creator. AFAIK, because it's mandatory for Qt Creator to work.
  • Correct mode to draw UI

    Unsolved
    3
    0 Votes
    3 Posts
    288 Views
    S
    @Chris-Kawa said in Correct mode to draw UI: The last line is too long because you've set a 2 column span on the horizontal layout, Just remove it: Layout->addLayout(hl1, 3, 1); Yes, this solution works fine :) As for the widths - I don't know what SetWidgetWidth is, but you can remove it and just set some stretch factors, for example: hl1->setStretchFactor(leZip, 1); hl1->setStretchFactor(leCity, 10); hl1->setStretchFactor(leProv, 1); The 1,10,1 ratio is just an example. You can set it to be whatever you want. Alternatively you can fix the size of the side line edits and set the central one to expanding: SetWidgetWidth estimate width of widget about max string lenght. This is the function: void GenericDialog::SetWidgetWidth(QLineEdit *LineEdit, uint16_t len) { QString StrLen; for(uint16_t s = 0; s <= len; s++) StrLen += 48+s; QFontMetrics fm(LineEdit->fontMetrics()); LineEdit->setMinimumWidth(fm.horizontalAdvance(StrLen)); } I tried to use setStretchFactor, but leZip and leProv still too large. If I increase width of window, leZip, leCity and leProv increase his width in equal measure. leZip->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); leCity->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); leProv->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); With setSizePolicy (that I had already tried) leZip and leProv continue to still too large. It seems that under this measure they cannot be set. Also, just a side note: just as all indexing in C++, row numbers start at 0. You added widgets to rows 1, 2 and 3, so you have an empty row at the top of the layout. Yes, you are right, but the posted code is a small part of a larger function with other controls above.
  • Can't build libqwt.dylib on MAC

    Unsolved
    5
    0 Votes
    5 Posts
    468 Views
    SGaistS
    Sorry, I haven't had any trouble building it here. macOS is 10.13.6 with Xcode 10 as well. Note that if you get the designer plugin, it means that the qwt.framework was created otherwise the plugin can be linked.
  • QLabel not being updated in a QTextEdit

    Unsolved
    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • Exposed model to QML does not Update

    Solved
    6
    0 Votes
    6 Posts
    362 Views
    SGaistS
    It was just a general statement. It happens from time to time that people try to use the proxy model as a standard model. This is indeed not your case :-) Sorry for the confusion !
  • This topic is deleted!

    Locked Unsolved
    2
    0 Votes
    2 Posts
    15 Views
  • Using QTimer::singleShot correctly for updating messages on GUI

    Solved qtimer qlabel qtcreator
    8
    0 Votes
    8 Posts
    3k Views
    Chris KawaC
    @TUStudi said: I actually have 6 QLabels, so I now have 6 timer and so on Derive a class from QLabel and add that functionality to it. Don't write the same code 6 times! My QLabels have the sizePolicy horizontal: preferred and vertical: fixed and a vertical length of 20. When a text is displayed, the QLabel expands so that the elements above the QLabel are also moved upwards and after the text disappears, they go back to their initial place. Fixed size policy means that widget uses its sizeHint() as the size. If you change the text the size hint also changes, so label grows/shrinks.
  • What is the most efficient way to expose a QList<int> to QML?

    Unsolved
    1
    0 Votes
    1 Posts
    224 Views
    No one has replied
  • Install python2.7 , while installing Qt c++ application on windows

    Unsolved
    3
    0 Votes
    3 Posts
    329 Views
    B
    @mrjj Thanks. it worked
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 怐qt5.14.1+vs2017+win10怑QPrinter reports errors

    Unsolved
    2
    0 Votes
    2 Posts
    260 Views
    K
    @sblost Hi and welcome to devnet forum QPrinter is just an interface to the native printer driver installed in your machine. Therefore the error is most likely caused outside of Qt libs. In case you are changing the PrinterResolution setting through QPrinter ensure that the value is valid.
  • Question about QDataStream and its functions startTransaction and commitTransaction

    Unsolved
    2
    0 Votes
    2 Posts
    330 Views
    Christian EhrlicherC
    So how do you send your data?
  • use to undeclared identifier on SQL Connecting

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    Christian EhrlicherC
    @ELEMENTICY said in use to undeclared identifier on SQL Connecting: Doing that is good,but.You didt tell me the answer ;/ I gave the answer to you - my link has a code example which does exactly what you want. See in the details section!