Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.3k Posts
  • Printing and positioning

    Solved printing scaling
    6
    0 Votes
    6 Posts
    2k Views
    Y
    Finally. This code works fine. void onPrint(QPrinter* printer) { QPagedPaintDevice* device = printer; QPainter painter; painter.begin(device); int w = device->width(); int h = device->height(); painter.drawLine(0,0,w,h); painter.drawLine(0,h,w,0); painter.drawEllipse(QPointF(w/2, h/2), w/10, w/10); painter.drawText(0, h, "pixels"); printer->newPage(); painter.end(); }
  • How to place a button on top in QGraphicsView

    Solved
    2
    0 Votes
    2 Posts
    467 Views
    mrjjM
    Hi yes it is. Just use the view as parent and it will be on top. QPushButton *button = new QPushButton("Im on top!",view); button->move( 100, 0); // use move to move it around
  • 0 Votes
    2 Posts
    256 Views
    R
    Everything seems to work OK without doing anything special as long as I am careful not to mix up which connection is used by which thread, so I am marking this as "solved".
  • MYSQL driver not loaded after I changed the computer

    Solved
    3
    0 Votes
    3 Posts
    272 Views
    FlameF
    Thank you. I wonder what additional dynamic link libraries I need,and I have used depends.exe to find these dll.
  • Changing Qt version from 5.9.1 to 5.12.4 cause a crash in windows 10 ( 3D project)

    Unsolved
    1
    0 Votes
    1 Posts
    359 Views
    No one has replied
  • QImage : convert 8-bit image to 4-bit image

    Unsolved
    3
    0 Votes
    3 Posts
    544 Views
    T
    Thanks for your response. :)
  • libcurl vs QT Network - what is better?

    Solved
    3
    0 Votes
    3 Posts
    558 Views
    B
    Thx a lot. Will look on it.
  • Basic Question - Regenerating a new ui_programname.h file

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    U
    Thank you very much, mrjj, You've been wonderfully helpful!
  • Link Menu Option to another window

    Solved
    4
    0 Votes
    4 Posts
    876 Views
    mrjjM
    Hi Super you found the "Goto slot" feature. One note about that one. Its based on automatic match up using the widget name so after you used "goto slot" you should not rename the actionRules_Home as then it fails to auto connect. Nor should you rename the on_actionRules_Home_triggered function. The better solution is to use connect to do it manually as then you can get compile errors in case you renamed something. That said - for a small app with a few menu items, the auto connect is fine but in a multiple person project with an app having tons of menus and buttons, the auto connect is just too fragile in real life. At least thats my experience.
  • Shortcuts problem in migration from QX11EmbedContainer to QWidget.createWindowContainer

    Unsolved
    2
    0 Votes
    2 Posts
    517 Views
    D
    It looks that could be easily achieved using GTK3, so the best solution is to migrate from Qt4 to GTK3 when QX11EmbedContainer is used ? import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk from subprocess import Popen seat = Gdk.Display.get_default().get_default_seat() def plugged_added(plugged_socket): Gdk.Seat.grab(seat, plugged_socket.get_window(), Gdk.SeatCapabilities.KEYBOARD, True) print("xterm attached") def plugged_removed(plugged_socket): Gdk.Seat.ungrab(seat) print("xterm detached") window = Gtk.Window(title="Xterm embed") socket = Gtk.Socket() window.add(socket) sock_id = str(socket.get_id()) socket.connect("plug-added", plugged_added) socket.connect("plug-removed", plugged_removed) cmd = ['/usr/bin/xfreerdp', "/v:someHost", "/u:someUser", "/p:somePassword", "/parent-window:{}".format(sock_id)] Popen(cmd) socket.show() window.show() window.connect("destroy", Gtk.main_quit) Gtk.main()
  • How to correctly pass QObject on a struct to GstPadProbe through gpointer user_data

    Unsolved
    2
    0 Votes
    2 Posts
    222 Views
    Christian EhrlicherC
    I would guess 'd' is no longer alive once src_pad_buffer_probe() is called.
  • 0 Votes
    3 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, Glad you found a solution and thanks for sharing ! One thing you can do is to take a look at the release logs to see what has changed. However from your description you may have found a regression. Did you already check the bug report system ?
  • QWidget / QML for a Vulkan application ? What to use ?

    Unsolved
    2
    0 Votes
    2 Posts
    256 Views
    SGaistS
    Hi, Well it depends a bit on what you are going to implement. Can you give more details ? As for Vulkan, there have been several blog post recently on the Qt website, this should give you some ideas about what you can achieve with it.
  • 0 Votes
    2 Posts
    112 Views
    SGaistS
    Hi, You have to give more details about what you are using. What is a plotable ? What technology are you using ? What version of Qt ?
  • QDnsLookup : suspiciously high failure rate

    Unsolved
    8
    0 Votes
    8 Posts
    956 Views
    SGaistS
    As @Kent-Dorfman already wrote, it's not unlikely that you get denied. Running stress test against servers without any form of agreement will likely be seen as a DOS attempt.
  • QTest fails to compile when in QCOMPARE use classes under some namespace

    Solved
    5
    0 Votes
    5 Posts
    396 Views
    RonaldViscarraLR
    I solved by wrapping the definition of operator == into std namespace namespace std { bool operator==(const MyNamespace::MyClass class1, const MyNamespace::MyClass class2) { return (class1.a == class2.a); } }
  • How visualize output in "application output" panel?

    Unsolved
    7
    0 Votes
    7 Posts
    5k Views
    B
    @ratzz Solved, thank you!
  • Disable specific warning in Qt Creator

    Solved
    4
    0 Votes
    4 Posts
    8k Views
    C
    It looks like you can construct a -Wno-... parameter even if it's not mentioned in https://clang.llvm.org/docs/DiagnosticsReference.html You can try to add -Wno-switch-enum in your specific case.
  • QTableView resize row to contents to much space

    Solved
    12
    0 Votes
    12 Posts
    6k Views
    Christian EhrlicherC
    @sandro4912 said in QTableView resize row to contents to much space: However in your statement seems to be a typo It's the forum software, the blue this is '[ this ]'
  • I am getting an error QIODevice::read (QUdpSocket): device not open

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    Christian EhrlicherC
    QUdpSocket receives datagrams which should be read with QUdpSocket::readDatagram(): https://doc.qt.io/qt-5/qudpsocket.html#details