Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Opening files on Windows using std::ifstream and filename provided by QFileDialog

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    R
    @J-Hilk Thank you. Fortunately, this is a source-code library, so no DLL to worry about. There might be an equivalent function taking a memory buffer I could use, in which case I could let QFile open the file, as suggested by @Christian-Ehrlicher. Otherwise, copying the file to a non-Unicode path seems to be the only way.
  • Move QWebEngineview from off-screen desktop will be lagged

    Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied
  • how to use the default app to send emails but without having to open it

    Unsolved
    9
    0 Votes
    9 Posts
    535 Views
    S
    @SGaist Yes I'm using c++, do you have any examples of how I can use this library for this case?
  • Question about QThread with more than one QObject

    Solved
    4
    0 Votes
    4 Posts
    255 Views
    KroMignonK
    @Mihan said in Question about QThread with more than one QObject: I thought there was only one-to-one correspondence. This would be very strange, all GUI items have to be in main thread. How should that be possible if each instance would need a specific thread!
  • Manage translations with CMake

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    A
    Thank you for your help. Calling lupdate form time to time is OK. I've updated repository with working code and more suitable name: https://github.com/pozemka/cmake-qt-translation-example
  • QXmlStreamWriter ignores default namespace for attributes?

    Unsolved
    1
    0 Votes
    1 Posts
    131 Views
    No one has replied
  • Can't see .xml file from build directory

    Solved qfile xml console app xml parsing
    6
    0 Votes
    6 Posts
    1k Views
    BeaverShallBurnB
    @sierdzio, false alarm! After reopening my project everything got built and no file existance errors were present. Your hint about adding QCoreApplication really helped!
  • how stop the "QPixmap: Must construct a QGuiApplication before a QPixmap" in a dll

    Unsolved
    12
    0 Votes
    12 Posts
    4k Views
    Christian EhrlicherC
    Again: use a debugger and QT_FATAL_WARNINGS as described e.g. here to see which QPixmap triggers your error!
  • Image showing in QLabel

    Unsolved qlabel qpixmap
    4
    0 Votes
    4 Posts
    1k Views
    Christian EhrlicherC
    @Sai-Raul said in Image showing in QLabel: Already tried that And what was the outcome? Please update your code accordingly.
  • A bug was found when calling qApp->quit()

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    P
    @kshegunov I found the problem, as you said, the local event loop is run before the global one(QMessageBox::info() is called in constructor),but why? Where can I explain?
  • Accessing promoted widgets created with ui designer

    Unsolved
    2
    0 Votes
    2 Posts
    213 Views
    eyllanescE
    @Q139 Use ui->nameOfPromotedWidget
  • Retrieving database records and displaying in Qtablewidget (Python)

    Unsolved
    4
    0 Votes
    4 Posts
    740 Views
    C
    @mrjj @SGaist @jsulm Having been able to achieve some steps, can you help me here: def appendSelection(self): try: rows = {index.row() for index in self.tab.selectionModel().selectedIndexes()} lines = [] itemList = [] itemList.append(self.fname) itemList.append(self.pixpath) itemList.append(self.passlb) itemList.append(self.datetx) for row in rows: for col in range(self.tab.columnCount()): itemArray = self.tab.item(row, col) text = "" if itemArray is None else itemArray.text() if (col == 0): itemList[0].setText(text) if (col == 1): itemList[1].setText(text) if (col == 2): itemList[2].setText(text) if (col == 3): itemList[3].setText(text) Column 2 is the image column. I want to append it to a qpixmap inside a formlayout. The qpixmap in the formlayout is self.passlb. it is a QLabel. So how do I append it just like other data (text) get appended to form qLineEdits. I tried: if (col == 2): itemList[2].setPixmap() But it didn't work. Kindly help with the right line of code.
  • MOC files not be generated

    Unsolved
    2
    0 Votes
    2 Posts
    241 Views
    SGaistS
    Hi and welcome to devnet, Are you sure it's Qt 4.0 ? Which version of cmake are you using ?
  • Customise border radius of QTableView row selection

    Unsolved qtableview
    7
    0 Votes
    7 Posts
    2k Views
    SGaistS
    Hi, You have the model index, so if it's the left most one, draw the left round corners and if it's the right most one, draw the right rounded corner. The other option is to use one delegate for the first and last column to do the special painting. Note that this is not the correct solution if your users can reorder the columns.
  • MySql plugin not working for release version of a project

    Solved
    11
    0 Votes
    11 Posts
    650 Views
    SGaistS
    Tricky one ! Glad you found out and thanks for sharing :-)
  • How to perform an action at the end of a QTableView drag-and-drop operation?

    Unsolved
    5
    0 Votes
    5 Posts
    795 Views
    R
    @JonB But that's the thing, at the end of dropEvent it seems like the drag-and-drop operators are not yet completed (things like removing rows and so on happen after we exit it). So that's going to take some unspecified time t and we must set the timer to an interval that is guaranteed to be greater than t. If we guess too low, we run the risk of running the action on an inconsistent state, so we must guess high and that may introduce a bit of a delay. Also, does timer use application-time, or wall time? If wall time, then we would not guarantee correctness because in principle the OS may interrupt the application after dropEvent exits but before drag-and-drop is over, and when we resume it the time hits and we run it on an inconsistent state. Anyway, this is all pretty academic, I think in practice your solution would work well.
  • how to set full screen on mainwindown or use scroll area, cant see all elements

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    Pl45m4P
    @Lightshadown Because you dont have any layout, it doesn't resize properly. Assign a layout to all container where you now can see the red crossed circle. Then everything will work and resize as expected. To achieve the design you have currently, you probably need multiple cascading layouts.
  • Building Adapter for QT Quick Application Fails on QT 5.12 Offline Installation

    Unsolved
    1
    0 Votes
    1 Posts
    187 Views
    No one has replied
  • Dynamic Widget Translation in QTabWidget

    Unsolved
    3
    0 Votes
    3 Posts
    270 Views
    artwawA
    @Creatorczyk Like @mrjj's question suggests only designer elements are translated (to be precise - those from UI file that qmake knows of when generates ui header file). My solution to dynamically (in code) created actions/elements is to add tr() calls to changeEvent(). Works every time.
  • Select an element on a QPushButton click

    Solved
    3
    0 Votes
    3 Posts
    281 Views
    S
    Hi @JonB, yes, that worked perfectly. Thanks for solving this :D