Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.7k Posts
  • Debugging Java-Files

    Unsolved
    3
    0 Votes
    3 Posts
    979 Views
    L
    I suppose that you are creating an Android app. First, you need to create a project for Android Studio. To do it, simply go to Projects \ Build Settings \ Build Android APK and press the "Create Templates" button on Android section: [image: 88f95246-cfe8-40aa-9320-91b07c5a7a93.PNG] Open the generated project with Android Studio. Put breakpoints on the JAVA code. On Android Studio exists an option for attach to a running app. Debug the app with Qt Creator and attach Android Studio to the app. After attach it, when the cpp code calls the JAVA code, Android Studio stops on the breakpoints.
  • 0 Votes
    5 Posts
    767 Views
    A
    Just to be sure test application available here: https://drive.google.com/open?id=16igl74anxWOmiqHrJgnelkIxaMrQMvdC
  • How to create a folder and write a file in it, using the UNC Path

    Solved qtcore network share
    9
    0 Votes
    9 Posts
    5k Views
    chaithubkC
    @JonB Yeah I had an issue with QStorageInfo() so I am using GetFreeDiskSpaceEx() to calculate the available space.
  • Signals and Slots, update from old to new nomenclature

    Solved
    5
    0 Votes
    5 Posts
    762 Views
    J
    @JKSH Thank you
  • How to get a string's translation with the context ignored?

    Unsolved
    3
    0 Votes
    3 Posts
    405 Views
    V
    Hm, okay. I'll try sand see if the mailing list has any ideas :)
  • formatting a QTableView header

    Unsolved
    41
    0 Votes
    41 Posts
    31k Views
    mzimmersM
    Ah, I see (I think). Well, the upshot is that I can remove all of my stylesheet settings. The use of the Fusion style gave me the desired look: [image: bf015da1-bd08-4ac6-a1d6-b36c62f5e9d4.PNG] Which is fortunate, because this attempt at stylesheet setting didn't work: ui->tableView->horizontalHeader()->setStyleSheet("border-bottom: 5px solid red"); Not sure why (the red background worked).
  • Automatically accept choice of QComboBox in a QStyledItemDelegate

    Solved
    7
    0 Votes
    7 Posts
    918 Views
    gde23G
    Thanks a lot. Your solutions work perfectly (both of them). I've further changed the combeChanegd() signal to a slot that further emits a closeEditor() signal. void MyDelegate::comboChanged(QWidget *editor) { emit commitData(editor); emit closeEditor(editor, QAbstractItemDelegate::NoHint); } That way the delegate is directly closed after a selection was made.
  • Signal emitted in paintEvent stops drawing

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    O
    @JonB MyCanvas is a UI Widget that I have promoted. Simply that. The full code (that works) is posted below; note that is only one update(). It fails when the emit is moved before the first declaration of QPainter. class MyCanvas : public QWidget { Q_OBJECT public: explicit MyCanvas(QWidget *parent = nullptr); void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); qreal drawableAreaAspectRatio; QPointF drawableAreaCenter; qreal drawableAreaHeight; qreal drawableAreaWidth; qreal drawableAspectRatio{1.0}; QRectF drawableAreaRectangle; signals: void message(QString st); public slots: void newAspectRatio(qreal ar); }; MyCanvas::MyCanvas(QWidget *parent) : QWidget(parent) { } void MyCanvas::paintEvent(QPaintEvent *e) { QPainter p(this); QString st; p.drawRect(drawableAreaRectangle); p.setPen(Qt::red); if (drawableAspectRatio < drawableAreaAspectRatio){ st.append("Height Constrained "); qreal widthDelta = drawableAreaHeight * drawableAspectRatio; qreal wd = widthDelta * 0.5; qreal cx = drawableAreaCenter.rx(); p.drawRect(int(cx - wd), 20, int(wd + wd), int(drawableAreaHeight)); }else{ st.append("Width Constrained "); qreal heightDelta = drawableAreaHeight / drawableAspectRatio; qreal hd = (heightDelta * 0.5); qreal w = drawableAreaWidth; qreal cy = drawableAreaCenter.ry(); p.drawRect(20.0, int(cy - hd), int(w), int(hd + hd)); } p.end(); st.append("AspectRatios Canvas = "); st.append(QString::number(drawableAreaAspectRatio)); st.append(" Rectangle = "); st.append(QString::number(drawableAspectRatio)); emit message(st); } void MyCanvas::resizeEvent(QResizeEvent *e) { drawableAreaRectangle = QRectF(this->rect()); drawableAreaAspectRatio = drawableAreaRectangle.width()/drawableAreaRectangle.height(); drawableAreaRectangle.adjust(20.0, 20.0, -20.0, -20.0); drawableAreaCenter = drawableAreaRectangle.center(); drawableAreaHeight = drawableAreaRectangle.height(); drawableAreaWidth = drawableAreaRectangle.width(); } void MyCanvas::newAspectRatio(qreal ar) { drawableAspectRatio = ar; this->update(); }
  • Problem with fresh install of Qt Creator...

    Unsolved
    3
    0 Votes
    3 Posts
    499 Views
    JKSHJ
    @mrjj said in Problem with fresh install of Qt Creator...: Hi and welcome to the forums Often this goes away with sudo apt-get install mesa-common-dev https://wiki.qt.io/Install_Qt_5_on_Ubuntu The official docs also has instructions for a few different distros: http://doc.qt.io/qt-5/linux.html#requirements-for-development-host
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • QT App error after device sleep.

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    S
    Re: QT App error after device sleep. Hi, Thanks for all reply. I can not check origin the crash because of library from finger print vendor was complied. can't edit or see source code in file. But i solving problem by use shell script loop check when QT process closed then re open program again.
  • adjust line spacing and/or leading

    Unsolved
    7
    0 Votes
    7 Posts
    4k Views
    QT-static-prgmQ
    I checked the metric from that font and it says char width 2, heigh 4 for each char, linespace 4 and leading 0. So i guess it's my font. And for the label it works. it's just different for the pdf
  • webrtc

    Unsolved
    5
    0 Votes
    5 Posts
    971 Views
    S
    how to open chrome web page in Q widget or audio video chat in Qt .for that purpose i want to use webrtc.
  • QCombobox css bug??

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @minjunkim said in QCombobox css bug??: Maybe you can use below to help ... Is the intention of your question correct? Sorry, I don't understand. It is not I who needs help, it is you who are asking the question. I was just giving you some hints.
  • how can I set qdialog parent with another process(x11 based)'s main window

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    JonBJ
    @java9d I know nothing about "transient parent". When I set QDialog parent with main window in identical process, the problem is still here: Yes, as I said, it seems to be the behaviour of GNOME (at least by default) that dragging a dialog drags its parent/main window with it.
  • comboBox->additem() crash application..

    Solved
    27
    0 Votes
    27 Posts
    5k Views
    TheCipo76T
    @JonB because i think the problem is not there.. arg1 was not used.. it's a blanking form slot.. void inserisciarticolo::on_comboBox_Cliente_currentTextChanged(const QString &arg1) { if (AzzeraI == true) { for (int i=0;i<10;i++) { array_Codice[i]->setText(""); array_Descrizione[i]->setText(""); array_Qta[i]->setValue(0); array_Origine[i]->setCurrentText(""); array_Fornitore[i]->setCurrentText(""); } } } You're right!! The problem was "AzzeraI" var.. i set it to false on dialog loading and all works! Thanks to all
  • QDockWidget problem with focus when undocked

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    gde23G
    On Widows it's also Qt 5.11 which is the same as on the Debian machine (also installed over the Qt-Installer)
  • Question about QCursor constructor

    Unsolved
    4
    0 Votes
    4 Posts
    569 Views
    Christian EhrlicherC
    @lniwn said in Question about QCursor constructor: if (!bmm.isNull()) { I would guess the '!' is wrong here. Please create a bug report and post the bug number here. Thx.
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    313 Views
  • Disable QSlider's valueChanged on keyboard arrow keys

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    S
    @dheerendra Yes..I'll try with EventFilter