Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
850 Topics 3.3k Posts
  • 0 Votes
    1 Posts
    922 Views
    No one has replied
  • Stylesheets and sizeFromContents

    Unsolved
    2
    0 Votes
    2 Posts
    913 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
    571 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
    903 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
    979 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.

  • 0 Votes
    9 Posts
    2k Views
    JKSHJ

    @jihong said:

    I Can't get GB18030 for " availableCodecs " in custorm't cmputer,

    Try Qt 5.

  • using shiboken to wrap non-QObject classes

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS

    You're welcome !

    Since everything is ok, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

    Also, while browsing the forum, consider up-voting answers that helped you. That will make them easier to find for other people :)

  • Application stalls with query/table models in PyQt5

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    M

    Sorry, I've been pretty busy these days and looks like I'll be for a while, I'll get to it whenever I get some free time. Also, I've run into another problem, this time with the QtPrintSupport module, what it prints using Qt5 is completely different to what it prints in Qt4, among other things it completely ignores the margins settings, but right now I can't get to it. Thanks anyway!