Search Results

Search found 2964 results on 119 pages for 'qt stylesheet'.

Page 40/119 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Visual C++ 2008 runtime error-- debug vs release exe problem?

    - by larryq
    Hi everyone, I have a Windows executable (native, not .Net) project that I'm trying to pass along to a new team member. It's a graphics modeling tool that uses the Qt widget library and OpenGL. The project runs fine on my box but when we buld and link it on this new member's machine and he tries deubugging it, here's what he sees (not all entries included, for brevity): ModelingTool.exe': Loaded 'C:\ModelingTool\ModelingTool\ModelingTool\Debug\ModelingTool.exe', Symbols loaded. 'ModelingTool.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'ModelingTool.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 'ModelingTool.exe': Loaded 'C:\Windows\System32\opengl32.dll', Cannot find or open the PDB file 'ModelingTool.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file 'ModelingTool.exe': Loaded 'C:\Windows\System32\dwmapi.dll', Cannot find or open the PDB file 'ModelingTool.exe': Loaded 'C:\Qt\4.2.2\bin\Qt3Supportd4.dll', Symbols loaded. 'ModelingTool.exe': Loaded 'C:\Program Files\Spyware Doctor\smum32.dll', Binary was not built with debug information. Debugger:: An unhandled non-continuable exception was thrown during process load The program '[5936] ModelingTool.exe: Native' has exited with code -1072365566 (0xc0150002). Would anyone care to guess what's wrong here? Some sort of debug-release mismatch perhaps?

    Read the article

  • How to use QCOMPARE Macro to compare events

    - by vels
    Hi, I have MyWindow class which popus a blank window, which accepts a mouse click, I need to unit test the mouse click event Code snippet: void TestGui::testGUI_data() { QTest::addColumn<QTestEventList>("events"); QTest::addColumn<QTestEventList>("expected"); Mywindow mywindow; QSize editWidgetSize = mywindow.size(); QPoint clickPoint(editWidgetSize.rwidth()-2, editWidgetSize.rheight()-2); QTestEventList events, expected ; events.addMouseClick( Qt::LeftButton, 0, clickPoint); expected.addMouseClick( Qt::LeftButton, 0, clickPoint); QTest::newRow("mouseclick") << events << expected ; } void TestGui::testGUI() { QFETCH(QTestEventList, events); QFETCH(QTestEventList, expected); Mywindow mywindow; mywindow.show(); events.simulate(&mywindow); QCOMPARE(events, expected); } // prints FAIL! : TestGui::testGUI(mouseclick) Compared values are not the same How to test the mouse click on mywindow. is there any beeter approach to unit test mouse events? Thanks, vels

    Read the article

  • My QFileSystemModel doesn't work as expected in PyQt

    - by Skilldrick
    I'm learning the Qt Model/View architecture at the moment, and I've found something that doesn't work as I'd expect it to. I've got the following code (adapted from Qt Model Classes): from PyQt4 import QtCore, QtGui model = QtGui.QFileSystemModel() parentIndex = model.index(QtCore.QDir.currentPath()) print model.isDir(parentIndex) #prints True print model.data(parentIndex).toString() #prints name of current directory childIndex = model.index(0, 0, parentIndex) print model.data(childIndex).toString() rows = model.rowCount(parentIndex) print rows #prints 0 (even though the current directory has directory and file children) The question: Is this a problem with PyQt, have I just done something wrong, or am I completely misunderstanding QFileSystemModel? According to the documentation, model.rowCount(parentIndex) should return the number of children in the current directory. The QFileSystemModel docs say that it needs an instance of a Gui application, so I've also placed the above code in a QWidget as follows, but with the same result: import sys from PyQt4 import QtCore, QtGui class Widget(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) model = QtGui.QFileSystemModel() parentIndex = model.index(QtCore.QDir.currentPath()) print model.isDir(parentIndex) print model.data(parentIndex).toString() childIndex = model.index(0, 0, parentIndex) print model.data(childIndex).toString() rows = model.rowCount(parentIndex) print rows def main(): app = QtGui.QApplication(sys.argv) widget = Widget() widget.show() sys.exit(app.exec_()) if __name__ == '__main__': main()

    Read the article

  • QSqlQuery UPDATE/INSERT DateTime with server's time (eg CURRENT_TIMESTAMP)

    - by Skinniest Man
    I am using QSqlQuery to insert data into a MySQL database. Currently all I care about is getting this to work with MySQL, but ideally I'd like to keep this as platform-independent as possible. What I'm after, in the context of MySQL, is to end up with code that effectively executes something like the following query: UPDATE table SET time_field=CURRENT_TIMESTAMP() WHERE id='5' The following code is what I have attempted, but it fails: QSqlQuery query; query.prepare("INSERT INTO table SET time_field=? WHERE id=?"); query.addBindValue("CURRENT_TIMESTAMP()"); query.addBindValue(5); query.exec(); The error I get is: Incorrect datetime value: 'CURRENT_TIMESTAMP()' for column 'time_field' at row 1 QMYSQL3: Unable to execute statement. I am not surprised as I assume Qt is doing some type checking when it binds values. I have dug through the Qt documentation as well as I know how, but I can't find anything in the API designed specifically for supporting MySQL's CURRENT_TIMESTAMP() function, or that of any other DBMS. Any suggestions?

    Read the article

  • Which compiler option I should choose?

    - by Surjya Narayana Padhi
    Hi Geeks, I have to use the third party static library for my qt application to run on windows. The third party provides me a .lib and .h file for use. These libraries are compiled with MSVC compiler. My qt Creator is using MinGW compiler to compile my application. I copied the .h and .lib file to my qt project directory and then added those in .pro file as follows QT += core gui TARGET = MyTest TEMPLATE = app LIBS += C:\Qt\2010.05\qt\MyTest\newApi.lib SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h \ newApi.h FORMS += mainwindow.ui Now I am getting some runtime error like this - Starting C:\Qt\2010.05\qt\MyTest-build-desktop\debug\MyTest.exe... C:\Qt\2010.05\qt\MyTest-build-desktop\debug\MyTest.exe exited with code -1073741515 Can any body suggest is this runtime error is due to mismatch of compiler? (because of my .lib file I added is comipled in MSVC compiler and my qt app is compiled using MinGW compiler) If not what may be the reason? Am I missing anything in adding the .h and .lib file to my qt project? If my MinGW compiler will not support the .lib file generated in MSVC compiler what may be the work-arround? Can I create the .lib files in MinGW compiler? or this format is supported only by MSVC compiler only? Please suggest...

    Read the article

  • How do I enforce the order of qmake library dependencies?

    - by James Oltmans
    I'm getting a lot of errors because qmake is improperly ordering the boost libraries I'm using. Here's what .pro file looks like QT += core gui TARGET = MyTarget TEMPLATE = app CONFIG += no_keywords \ link_pkgconfig SOURCES += file1.cpp \ file2.cpp \ file3.cpp PKGCONFIG += my_package \ sqlite3 LIBS += -lsqlite3 \ -lboost_signals \ -lboost_date_time HEADERS += file1.h\ file2.h\ file3.h FORMS += mainwindow.ui RESOURCES += Resources/resources.qrc This produces the following command: g++ -Wl,-O1 -o MyTarget file1.o file2.o file3.o moc_mainwindow.o -L/usr/lib/x86_64-linux-gnu -lboost_signals -lboost_date_time -L/usr/local/lib -lmylib1 -lmylib2 -lsqlite3 -lQtGui -lQtCore Note: mylib1 and mylib2 are statically compiled by another project, placed in /usr/local/lib with an appropriate pkg-config .pc file pointing there. The .pro file references them via my_package in PKGCONFIG. The problem is not with pkg-config's output but with Qt's ordering. Here's the .pc file: prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: my_package Description: My component package Version: 0.1 URL: http://example.com Libs: -L${libdir} -lmylib1 -lmylib2 Cflags: -I${includedir}/my_package/ The linking stage fails spectacularly as mylib1 and mylib2 come up with a lot of undefined references to boost libraries that both the app and mylib1 and mylib2 are using. We have another build method using scons and it properly orders things for the linker. It's build command order is below. g++ -o MyTarget file1.o file2.o file3.o moc_mainwindow.o -L/usr/local/lib -lmylib1 -lmylib2 -lsqlite3 -lboost_signals -lboost_date_time -lQtGui -lQtCore Note that the principle difference is the order of the boost libs. Scons puts them at the end just before QtGui and QtCore while qmake puts them first. The other differences in the compile commands are unimportant as I have hand modified the qmake produced make file and the simple reordering fixed the problem. So my question is, how do I enforce the right order in my .pro file despite what qmake thinks they should be?

    Read the article

  • Cross Platform C library for GUI Apps?

    - by Moshe
    Free of charge, simple to learn/use, Cross Platform C library for GUI Apps? Am I looking for Qt? Bonus question: Can I develop with the said library/toolkit on Mac then recompile on PC/Linux? Super Bonus Question: Link to tutorial and/or download of said library. (RE)EDIT: The truth is that I'm in the process of catching up on the C family (coming from web development - XHTML/PHP/MySQL) to learn iPhone development. I do understand that C is not C++ or ObjectiveC but I want to keep the learning curve as simple as possible. Not to get too off topic, but I am also on the lookout for good starter books and websites. I've found this so far. I'm trying to kill many birds with one stone here. I don understand that there are platform specific extensions, but I will try to avoid those for porting purposes The idea is that I want to write the code on one machine and just compile thrice. (Mac/Win/Linux) If Objective C will compile on Windows and Linux as well as OS X then that's good. If I must use C++, that's also fine. EDIT: Link to QT Please...

    Read the article

  • error: expected ',' or '...' before numeric constant

    - by goldfrapp04
    Just a Qt Gui Application with QDialog as the Base Class, the simplest type you can expect. I've programmed on Qt for several times but this is the first time I meet this problem... I've added minimal code to the program, and here's the code in dialog.h (which is mostly automatically generated) #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QPixmap> #include "bmp.h" namespace Ui { class Dialog; } class Dialog : public QDialog { Q_OBJECT public: explicit Dialog(QWidget *parent = 0); ~Dialog(); private slots: void on_openButton_clicked(); private: Ui::Dialog *ui; BMP srcImage; QImage compressedImage[3]; }; #endif // DIALOG_H While I edit, the "public:" is underlined and says "unexpected token '('". When I try to build the program, it says in the line "Q_OBJECT", "error: expected ',' or '...' before numeric constant". I'm sure I've defined nothing related to it (to be exact, I defined an N and an n in file bmp.h, both are int). Any idea of what's wrong here? Thanks.

    Read the article

  • At what point is it worth using a database?

    - by radix07
    I have a question relating to databases and at what point is worth diving into one. I am primarily an embedded engineer, but I am writing an application using QT to interface with our controller. We are at an odd point where we have enough data that it would be feasible to implement a database (around 700+ items and growing) to manage everything, but I am not sure it is worth the time right now to deal with. I have no problems implementing the GUI with files generated from excel and parsed in, but it gets tedious and hard to track even with VBA scripts. I have been playing around with converting our data into something more manageable for the application side with Microsoft Access and that seems to be working well. If that works out I am only a step (or several) away from using an SQL database and using the QT library to access and modify it. I don't have much experience managing data at this level and am curious what may be the best way to approach this. So what are some of the real benefits of using a database if any in this case? I realize much of this can be very application specific, but some general ideas and suggestions on how to straddle the embedded/application programming line would be helpful. Thanks

    Read the article

  • Updating Pointer using signals and slots

    - by Umesha MS
    Hi, I am very new to the QT; please help me to solve the problem. I am using thread to perform intensive operation in back ground. Meanwhile I want to update the UI, so I am using SIGNALS and SLOTS. To update UI I emit a signal and update UI. Let us consider bellow sample code, struct sample { QString name; QString address; }; void Update(sample *); void sampleFunction() { sample a; a.name = "Sachin Tendulkar"; a.address = "India" emit Update(&a); } In the above code we are creating a local object and passing the address of local object. In the QT document, it says that when we emit a signal it will be placed in the queue and late it will be delivered to the windows. Since my object is in local scope it will be delete once it goes out of the scope. Please tell me a way to send a pointer in a signal.

    Read the article

  • Building argv and argc

    - by Wylie Coyote SG.
    I'm a student programmer using Qt to build a GUI application for work. The primary purpose of this application is to open some of our old style files, allows better editing and then save the file in a new format and file extension. Recently I have been asked to allow this conversion to take place from a terminal. While I do know what argv and argc are along with what they represent I am unsure how to accomplish what they want. For instance how to handle relative paths vs. absolute... maybe how to get absolute from relative; perhaps none of that is even needed. My programming experience has been primarily with guis so this is a little new to me. Users would like the following to be ran from the terminal application -o /fileLocation /fileDestination template(to determine new format) I began to use for loops and if statements to begin accomplishing this when I relized that I might be taking the worng approach to all of this. I WOULD ALSO BE REALLY INTERESTED IF QT HAS SOMETHING FOR THIS! Here is what I have began coming up with: int main(int argc, char *argv[]) { if(argc > 1) { for(int i = 0; i < argc; i++) { if(argv[i] == "-c") { QString fileName = QString::fromStdString(argv[i+1]); QString fileDestination = QString::fromStdString(argv[i+2]); QString templateName = QString::fromStdString(argv[i+3]); QFile fileToConvert(fileName); if(fileToConvert.open(QFile::ReadOnly)) { //do stuff Thanks for reading my post and a big thanks for any contributions you make to helping me overcome this issue.

    Read the article

  • Modal QMessageBox does not behave like native Windows dialogs

    - by Philip Daubmeier
    My application has a dialog that asks the user via a QMessageBox whether he wants to discard all changes he made or wants to keep editing. I want this dialog to be modal to the whole application. I read somewhere that this is the standard behavior for a QMessageBox, so I dont have to set it explicitly with something like: mbox.setWindowModality(Qt::ApplicationModal); I wonder why it behaves differently from other modal dialogs in the OS (Windows 7 in my case). On the one hand it functions like it should, i.e. all other input methods in the application are blocked until the user answeres the dialog. However, it doesn't 'blink'* if the user clicks any other window of the application. Is there any way to get Qt to behave like a native Windows dialog? Thanks in advance! *If you don't know what I mean with this 'blinking': Just open notepad on a Windows OS, type some text and try to close it. A dialog pops up that asks to save, discard or keep editing. Now click somewhere on the editor window - the border and titlebar of the dialog flashes/blinks a few times.

    Read the article

  • QMetaMethods for regular methods missing?

    - by oleks
    Hi, I'm new in QT, and I'm just testing out the MOC. For a given class: class Counter : public QObject { Q_OBJECT int m_value; public: Counter() {m_value = 0;} ~Counter() {} int value() {return m_value;} public slots: void setValue(int value); signals: void valueChanged(int newValue); }; I want to get a list of all methods in a class, but seem to only be getting a list of signals and slots, although the documentation says it should be all methods? Here's my code: #include <QCoreApplication> #include <QObject> #include <QMetaMethod> #include <iostream> using std::cout; using std::endl; int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); const QMetaObject cntmo = Counter::staticMetaObject; for(int i = 0; i != cntmo.methodCount(); ++i) { QMetaMethod qmm(cntmo.method(i)); cout << qmm.signature() << endl; } return app.exec(); } Please beware this is my best c/p, perhaps I forgot to include some headers. My output: destroyed(QObject*) destroyed() deleteLater() _q_reregisterTimers(void*) valueChanged(int) setValue(int) Does anyone know why this is happening? Does qt not recognise int value() {return m_value;} as a valid method? If so, is there a macro I've forgotten or something like that? P.S. I'm using 4.6.2 UPDATE I forgot the implementation of the setValue method, not that it makes too much a difference to my actual question. void Counter::setValue(int value) { if(value != m_value) { m_value = value; emit valueChanged(value); } }

    Read the article

  • QMetaMethod for regular methods missing?

    - by oleks
    Hi, I'm new in QT, and I'm just testing out the MOC. For a given class: class Counter : public QObject { Q_OBJECT int m_value; public: Counter() {m_value = 0;} ~Counter() {} int value() {return m_value;} public slots: void setValue(int value); signals: void valueChanged(int newValue); }; I want to get a list of all methods in a class, but seem to only be getting a list of signals and slots, although the documentation says it should be all methods? Here's my code: #include <QCoreApplication> #include <QObject> #include <QMetaMethod> #include <iostream> using std::cout; using std::endl; int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); const QMetaObject cntmo = Counter::staticMetaObject; for(int i = 0; i != cntmo.methodCount(); ++i) { QMetaMethod qmm(cntmo.method(i)); cout << qmm.signature() << endl; } return app.exec(); } Please beware this is my best c/p, perhaps I forgot to include some headers. My output: destroyed(QObject*) destroyed() deleteLater() _q_reregisterTimers(void*) valueChanged(int) setValue(int) Does anyone know why this is happening? Does qt not recognise int value() {return m_value;} as a valid method? If so, is there a macro I've forgotten or something like that? P.S. I'm using 4.6.2

    Read the article

  • Qt 4.6 Adding objects and sub-objects to QWebView window object (C++ & Javascript)

    - by Cor
    I am working with Qt's QWebView, and have been finding lots of great uses for adding to the webkit window object. One thing I would like to do is nested objects... for instance: in Javascript I can... var api = new Object; api.os = new Object; api.os.foo = function(){} api.window = new Object(); api.window.bar = function(){} obviously in most cases this would be done through a more OO js-framework. This results in a tidy structure of: >>>api ------------------------------------------------------- - api Object {os=Object, more... } - os Object {} foo function() - win Object {} bar function() ------------------------------------------------------- Right now I'm able to extend the window object with all of the qtC++ methods and signals I need, but they all have 'seem' to have to be in a root child of "window". This is forcing me to write a js wrapper object to get the hierarchy that I want in the DOM. >>>api ------------------------------------------------------- - api Object {os=function, more... } - os_foo function() - win_bar function() ------------------------------------------------------- This is a pretty simplified example... I want objects for parameters, etc... Does anyone know of a way to pass an child object with the object that extends the WebFrame's window object? Here's some example code of how I'm adding the object: mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QtGui/QMainWindow> #include <QWebFrame> #include "mainwindow.h" #include "happyapi.h" class QWebView; class QWebFrame; QT_BEGIN_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); private slots: void attachWindowObject(); void bluesBros(); private: QWebView *view; HappyApi *api; QWebFrame *frame; }; #endif // MAINWINDOW_H mainwindow.cpp #include <QDebug> #include <QtGui> #include <QWebView> #include <QWebPage> #include "mainwindow.h" #include "happyapi.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { view = new QWebView(this); view->load(QUrl("file:///Q:/example.htm")); api = new HappyApi(this); QWebPage *page = view->page(); frame = page->mainFrame(); attachWindowObject(); connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(attachWindowObject())); connect(api, SIGNAL(win_bar()), this, SLOT(bluesBros())); setCentralWidget(view); }; void MainWindow::attachWindowObject() { frame->addToJavaScriptWindowObject(QString("api"), api); }; void MainWindow::bluesBros() { qDebug() << "foo and bar are getting the band back together!"; }; happyapi.h #ifndef HAPPYAPI_H #define HAPPYAPI_H #include <QObject> class HappyApi : public QObject { Q_OBJECT public: HappyApi(QObject *parent); public slots: void os_foo(); signals: void win_bar(); }; #endif // HAPPYAPI_H happyapi.cpp #include <QDebug> #include "happyapi.h" HappyApi::HappyApi(QObject *parent) : QObject(parent) { }; void HappyApi::os_foo() { qDebug() << "foo called, it want's it's bar back"; }; I'm reasonably new to C++ programming (coming from a web and python background). Hopefully this example will serve to not only help other new users, but be something interesting for a more experienced c++ programmer to elaborate on. Thanks for any assistance that can be provided. :)

    Read the article

  • Uploading a file using post() method of QNetworkAccessManager

    - by user304361
    I'm having some trouble with a Qt application; specifically with the QNetworkAccessManager class. I'm attempting to perform a simple HTTP upload of a binary file using the post() method of the QNetworkAccessManager. The documentation states that I can give a pointer to a QIODevice to post(), and that the class will transmit the data found in the QIODevice. This suggests to me that I ought to be able to give post() a pointer to a QFile. For example: QFile compressedFile("temp"); compressedFile.open(QIODevice::ReadOnly); netManager.post(QNetworkRequest(QUrl("http://mywebsite.com/upload") ), &compressedFile); What seems to happen on the Windows system where I'm developing this is that my Qt application pushes the data from the QFile, but then doesn't complete the request; it seems to be sitting there waiting for more data to show up from the file. The post request isn't "closed" until I manually kill the application, at which point the whole file shows up at my server end. From some debugging and research, I think this is happening because the read() operation of QFile doesn't return -1 when you reach the end of the file. I think that QNetworkAccessManager is trying to read from the QIODevice until it gets a -1 from read(), at which point it assumes there is no more data and closes the request. If it keeps getting a return code of zero from read(), QNetworkAccessManager assumes that there might be more data coming, and so it keeps waiting for that hypothetical data. I've confirmed with some test code that the read() operation of QFile just returns zero after you've read to the end of the file. This seems to be incompatible with the way that the post() method of QNetworkAccessManager expects a QIODevice to behave. My questions are: Is this some sort of limitation with the way that QFile works under Windows? Is there some other way I should be using either QFile or QNetworkAccessManager to push a file via post()? Is this not going to work at all, and will I have to find some other way to upload my file? Any suggestions or hints would be appreciated. Thanks, Don

    Read the article

  • Video capture on MacOS

    - by Andrea Girardi
    Hi to all I'm wrtiting a C++ application with Trolltech QT Library and I need to capture video stream from a camera and some medical instrumentations. What kind of hardware can I use to do this? I've tried with OpenCV but it doesn't recognize my EyeTV 250. Can I use Pinnacle Video capture for Mac? thanks, Andrea

    Read the article

  • QTableWidget: How can I get tighter lines with less vertical spacing padding?

    - by Dirk Eddelbuettel
    The QTableWdiget is fabulous for simple grid displays. Changing colors, fonts, etc is straightforward. However, I did not manage to give the grid a 'tighter' look with less vertical whitespace. I see that the Qt documentation talks (eg here) about margin border padding around widgets, but when I set these I only get changes around the entire grid widget rather than inside. How can I set this (with a style sheet, or hard-coded options) directly to make the QTableWidget display tighter?

    Read the article

  • Create XML File Using XML Schema

    - by metdos
    Is there any easy way to create at least a template XML file using XML Schema? My main interest is bounded by C++, but discussions of other programming languages are also welcome.By the way I also use QT framework.

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >