Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Open file in uwp app

    Unsolved
    5
    0 Votes
    5 Posts
    745 Views
    R
    @jsulm Thank you! I used the qstandartpaths class and it succeed!
  • QML app deployment with MSVC

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    B
    Guys, dirty deployment works... I will now start the Final deployment (Cleaned up) steps. Thanks for help. I am a bit dissapointed that it came to this but at least it works :P.
  • 1 Votes
    7 Posts
    2k Views
    jsulmJ
    @harveyab Everything bellow QScrollarea is repeated as often as needed. It really depends on your use case. If you want to have exact answer then you have to ask a precise question.
  • Why doesn't QApplication offer a function mainWindow() ?

    Solved
    7
    0 Votes
    7 Posts
    4k Views
    J.HilkJ
    @Joachim-W here's a simple c++ adaptation of @JonB function, int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); const QWidgetList &list = QApplication::topLevelWidgets(); for(QWidget * w : list){ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(w); if(mainWindow) qDebug() << "MainWindow found" << w; } return a.exec(); }
  • 0 Votes
    3 Posts
    869 Views
    cerrC
    @jsulm Excellent! Thank you my friend!
  • Can I combine QExplicitlySharedDataPointer and QObject?

    Unsolved
    4
    0 Votes
    4 Posts
    358 Views
    jsulmJ
    @kitfox said in Can I combine QExplicitlySharedDataPointer and QObject?: However, I can't turn Employee into a QObject either since it will go out of scope almost as soon as I've finished using it. I don't get it: why do you think you can't nake Employee a QObject? How is going out of scope related to base class?
  • How to set linker flags

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    jsulmJ
    @A123 said in How to set linker flags: While trying to run a program on a remote server What OS is running on that server and what platform (x86, ARM,...) is it? And what is running on your development machine? You can find all qmake (it is not QtCreator involved here) variables here: https://doc.qt.io/qt-5/qmake-variable-reference.html
  • How i embed an external window inside an PyQt5 Application?

    Unsolved
    1
    0 Votes
    1 Posts
    323 Views
    No one has replied
  • why dose have one pixel between the scrollbar and the TreeView in qml?

    Unsolved
    1
    0 Votes
    1 Posts
    173 Views
    No one has replied
  • QByteArray toInt doesnt work

    Unsolved
    5
    0 Votes
    5 Posts
    627 Views
    JKSHJ
    @BartoszT said in QByteArray toInt doesnt work: So, why toInt doesnt watn to work whit this 4byte QByteArray? Because your byte array does not contain ASCII text that represents an integer. See https://doc.qt.io/qt-5/qbytearray.html#toInt for an example on how to use QByteArray::toInt(). If you want to interpret 4 bytes as a 32-bit integer, use a reinterpret_cast: int i = *reinterpret_cast<const int*>(myArray.constData());
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • QStringList in QML?

    Solved
    15
    0 Votes
    15 Posts
    18k Views
    M
    Update: <smacks own forehead> QStringList moduleFinder::getIo(QString myModule) { int lines = ioList.length(); QString moduleId = myModule; for (int i=0;i<lines;i++) { if (ioList.at(i).contains(moduleId)) { index = i; } } newIndex = index + 32; m_moduleIo.clear(); //<- RESET BEFORE EACH TIME THROUGH for (int y=index+1; y<newIndex+1; ++y) { m_moduleIo << ioList.at(y); qDebug() << "io List" << ioList.at(y); } emit moduleIoChanged(m_moduleIo); return m_moduleIo; } It all works as I hoped now.
  • QWebView problem

    Solved
    3
    0 Votes
    3 Posts
    351 Views
    R
    thanks for reply
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • Using TextInput to toggle the virtualKeyboard

    Unsolved
    1
    0 Votes
    1 Posts
    152 Views
    No one has replied
  • [SOLVED] QGraphicsView and scale

    7
    0 Votes
    7 Posts
    12k Views
    S
    I know this topic is quite old, but I want to update the solution. I used the solution from dakron but got weird behavior sometimes. m11 for x and m22 for y works only if the view has no rotation applied. If the view is rotated the returned values will be wrong. You can calculate the x scale with 'sqrt(trf.m11() * trf.m11() + trf.m12() * trf.m12())' (pythagoras, where trf is the QTransform) and y with 'sqrt(trf.m21() * trf.m21() + trf.m22() * trf.m22())'.
  • How to add a simple directory

    Solved
    8
    0 Votes
    8 Posts
    702 Views
    R
    @SGaist It was a permissions problem, sorry to bother you.
  • Required XCB version

    Unsolved
    10
    0 Votes
    10 Posts
    5k Views
    SGaistS
    @jverdicchio said in Required XCB version: It appears that configure seems to remember too much Once it is done, the configure script shows a warning message stating that you shall cleanup before calling it again in the same folder.
  • QDialog Window Close Button and QDialog->close() have different behavior

    Unsolved
    9
    0 Votes
    9 Posts
    7k Views
    J
    @JB-Tristant said in QDialog Window Close Button and QDialog->close() have different behavior: @J.Hilk said in QDialog Window Close Button and QDialog->close() have different behavior: Hi @JB-Tristant and if you change your close event from the default implementation to the following void MyDialog::closeEvent(QCloseEvent *event) { qDebug() << "MyDialog::closeEvent called"; event->ignore(); hide(); } I dig into your idea and have solved with this : void MyDialog::closeEvent(QCloseEvent *event) { event->accept(); QDialog::closeEvent(event); } I still cannot understand the issue "under the hood". The bug has disappeared on Windows (git checkout -> clean, rebuild) but remain the same on Linux, even with the last quick & dirty hack...
  • QListWidgetItem removal does not work for the last element

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    JonBJ
    @BartoszT Yes, well (with the check line commented out) going TachoList.at(-1) is going to be the source of your ""Invalid parameter passed to C runtime function" and program crashes" problem! @Christian-Ehrlicher has said currentRow can indeed be -1, so it's your responsibility to deal with that in whatever code you add. Which is why I originally wondered whether you had code elsewhere relying on there being at least one selected item :)