Skip to content

Brainstorm

Stuck? Some ideas just need to be dumped on someone before they can materialize.
440 Topics 3.2k Posts
  • [5.5.1] QVariant Support for Long Double

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    Chris KawaC

    QVariant supports any type of data. You don't need to modify the class. You just need to register your type.

    In some header register the type:

    Q_DECLARE_METATYPE(long double)

    and then you can use it:

    long double foo = 42.0; QVariant bar = QVariant::fromValue(foo); //put value into variant long double bazz = bar.value<long double>(); //and get it back

    If you also want to serialize/deserialize your variants you'll need to implement and register stream operators for it: qRegisterMetaTypeStreamOperators().

  • 0 Votes
    1 Posts
    775 Views
    No one has replied
  • Recover source after power cut

    Moved Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    tomyT

    @koahnig
    No, after pressing ctrl +s I worked for a little while and then power was cut. Thanks.
    I also check that folder. There is My_First_Calculator with cpp extension but not any other extensions.
    Maybe it's gone!

    https://pictub.club/image/se9WOY

  • 0 Votes
    3 Posts
    1k Views
    Q

    Hello, this is ProgramBase2 (I forgot my login credentials for my previous account) - sorry.

    Can anyone help me out with this problem? I forgot to mention what I'm looking for.

    Can anyone please direct me to a tutorial or a book that instructs how to achieve the goals I posted?
    Please do not direct me to a existing code project, I am not interested in the finished product. I am interested in how the person got to the finished product.
    Also, please do not direct me to a basic tutorial. I am looking for something advanced (maybe solemn done in Qt before). I've seen it work in other MDI programs, so I know it can be done.

    Thanks again (I'll remember my credentials this time).

  • How to deal with Dynamic data entry? how to work with this!

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    ?

    @raven-worx can you help how to get data in QLineEdit going to my database by Clicking Submit button? here is my code i am using python 2.17.13

    import os
    import sys
    import mysql.connector
    from PyQt4.QtSql import *
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *
    from PyQt4 import QtGui, QtCore

    class Window(QtGui.QMainWindow):
    def init(self):
    super(Window, self).init()
    self.setGeometry(50,50,0,0)
    self.setFixedSize(900,600)
    self.setWindowTitle("IMS Delta EarthMoving")
    self.setWindowIcon(QtGui.QIcon('delta.png'))
    pic = QtGui.QLabel(self)
    pic.setGeometry(240, -165, 698, 500)
    pic.setPixmap(QtGui.QPixmap(os.getcwd() + "/delta2.png"))

    self.Input() self.search() self.button() self.database() def search(self): assetSearch = QLabel("Asset search",self) assetSearch.move(10,10) AssetTag=QLineEdit(self) fbox=QFormLayout() fbox.addRow(AssetTag) AssetTag.move(75,15)#left-right and up-down AssetTag.resize(150,20) def Input(self): INPUT1LABEL = QLabel("INPUT1",self) INPUT1LABEL.move(10,225) INPUT1 = QLineEdit(self) fbox=QFormLayout() fbox.addRow(INPUT1) INPUT1.move(75,230) INPUT1.resize(150,20) btnSubmit = QtGui.QPushButton("Submit",self) btnSubmit.clicked.connect(self.submit_function) btnSubmit.resize(btnSubmit.minimumSizeHint()) btnSubmit.move(150,470) def button(self): btnQuit = QtGui.QPushButton("Quit", self) btnQuit.clicked.connect(self.close_application) btnQuit.resize(btnQuit.minimumSizeHint()) btnQuit.move(150,138) #.move(left-right,top-bottom() btnSearch = QtGui.QPushButton("Search", self) #btnSearch.clicked.connect(self.) #add function for this ButtonBox btnSearch.resize(btnSearch.minimumSizeHint()) btnSearch.move(150,40) btnUpdate = QtGui.QPushButton("Update",self) btnUpdate.clicked.connect(self.update_confirmation) btnUpdate.resize(btnUpdate.minimumSizeHint()) btnUpdate.move(150,90) btnDelete = QtGui.QPushButton("Delete",self) #btnDelete.clicked.connect(self.) add function for this ButtonBox btnDelete.resize(btnDelete.minimumSizeHint()) btnDelete.move(150,114) self.show() def close_application(self): choice = QtGui.QMessageBox.question(self, 'Exit',"Are you sure?",QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if choice == QtGui.QMessageBox.Yes: sys.exit() else: pass def update_confirmation(self): choice = QtGui.QMessageBox.question(self,'Notice!',"Are you sure?",QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if choice == QtGui.QMessageBox.Yes: #put the function here! choice = QtGui.QMessageBox.question(self,'IMS',"Query saved",QtGui.QMessageBox.Ok) if choice == QtGui.QMessageBox.Ok: pass else: pass def submit_function(self): con = mysql.connector.connect(user="root",password="admingelo",host="localhost",database="test") manager = con.cursor() Date = 'Ai' Name = 'g' Sex = 'g' insert_this_data = ("INSERT INTO test_table(name,age,sex) VALUES(%s,%s,%s)") data = (Date,Name,Sex) manager.execute(insert_this_data,data) con.commit() print "Insert Successful!" def database(self): #Table data view table = QTableWidget(self) db = QSqlDatabase.addDatabase("QMYSQL") db.setHostName("localhost") db.setDatabaseName("test") db.setUserName("root") db.setPassword("admingelo") if (db.open()==False): QMessageBox.critical(None, "Database Error", db.lastError().text()) query = QSqlQuery ("SELECT * FROM sfo") table.setColumnCount(query.record().count()) table.setRowCount(query.size()) index=0 while (query.next()): table.setItem(index,0,QTableWidgetItem(query.value(0).toString())) table.setItem(index,1,QTableWidgetItem(query.value(1).toString())) table.setItem(index,2,QTableWidgetItem(query.value(2).toString())) table.setItem(index,3,QTableWidgetItem(query.value(3).toString())) table.setItem(index,4,QTableWidgetItem(query.value(4).toString())) table.setItem(index,5,QTableWidgetItem(query.value(5).toString())) index = index+1 table.show() table.resize(618,360) table.move(240,230)

    def run():
    app = QtGui.QApplication(sys.argv)
    GUI = Window()
    sys.exit(app.exec_())

    run()

  • Custom window with Qt

    Moved Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    C

    @VRonin Thank you so much İ was loking for that for 63 days <3

  • QPainter performance

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    A

    @Konstantin-Tokarev said in QPainter performance:

    "1000x" thing may only be relevant for building scenes out of very many QWidgets. In this case QGraphicsView/QGraphicsScene may be orders of magnitude more efficient.

    Yea I did make that assumption that he was building a complex scene since I have never had a performance issue with QPainter before, even in mildly complex scenes. Also 1000x was definitely hyperbole as it wouldn't realistically be anywhere near that. ;)

  • How Qt Works on Mobile Platforms?

    Moved
    2
    0 Votes
    2 Posts
    755 Views
    SGaistS

    Hi,

    The best way to find out is to look at Qt's sources. More precisely the platform plugins and the QPA architecture.

  • Windows Defender

    Moved Unsolved
    8
    0 Votes
    8 Posts
    4k Views
    R

    The binaries may scan fine but the behavior of the program could be the trigger. If the program does things that are suspicious it will get more attention (especially a new program).

    Just to make sure I would build Qt from source or only use binaries from a trusted source with a checksum hash that you can verify.

    This is a big concern I have when moving between Windows computers. I have not had problems but I always keep in the back of my mind that everything might be deleted in the blink of an eye and snowball into a bad day - bleh!

  • 0 Votes
    6 Posts
    3k Views
    Everton FonsecaE

    @raven-worx
    thanks = D

  • Excel API for C/C++

    43
    0 Votes
    43 Posts
    80k Views
    K

    It appears that the link should be http://wiki.qt.io/Handling_microsoft_excel_file_format

    Scroll down a bit and there is a list of c++ Excel libraries.

  • What Qt apps or libraries would you love to see?

    Unsolved
    19
    2 Votes
    19 Posts
    6k Views
    tekojoT

    @Wieland this comes up on occasion, but it never gets to a high enough priority to be taken forward :(

    inqlude is the best place, and it has most of the needed framework in place to work. Main missing part would be integration with Qt Creator.

  • Load Multiple Image

    Solved
    6
    0 Votes
    6 Posts
    4k Views
    V

    @HashTagJF
    I think you didn't check this ' QLabel *label[10];'

    Because you fixed it limit of array upto 10 that'swhy it's obtaining only 10, so just increase its limit you will find your answer.

    And if its solved your problem then make it 'solved'

  • The paintEvent() problem

    2
    1 Votes
    2 Posts
    1k Views
    tekojoT

    @VRonin you probably need a software copyright layer to answer that :)

    My totally layman understanding (and now I take my work hat off, as this is code owned by my employer) is that in Finland (and probably most of the EU) you would be safe if the code you are copying is practically the only way to do it, and it is so simple that it is the only reasonable solution to your problem, and that the part you are copying is short enough that could simply re-write it anytime, and you aren't copy pasting anything else from the same work.

    The problem is that everything I'm saying above is way too hand-wavy to be of any use. It's always a case-by-case situation.

    Linking has nothing to do with it. It is a question of does the copy-pasted material automatically bring it's license with it to your code.

    If you wanted to be utterly safe, you would ask your friend, who has not seen the Qt code to implement a paintEvent once, and then use that. He probably would come up with about the same seven to ten lines of code. (clean room is the only way to be totally sure)

  • How can the user send email to me from my app ?

    Moved Unsolved
    32
    0 Votes
    32 Posts
    15k Views
    O

    @Ahti do you have your own public server? If so, then perhaps the most easy way would be to code a simple http API that your app (with somekind of authentication obviously) can do a simple http POST to, and that thing then sends the e-mail to you.

  • Web application C++ server and React JS face

    Moved Unsolved
    10
    0 Votes
    10 Posts
    6k Views
    tekojoT

    (I'm not a web developer, but work with them, so take this as an opinion, not proper advice)

    The realtime collaboration you mention probably requires running javascript on the browser. It probably also means running things with web sockets.
    Socket libraries exist for a wide variety of platforms (Qt has them too), but as the frontend needs javascript, it might be easiest to use the same language all around.

    On the other hand, if you already have a web server in C++, extending that with web sockets shouldn't be too hard with a suitable library. That just leaves the browser end.

    So it comes down to the usual two questions:

    What language do you want to do this in (especially if it is not work, where you might have the language selected for you) Are you happy supporting your selection for the lifetime of the project
  • Qt Aria2 GUI With Background

    Solved
    2
    0 Votes
    2 Posts
    2k Views
    mrjjM

    Hi and welcome
    You should look at
    http://doc.qt.io/qt-5/qsystemtrayicon.html#details
    maybe also
    http://doc.qt.io/qt-5/qprocess.html
    For starting/controlling it.
    Maybe use
    http://doc.qt.io/qt-5/qnetworkaccessmanager.html
    to talk to Aria2 RPC interface

  • CDB process Terminated.

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    HashTagJFH

    @sandy.martel23 it isn't working too. When I tried to run the .exe it is looking for QT5core.dll

  • QT Compatibility with Visual Studio

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    HashTagJFH

    Thanks for your answer. I just want to confirm if I downloaded the right versions. Thanks.

  • Which platform is best for IDE Mac or Windows?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    ?

    To add to what @mrjj said, there's a table with a overview over the supported host / target platforms on the wiki: Supported Platforms