Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • Painting over a QVideoWidget

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    mrjjM
    @Jonathan-Levanon Good found. nice overlay class :)
  • copy unsigned char array into QByteArray ..... problems

    Solved
    16
    0 Votes
    16 Posts
    7k Views
    O
    @jsulm hi, i under stood that line in wrongly. in the place of <char *>, i have used const QByteArray. Now i got the point after going trough the type casting page, adviced by you. Now it is working. Thanks to all of you.
  • Impossible to bind QTcpSocket again after connection error

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    K
    Fortunately in our case the connection via QTcpSocket::connectToHost() without need QTcpSocket::bind() is sufficient. However, this may change in the future, and it may need to specify the outgoing network interface, so the problem of stacked binding of QTcpSocket will be there again. I found hypothetic scenario in which things might go worse if an error occurred. Imagine having two network interfaces labeled as N1 and N2. N1 is disconnected from the network. If the user accidentally decides to bind via QTcpSocket::bind() to N1, the connection fails. Changing the connection to N2 is now impossible. I guess it is impossible because QTcpSocket is still bounded to N1, so rebind to N2 fails and the connection to N2 is not possible. Do you know how to reset QTcpSocket to use QTcpSocket::bind() again?
  • Do we required to call qDeleteAll if the QList is of QSharedPointer?

    Solved
    2
    0 Votes
    2 Posts
    536 Views
    raven-worxR
    @Hetal no you don't need to call qDeleteAll in that case, since the QSharedPointer takes care of it. If the QList is also created on the stack you don't need to delete it too. The question is, do you need the (little) overhead of QSharedPointer at all?!
  • Add textEdits on listWidget

    Solved qt5.5 qt4 qt 5.7 listwidget
    15
    0 Votes
    15 Posts
    8k Views
    K
    @Devopia53 it works! , Thanks alot
  • No valid Kits found

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    J.HilkJ
    @philo_neo said in No valid Kits found: Hello, I work under Fedora 28 server x86_64, I installed Qt, with this command line: dnf install qt-devel qt-doc qt-creator. But when I make new project empty into Qtcreator 4.6.2 it returns to me: No valid Kits found .... I had to forget a something but what? Hi, I'm by no means a linux expert, but when I installed qt via the commandline, instead of the online-installer I had to specifically tell QtCreator the path to the compiler. Everything else was detected automatically. Don't have my Linux machine here right now, but this is where the compiler path should be: [image: c146e271-522f-4f5b-9935-70ba022e6e5d.png]
  • QScrollArea layout tips in designer?

    Solved
    4
    0 Votes
    4 Posts
    880 Views
    jsulmJ
    @Mr-Pang said in QScrollArea layout tips in designer?: But sometimes I want to append a sub-layout and then put two or more widget into it Then do it. A layout can contain other layouts and so on...
  • Qt for ebook readers (slanted text question)

    Unsolved
    4
    0 Votes
    4 Posts
    796 Views
    JKSHJ
    @Land_Outcast said in Qt for ebook readers (slanted text question): I got the following answer from Kovid Goyal: It doesn't have anything to do with calibre. Font interpretation in the view components of both sigil and calibre is done by Qt WebKit. You'd have to ask the Qt developers why that happens First, understand this: Here, WebKit is the component that renders your EPUB file. WebKit itself is a very large piece of software, and it's independent of Qt. "Qt WebKit" merely provides a way to integrate WebKit into Qt-based software. Unless I'm mistaken, Qt itself has no control over how WebKit renders anything. So my questions are: Does your slanting issue occur with other WebKit-based EPUB readers? What version of Qt WebKit do Sigil and Calibre use?
  • Visibility Toggling

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    G
    Thanks! I figured out a different way and forgot to check the forum. I used: onCurrentIndexChanged:{ visible: { switch(currentIndex) { case 0: return true; case 1: return false; default: return false; } } } Thanks for all of the help tough!
  • can we use the Qtimer & QeventLoop in different thread?

    Unsolved qeventloop qtimer qthread
    8
    0 Votes
    8 Posts
    5k Views
    Y
    @Buckwheat Thank you documents link. I will read it and trying to make change in my code. thank you @Buckwheat .
  • Application crash - possible graphic issue

    Unsolved
    3
    0 Votes
    3 Posts
    629 Views
    A
    If you have a customer that can reproduce it, get a crash log from them. You should be able to get the crash line from that and start looking into it from there. If you build for windows with MSVC you can always generate the .map file with your build and save that off. Then you can determine what line of your code the crash was on from their crash log (with no lines/function info). Another option is to leave debugging symbols in and get a full backtrace. If you are working with a posix compiler like clang or g++, then just don't strip the exe and build with -g. That should give you plenty of info to work with. The AA_UseDesktopOpenGL flag will cause Qt to use the system libgl.so (or the windows equivalent, sorry not a windows guy). This can definitely cause problems since that can be a different version than you're code or Qt is expecting. Could cause crashes or other graphical bugs. Forcing it to AA_UseOpenGLES would be a good first step in debugging the problem as well.
  • Changing color/transparency of certain image pixels

    Unsolved
    4
    0 Votes
    4 Posts
    633 Views
    J
    @SGaist [image: Screen_Shot_2018-06-25_at_3.26.44_PM.png] Okay so got the image uploaded. My intention is to plot that scatterplot on the image itself. So I was thinking that I got the scatterplots points then select those points on the image and convert the pixel color of those particular pixel as it would be easier for the user to figure out which part of the pictures are being selected. But I am unable to see any changes on the images. Could you guide to as to what is wrong in my code or is there a more efficient way to get it done. Thanks.
  • 0 Votes
    3 Posts
    2k Views
    A
    @Johnx8664 Learning Qt4 at this point would be a waste of your time. Like @SGaist said it's long past it's end of life. Qt5 is 12 major releases into it's life cycle now and 5 years old now. I would grab a book on Qt5, or I find it's pretty easy to learn Qt just from the docs that come with it. If you know C++ well (and you should if you are tackling Qt), then you should be fine learning from the Qt Assistant docs. There are a lot of examples and tutorials in there as well.
  • QMainWindow Titile Background Color or Opacity

    Solved qmainwindow
    2
    0 Votes
    2 Posts
    8k Views
    A
    @Ongsk Title bar decorations are managed by your window manager. You can change them (at a user level only) by changing your theme. This applies to osx, linux, and windows. If you want to force a specific color then you could make a window with a custom title bar and draw it however you want. Things like Chrome do this. Then they have an option to "use system title bar and borders". IMO, unless you are making a fully custom window like a video game launcher, or splash screen, or something like that you should let the window manager decorate the window. People customize their WMs to look how they like and standard looks are a foundation of GUI development. Here's a post from @mrjj that shows you how to do it in windows with native calls (Qt doesn't have a call for it) in case you insist on forcing a color on your users. https://forum.qt.io/topic/85837/change-window-title-bar-color-in-windows Keep in mind that will be for windows only so if you compile for linux or osx it will not work.
  • Warning generated on calling the capture slot form QCamera

    Unsolved
    2
    0 Votes
    2 Posts
    325 Views
    SGaistS
    Hi, Are you calling moveToThread anywhere in your code ?
  • Making selective changes to XML file

    Unsolved
    2
    0 Votes
    2 Posts
    337 Views
    SGaistS
    Hi and welcome to devnet, You can find the reason using the three last parameters of the setContent method.
  • Clang Code Model with Qt

    Solved
    5
    0 Votes
    5 Posts
    810 Views
    Cobra91151C
    @SGaist Ok. Thank you.
  • Strange effect after changing to 5.11.1

    Unsolved
    2
    0 Votes
    2 Posts
    303 Views
    SGaistS
    Hi, The quick and easy first would be to take a look at the release notes between 5.10 and 5.11.1 to see if there's anything related to OpenGL it them.
  • mapping data to a QComboBox

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    mzimmersM
    I never got this fixed, but I decided that having two places to select the MAC address was a bad idea anyway, so I replaced the QComboBox with a QLineEdit. Added this line to my main widget: mapper->addMapping(ui->lineEditMacAddr, MODEL_COL_MACADDR); And it seems to work fine. Marking as solved...
  • setStyleSheet on QWidget does not have effect

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    S
    Hello everyone, thank you for the answers. @mrjj You are correct, I also just found this page that describes exactly what you are saying about overridding the paintEvent class. Thank you everyone!