Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • error in generate automoc.cpp file???

    Solved
    6
    0 Votes
    6 Posts
    735 Views
    cerrC
    @christian-ehrlicher said in error in generate automoc.cpp file???: Your headers are twice in your repo. Yes, that was it, I had created the include/ and missed to delete the files outside it! That solved it! Thanks! :)
  • How to check TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL in Windows using QTCPSocket

    Unsolved
    3
    0 Votes
    3 Posts
    688 Views
    Kent-DorfmanK
    Read the docs for QAbstractSocket. There are plenty of methods and signals for you to experiment with.
  • How one QSlider move the other 3 QSliders ?

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    sonichyS
    @pl45m4 OK, actionTriggered is the signal before move ! int ov = 0; connect(slider, &QSlider::actionTriggered, [&](){ ov = slider->value(); }); connect(slider, &QSlider::valueChanged, [&](int v){ sliderR->setValue(sliderR->value() + v - ov); sliderG->setValue(sliderG->value() + v - ov); sliderB->setValue(sliderB->value() + v - ov); });
  • QTcpSocket:read null data from socket

    Unsolved
    10
    0 Votes
    10 Posts
    980 Views
    LengJianHanShuangL
    @aha_1980 you are right, actually I don't know how to use QByteArray and QDataStream together correctly, the QDataStream has starttransaction and committransaction, my understanding is that, when QDataStream is used to manage the socket data, first use the start** to record the start point of Data stream in QDatastream, then try to "read some data" from QDataStream, at this point, we can use committransaction to decide whether it succeeded in "reading some data"(may be the size of "some data" is different from byteavailable), if it suceed, the "some data" in QDataStream will be clear, if it is not, the "some data" can be still in QDataStream using rolltransaction. Is my understanding right?
  • A function being passed as an argument to a function?

    Solved
    3
    0 Votes
    3 Posts
    424 Views
    C
    @sierdzio Oh... cool XD thanks
  • How can i set <language conformance flag> like in Vs2017 ( /permissive/no)

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    SGaistS
    Hi, Try adding: CONFIG += no_keywords to your .pro file. This will disable the Qt specific keywords like signal and slot. You have to then use Q_SLOT and friends in your code.
  • Multiple definitions of slots / QNetwork implementation

    Solved
    10
    0 Votes
    10 Posts
    722 Views
    SGaistS
    Hi, Just in case, you are leaking QNetworkAccessManager objects in your HttpRequest method.
  • How to make some cells not editable in a qtableview with model?

    Unsolved
    3
    0 Votes
    3 Posts
    212 Views
    SGaistS
    Hi, An alternative that might also be interesting is QIdentityProxyModel where you re-implement the flags method.
  • A project into another

    Solved
    19
    0 Votes
    19 Posts
    1k Views
    mrjjM
    Super ! :) Please mark it as solved then.
  • How to Customize QTiffHandler

    Solved
    8
    0 Votes
    8 Posts
    523 Views
    R
    I'm going to mark this as solved as I have found a work-around iterating the photoshop IRB in a TIFF to find an embedded thumbnail.
  • How to implement receive buffer

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    Christian EhrlicherC
    When an empty QByteArray is returned, the loop in serialReadyRead() is stopped.
  • Building a c shared library in QtCreator

    Unsolved
    6
    0 Votes
    6 Posts
    614 Views
    M
    @gerd said in Building a c shared library in QtCreator: @martyn shouldn't that be QMAKE_LINK = cc QMKAE_LFLAGS+= -Wl,-init,MyInit OK - Yes the QMAKE_ versions do work :-) @aha_1980 said in Building a c shared library in QtCreator: @gerd is correct. The question to @Martyn is rather, why is QMAKE_LINK needed? The question is how do I instruct it to use c to link the DSO There is no such thing as a C or C++ linker. The linker links just symbols. If your file is compiled with a C++ compiler, then something wents wrong. Yes - I am wanting to use gcc as the (frontend/driver for the) linker to avoid libstdc++ being linked. To confirm, the source file was always being compiled by the c compiler. Please post the whole .pro file and the complete compile log for reference. QT -= core gui TARGET = myproject TEMPLATE = lib DEFINES += MYPROJECT_LIBRARY DEFINES += QT_DEPRECATED_WARNINGS QMAKE_LFLAGS += -Wl,-init,myprojectInit #QMAKE_LINK = cc SOURCES += \ binding.c HEADERS += \ binding.h \ pebinder_global.h unix { target.path = /usr/lib INSTALLS += target } This provides the link step as g++ -Wl,-init,myprojectInit -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,libmyproject.so.1 -o libmyproject.so.1.0.0 binding.o -lpthread So, as you say, the question is should qmake be smart enough to realise that c++ isn't needed to link if all the source files are .c. Though I'm happy to now have a simple solution :-)
  • 0 Votes
    2 Posts
    172 Views
    mrjjM
    Hi You mean like you can do with right click [image: mPol3P.png] Im pretty sure bitrock can add a reg key. so it seems you can do it this way. https://superuser.com/questions/379375/how-can-i-set-the-compatibility-mode-for-an-executable-from-the-command-line I have a feeling that you can do the same via manifest file but i have no details. Maybe @hskoglund knows about something :)
  • QLineEdit lostFocus problem

    Solved
    25
    0 Votes
    25 Posts
    4k Views
    mrjjM
    @thecipo76 Yep it helps a lot. :) I used qApp->focusWidget(); and sendEvent (key down / key up ) to post the keys to any widget that has keyboard focus and it works pretty well.
  • When window goes fullscreen, show something different

    Solved
    18
    0 Votes
    18 Posts
    4k Views
    L
    Just like @SGaist with QStackedWidget this works perfectly. Thanks to everyone!
  • Artificial Horizon like in Mission Planer

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    Pablo J. RoginaP
    @brmisha said in Artificial Horizon like in Mission Planer: It works))) great! Is your issue solved? please don't forget to mark your post as such. Thanks
  • "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project

    Solved
    16
    0 Votes
    16 Posts
    5k Views
    Pablo J. RoginaP
    @monolith said in "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project: Problem solved so please mark your post as such! Thanks.
  • symbol(s) not found for architecture x86_64

    Solved
    13
    0 Votes
    13 Posts
    3k Views
    TheCipo76T
    @sgaist Ok, now all works Thank you all
  • QtcpSocket: error0>directly send error

    Unsolved
    9
    0 Votes
    9 Posts
    905 Views
    LengJianHanShuangL
    @pl45m4 thanks very mush for your reply, the error signal has been triggered, after I reset my server device, things get fine. it seemed the server get into some trouble, window system could't access same port on server device too.
  • qss font-family not working

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    SGaistS
    Please post the link to the report so other users may find it more easily. Well, you would have to implement your own QStyle sub-class and write a parser that would translate your custom styling language in something that you can paint the way you want it. You can take a look at the internal QStylesheetStyle class that does that for Qt's style sheet system.