Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
853 Topics 3.3k Posts
  • dynamicly access ui-elements

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    AdmiralCrunchA

    Thank you :)

    it took me a while, until I finally got it working :)

    int i = 0; foreach(const QString &str, patternSlices) { i++; QString labelName = QString("step_%1").arg(i); QLabel* label = findChild<QLabel*>(labelName); if(label) { label->setPixmap(otherStep.scaled(100,100, Qt::KeepAspectRatio)); } }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • python text editor widget for Qt

    Moved Solved
    3
    0 Votes
    3 Posts
    1k Views
    GofferG

    @alex_malyu

    Oh wow ! that's amazing ! I will take a look today. Thank you very much !

  • 0 Votes
    1 Posts
    940 Views
    No one has replied
  • Stylesheets and sizeFromContents

    Unsolved
    2
    0 Votes
    2 Posts
    933 Views
    E

    I'm not sure if this is going to fix your problem, but I think things like min-width, max-width, etc are supposed to end with px such as 65px; and 200px;. Also, you might want to post this in the General Desktop category. You posted this in Language Bindings which gets a lot less views than General Desktop. But you aren't using PyQt, PySide, etc.

  • 0 Votes
    1 Posts
    578 Views
    No one has replied
  • 0 Votes
    5 Posts
    3k Views
    L

    Here is my code. I fill my QTableWidget by taking all the values of the attributes of each element of my model (a temperatureStep). The first column should assume the values "Hold" or "Heat up", this is the reason why I use a QComboBox (extendend, in order to recognise which temperatureStep I have to modify when the value of the QComboBox changes).

    private void showTemperatureCurve() { List<TemperatureStep> temperatureCurve = MainWindowModel.getOven().getTemperatureCurve(); ui.twTemperatureCurve.blockSignals(true); int j = 0; ui.twTemperatureCurve.setRowCount(0); for (TemperatureStep temperatureStep : temperatureCurve) { ui.twTemperatureCurve.setRowCount(ui.twTemperatureCurve.rowCount() + 1); List<String> attributes = new ArrayList<>(); List<Object> values = new ArrayList<>(); for (PropertyDescriptor propertyDescriptor : Introspector.getBeanInfo(temperatureStep.getClass(), Object.class).getPropertyDescriptors()) { attributes.add(propertyDescriptor.getDisplayName()); //System.out.println(propertyDescriptor.getReadMethod()); } for (String attribute : attributes) { Object value = BeanUtils.getProperty(temperatureStep, attribute); values.add(value); //System.out.println(attribute + " " + value.toString()); } List<String> headerLabelsTemperatureCurveNU = Arrays.asList("stepType", "endTemperature", "maxSlope", "minTime"); for (int i = 0; i < attributes.size(); i++) { ui.twTemperatureCurve.setItem(j, headerLabelsTemperatureCurveNU.indexOf(attributes.get(i)), new QTableWidgetItem(values.get(i).toString())); } j += 1; } ui.twTemperatureCurve.blockSignals(false); for (int i = 0; i < temperatureCurve.size(); i++) { QComboBoxExtended qcbTemperatureStep = new QComboBoxExtended(); qcbTemperatureStep.setIndex(i); String currentTemperatureStepType = temperatureCurve.get(i).getStepType(); qcbTemperatureStep.addItem(currentTemperatureStepType); if (currentTemperatureStepType.equals("Heat up")) { qcbTemperatureStep.addItem("Hold"); } else { qcbTemperatureStep.addItem("Heat up"); } ui.twTemperatureCurve.setCellWidget(i, 0, qcbTemperatureStep); qcbTemperatureStep.currentIndexChanged.connect(this, "actionQcbTemperatureStep_itemChanged()"); } ui.twTemperatureCurve.resizeColumnsToContents(); } public static int qcbTemperatureStepClickedIndex; private void actionQcbTemperatureStep_itemChanged() { TemperatureStep temperatureStep = MainWindowModel.getOven().getTemperatureCurve().get(qcbTemperatureStepClickedIndex); if (temperatureStep.getStepType().equals("Hold")) { temperatureStep.setStepType("Heat up"); } else { temperatureStep.setStepType("Hold"); } showTemperatureCurve(); }
  • Is it possible to conect table widgets?

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    ReavegenR

    cool thank you
    this looks great

  • [SOLVED]Qt with JAVA

    Solved
    14
    0 Votes
    14 Posts
    9k Views
    Ni.SumiN

    Hi @Tejas-Virpariya ,

    Marking "solved" can be done from the option at the right bottom , you can see the "Topic Tools" and there opt for "Marked Solved ".

  • import python code in qt

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    jsulmJ

    So, you want to write Python code which uses Qt? Or do you want to mix C++ and Python code? It is really not clear what you mean with "import python code". Access Python code from a C++ Qt UI application?
    If you want to write Python code which uses Qt take a look at PyQt: https://riverbankcomputing.com/software/pyqt/intro

  • [SOLVED]Qt Jambi

    11
    0 Votes
    11 Posts
    4k Views
    ?

    Keep in mind that Qt 4 has reached its end of life last december.

  • QT application linking with .net ?

    Unsolved
    2
    0 Votes
    2 Posts
    920 Views
    jsulmJ

    I don't think this is easy or even possible. C++ applications are compiled to native binary code (running directly on the CPU), .Net applications are compiled to intermediate code which then is translated to native binary code during runtime by the .Net Common Language Runtime (CLR) - same concept as Java. So, a native application cannot access .Net DLLs directly. It is possible to use native binaries (like DLLs using Qt) from a .Net application.

  • PyQt5 & QDialog Mouse Focus

    Unsolved
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    SGaistS

    Here you have lots of examples. The Main Window Example call Application shows how to re-implement closeEvent

  • About Qt Jambi 4.8.6 on Mac with Eclipse

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    A

    I choose to start my project by using Java, cause it was my core language and i found and "thought" all the stuff support Java. And actually I didn't plan to use Qt at the beginning....

  • Parent in PyQt5 with QML

    Solved
    2
    0 Votes
    2 Posts
    2k Views
    kshegunovK

    Hello,
    Well it's says there in the question. Don't pass a QWindow to the QFileDialog::getOpenFileName function. A window is not a widget and it expects QWidget. You could just use NULL (or whatever its equivalent in python is).

    Kind regards.

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • 0 Votes
    7 Posts
    12k Views
    D

    Sorry for hijacking this post. But I really need some help
    This is the code which I use to control my .ui file

    So there is this TextEdit field which by Default shows "Enter your email" but it must go blank when the user clicks on it.
    I am not able to understand how to incorporate the above code.
    Please help!

    import sys from PyQt4 import QtCore, QtGui, uic from Email import encrypt_email from Email import decrypt_email qtCreatorFile = "rsegui.ui" # Enter file here. Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile) class MyApp(QtGui.QMainWindow, Ui_MainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.encrypt_and_send.clicked.connect(self.EncryptEmail) self.decrypt.clicked.connect(self.DecryptEmail) def focusInEvent(self, event): self.clear() QTextEdit.focusInEvent(self, event) def newuser_cleartext(self): self.newuser.clear() def EncryptEmail(self): user=str(self.newuser.toPlainText()) sender = str(self.sender.toPlainText()) receiver = str(self.receiver.toPlainText()) receivers = receiver.split(';') subject = str(self.subject.toPlainText()) message = str(self.message.toPlainText()) password = str(self.password.toPlainText()) encrypt_email(user,sender,receivers,subject,message,password) def DecryptEmail(self): email = str(self.sender_2.toPlainText()) message = str(self.message_2.toPlainText()) self.decrypted.setText(decrypt_email(email,message)) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) window = MyApp() window.show() sys.exit(app.exec_())
  • Problems using QtMultimedia with QtRuby

    Unsolved
    4
    0 Votes
    4 Posts
    989 Views
    SGaistS

    Asking a mod is the usual way :)

    Done :)

  • Qt Jambi com.trolltech.qt.webkit (Java)

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi and welcome to devnet,

    I'd recommend contact the QtJambi team through qtjambi.org. You're more likely to find answer there as there might not be many people here having used QtJambi.