Search Results

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

Page 46/119 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • What is the correct way to customize Icon and Text position of items in a QListView?

    - by petermcg
    I'm using C++ and Qt's (4.6) model/view framework and wondering what is the correct way to change the display of items in a QListView or a class derived from QListView from: to: I'm not concerned about the sort order or Flow, I'm interested in the best way to correctly position the text to the right of the icon. If this can only be done by writing a custom QStyledItemDelegate that's totally fine, I want to rule out whether this is the correct approach or whether it's best to look at setLayout or similar, example code would help. The example application I'm looking at is the 'interview' example from qtdemo which amongst other things displays icons and text in a QListView.

    Read the article

  • How to get tag parameter value with XQuery

    - by uni
    For example i have this xml. I need to get value of parameter val of tag foo with id="two" <top> <sub id="one"> <foo id="two" val="bar" /> sometext </sub> </top> Whis this query (using Qt QXmlQuery): doc('test.xml')/top/sub[@id='one']/foo[@id='two']/<p>{@val}</p> I receive <p val="bar"/>, but I need only text "bar" without any tags. I tried to remove <p> and </p> and receive syntax error, unexpected { How can i get parameter value without any tags?

    Read the article

  • How to check that a regular expression fall into infty loop or not?

    - by Sorush Rabiee
    I'm trying to learn and hopefully use regular expression with Qt. I found that some patterns cause handler to fall into loop. for example searching \b\b in a text, never will terminate. and number of these expressions is infinite (\b\b\b,\b\b\b\b and so on). I'd like to determine and control all invalid expressions. Is there an algorithm to distinguish valid and invalid expressions? If not, how can I prevent my program from falling into an infinite loop?

    Read the article

  • Numeric GUI bottleneck

    - by Physic
    Hi all, I've made a GUI to set up and start a numerical integrator using PyQT4, Wing, QT, and Python 2.6.6, on my Mac. The thing is, when I run the integrator form the GUI, it takes very many times longer than when I crudely run the integrator from the command line. As an example, a 1000 year integration took 98 seconds on the command line and ~570 seconds from the GUI. In the GUI, the integration runs from a thread and then returns. It uses a a queue to communicate back to the GUI. Does anyone have any ideas as to where the bottleneck is? I suspect that others may be experiencing something like this just on a smaller scale. t = threading.Thread( target=self.threadsafe_start_thread, args=( self.queue, self.selected ) ) t.start() Thanks!

    Read the article

  • qmake library reordering

    - by user1095108
    I put this into a qmake file: QTPLUGIN += component LIBS += -L../lib -lmodule -lcomponent -lnetworking But qmake reorders the libraries behind my back: g++ -m64 -Wl,-O1,--sort-common,--as-needed,-z,relro -o testb .obj/constants.o .obj/main.o .obj/qrc_application.o -L/usr/lib -L../lib -lmodule -lnetworking -lcomponent -lQtGui -lQtNetwork -lQtCore -lpthread Probably because component is a static plugin. But it has a static dependency on the networking library and hence the reordering causes a link error. It is a static dependency and hence is ok in my opinion. How to work around this? I'm using qt 4.8.1.

    Read the article

  • How to force calling of QWidget::paintEvent() when its hovered by other window?

    - by Pie_Jesu
    Hi there. I have occured a problem: I'm writing a widget, which displays current date's day number. It's like a button, but it's not derived from QPushButton class. Just from QWidget. So I reimplemented enterEvent(), leaveEvent(), mousePressEvent(), mouseReleaseEvent(). I call update() inside these methods and widget has realistic button behavior (paintEvent() is reimplemented too). But when I change system date and hover that widget with other window, my widget doesn't calls paintEvent() and displays old date. Only when I place mouse over it, widget repaints it's contents. I guess there is an option, which paints old contents on hover event to avoid unnecessary paint events. But I need to disable it. Tried to set many attributes (Qt::WidgetAttribute enum). But it doesn't helps. Please, help me (and sorry for my bad english).

    Read the article

  • What are the drawbacks of using PHP to create variables in my CSS stylesheet?

    - by Greg
    One significant drawback of CSS is that one can't use variables. For example, I'd like to use variables to control the location of imported CSS, and it would be awesome to create variables for colors that are used repeatedly in a design. One approach is to use a PHP file for the CSS stylesheet. In other words, create a "style.php" with... <?php header("Content-type: text/css"); ?> ...at the top of the file, and then link to it using... <link href="style.php" rel="stylesheet" type="text/css" /> ...in any file that uses these styles. So what's the catch? I think it might be performance -- I did a few quick experiments in Firefox/Firebug and as one would expect, the CSS stylesheet is cached, but the PHP stylesheet isn't. So we're paying the price of an additional GET. The other annoying thing is that TextMate does not syntax highlight properly for CSS in a .php file. Are there other drawbacks? Have you used this approach, and if so, would you recommend it?

    Read the article

  • Large number of simultaneous long-running operations in Qt

    - by Hostile Fork
    I have some long-running operations that number in the hundreds. At the moment they are each on their own thread. My main goal in using threads is not to speed these operations up. The more important thing in this case is that they appear to run simultaneously. I'm aware of cooperative multitasking and fibers. However, I'm trying to avoid anything that would require touching the code in the operations, e.g. peppering them with things like yieldToScheduler(). I also don't want to prescribe that these routines be stylized to be coded to emit queues of bite-sized task items...I want to treat them as black boxes. For the moment I can live with these downsides: Maximum # of threads tend to be O(1000) Cost per thread is O(1MB) To address the bad cache performance due to context-switches, I did have the idea of a timer which would juggle the priorities such that only idealThreadCount() threads were ever at Normal priority, with all the rest set to Idle. This would let me widen the timeslices, which would mean fewer context switches and still be okay for my purposes. Question #1: Is that a good idea at all? One certain downside is it won't work on Linux (docs say no QThread::setPriority() there). Question #2: Any other ideas or approaches? Is QtConcurrent thinking about this scenario? (Some related reading: how-many-threads-does-it-take-to-make-them-a-bad-choice, many-threads-or-as-few-threads-as-possible, maximum-number-of-threads-per-process-in-linux)

    Read the article

  • Qt, no such slot error

    - by Martin Beckett
    I'm having a strange problem with slots in Qt4.6 I have a tree control that I am trying to fire an event back to the mainwindow to edit something. I have boiled it down to this minimal example: class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(int argc, char **argv ); private Q_SLOTS: void about() {QMessageBox::about(this, "about","about"); } // Just the defaul about box void doEditFace() {QMessageBox::about(this, "test","doEditFace"); } // pretty identical .... } class TreeModel : public QAbstractItemModel { Q_OBJECT Q_SIGNALS: void editFace(); ... } In my Mainwindow() I have connect(treeModel, SIGNAL(editFace()), this, SLOT(about())); // returns true connect(treeModel, SIGNAL(editFace()), this, SLOT(doEditFace())); // returns false When I run it the second line gives a warning. Object::connect: No such slot MainWindow::doEditFace() in \src\mainwindow.cpp:588 As far as I can see the doEditFace() is in the moc_ qmeta class perfectly correctly. And the edit event fires and pops up the about box. The order doesn't matterm if I connect the about box second it still works but my slot doesnt! vS2008 windowsXP qt4.6.2

    Read the article

  • Disable text selection in QT/WebKit GUI

    - by Adal
    I'm checking if it would be possible to implement a GUI using HTML through PyQT and WebKit. One of the problem is that using the mouse you can select the text making up the interface. Can this behaviour be disabled? Also, the mouse pointer changes to an insertion caret while over the selectable text. I would like to disable this, without disabling the hand mouse pointer which appears when over a clickable link.

    Read the article

  • Phonon::VideoWidget not working in Qt 4.4

    - by user249490
    Hi, I have Phonon::VideoWidget, Phonon::MediaObject and Phonon::MediaSource, all initialized as below. videoWidget=new Phonon::VideoWidget(this); mediaVideoObject=new Phonon::MediaObject(this); Phonon::createPath(mediaVideoObject, videoWidget); Phonon::MediaSource mediaSource= Phonon::MediaSource("D:\\file.avi"); mediaVideoObject->setCurrentSource(mediaSource); and all connections laid for Play, Pause, Next, Previous. It is working for few videos while for some other it is throwing IDispatch error #24 (0x80040218) and error type as Fatal. I am using Qt4.4 in windows XP and has backend support as well. I have to play those videos which are throwing the above mentioned error. What might be the reason and how i can overcome the error?

    Read the article

  • How to access Postgresql using QT in Windows

    - by dummystories
    Hi to all, I am developing an application using QtRuby and postgresql. I sucessfully developed and running sucessfully in Linux. Now i want to run the same application in windows. But i am failing to connect to database(Postgresql). I am getting the following errors: QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC Can any one help how to resolve my problem. I am waiting for your replies. Regards, Narasimha Raju.Naidu

    Read the article

  • QT intellisense question

    - by uzay95
    in this code: #include <QApplication> #include <QPushButton> int main(int argc,char *argv[]) { QApplication app(argc,argv); QPushButton *button = new QPushButton("Button Text"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit())); button->show(); return app.exec(); } intellisense is appearing when the cursor is in SIGNAL parenthesis to write button event. But it doesn't appear in SLOT parenthesis to write app method ? is it related with & character in front of app ?

    Read the article

  • QT QFileDialog how to hide hidden/backup folders (".folder")

    - by Alberto Toglia
    Basically when browsing folders inside a QFileDialog I find very annoying to have everything bloated with hidden or backup folders (don't know how to call them really); specially on home. Is there a way to prevent these type of folders from showing by default on a QFileDialog? I'm using Qt4.6 and getOpenFileName. P.D.: I'm starting to think this might be an ubuntu thing...?

    Read the article

  • How to display a Dialog on window created using XCreateWindow in QT 4.5.2

    - by Ummar
    I am doing work on project. In which I have developed a full size screen displaying images using XCreateWindow. Now I want to display a dialog on this screen. I have created a QDialog it does'nt show on the full size screen but it is displayed on screen when it is not full size. Any Help. My code for creating screen and dialogbox is as follows XSetWindowAttributes attribs; XClassHint *classhints; XSizeHints *sizehints; int wndwidth, wndheight; long input_mask, ic_input_mask; XEvent xevent; wndwidth = fullscreen ? WidthOfScreen(screen) : width; wndheight = fullscreen ? HeightOfScreen(screen) : height; attribs.background_pixel = BlackPixelOfScreen(screen); attribs.backing_store = ownbackstore ? NotUseful : Always; attribs.override_redirect = fullscreen; wnd = XCreateWindow(display, RootWindowOfScreen(screen), 0, 0, wndwidth, wndheight, 0, CopyFromParent, InputOutput, CopyFromParent, CWBackPixel | CWBackingStore | CWOverrideRedirect, &attribs); XRaiseWindow(display, wnd); //QDialog I want to show on wnd(XCreateWindow) ToolbarDialog *objToolbarDialog= new ToolbarDialog(); objToolbarDialog->setVisible(true); objToolbarDialog->showNormal();

    Read the article

  • Qt gstreamer problem

    - by ZolaKt
    Ptterb can you post your full code please? I copied your code. Added fvidscale_cap to pipeline, with: self.player.add(self.source, self.scaler, self.fvidscale_cap, self.sink) gst.element_link_many(self.source,self.scaler, self.fvidscale_cap, self.sink) From the main program I create a new QWidget, and pass its winId() to Vid constructor. The widget start loading, but crashes. The output says: should be playing Segmentation fault

    Read the article

  • Hook key & key combinations from keyboard with Qt 4.6

    - by Viet
    Let's say I have a window-less application which has only an icon on the Taskbar (Windows, Mac OS X & Linux). I want it to capture some key & key combinations, let's say Right Control + Right Shift. Upon keying in correct, combination, it will do something, say take screenshot. I can do window-less app, icon on the Taskbar and screen capture but I don't know how to monitor keyboard globally for key combinations. Please kindly advise. Any help or hint is greatly appreciated! Thanks in advance!

    Read the article

  • Calculix Data Visualiser using QT

    - by Ann
    I am doing a project on Calculix Data Visualiser. It is a civil based project. I need to show the structure of beams before applying force and the structure after the force is applied. I need to change the color of the beams to RED where more force is applied. But i am just able to change the color for lines and not for the phase as a whole. SO pls help me out.

    Read the article

  • Converting QXmlItem to QtDomElement or similar?

    - by EightyEight
    Hello everyone. I'm parsing a fairly complicated XML file of the following structure: <root> ... ... <item> <subitem id="1"/> <text> text1 </text> </item> <item> <subitem id="2"/> <text> text2 </text> </item> ... <item> ... </item> ...</root> It's pretty crude but you get my drift I hope. I'm primarily interested in "item" nodes. So I wrote the following code (directly out of the Qt's online manual): QXmlQuery query; query.setQuery("//item/"); QXmlResultItems result; query.evaluateTo(&result); QXmlItem item(result.next()); while (!item.isNull()) { if (item.isNode()) { // WHAT DO I DO NOW? } item = result.next(); } Now, QXmlItem appears to represent two concepts, a literal value (like a string) or a Node, (which is what item.isNode() is doing). Unfortunately, I can't grasp how to convert the QXmlItem to something that will query-able again. In particular from the example above I'd like to grab the "id" attribute, and the text element. Can I do this using the XQuery approach, or am I way off base here? Any advice? Thanks!

    Read the article

  • QWebView not loading external resources

    - by Nick
    Hi. I'm working on a kiosk web browser using Qt and PyQt4. QWebView seems to work quite well except for one quirk. If a URL fails to load for any reason, I want to redirect the user to a custom error page. I've done this using the loadFinished() signal to check the result, and change the URL to the custom page if necessary using QWebView.load(). However, any page I attempt to load here fails to pull in external resources like CSS or images. Using QWebView.load() to set the initial page at startup seems to work fine, and clicking any link on the custom error page will result in the destination page loading fine. It's just the error page that doesn't work. I'm really not sure where to go next. I've included the source for an app that will replicate the problem below. It takes a URL as a command line argument - a valid URL will display correctly, a bad URL (eg. DNS resolution fails) will redirect to Google, but with the logo missing. import sys from PyQt4 import QtGui, QtCore, QtWebKit class MyWebView(QtWebKit.QWebView): def __init__(self, parent=None): QtWebKit.QWebView.__init__(self, parent) self.resize(800, 600) self.load(QtCore.QUrl(sys.argv[1])) self.connect(self, QtCore.SIGNAL('loadFinished(bool)'), self.checkLoadResult) def checkLoadResult(self, result): if (result == False): self.load(QtCore.QUrl('http://google.com')) app = QtGui.QApplication(sys.argv) main = MyWebView() main.show() sys.exit(app.exec_()) If anyone could offer some advice it would be greatly appreciated.

    Read the article

  • Shift count negative or too big error - correct solution?

    - by PeterK
    I have the following function for reading a big-endian quadword (in a abstract base file I/O class): unsigned long long CGenFile::readBEq(){ unsigned long long qT = 0; qT |= readb() << 56; qT |= readb() << 48; qT |= readb() << 40; qT |= readb() << 32; qT |= readb() << 24; qT |= readb() << 16; qT |= readb() << 8; qT |= readb() << 0; return qT; } The readb() functions reads a BYTE. Here are the typedefs used: typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; The thing is that i get 4 compiler warnings on the first four lines with the shift operation: warning C4293: '<<' : shift count negative or too big, undefined behavior I understand why this warning occurs, but i can't seem to figure out how to get rid of it correctly. I could do something like: qT |= (unsigned long long)readb() << 56; This removes the warning, but isn't there any other problem, will the BYTE be correctly extended all the time? Maybe i'm just thinking about it too much and the solution is that simple. Can you guys help me out here? Thanks.

    Read the article

  • Losing 'post' requests sent to Pylons paster server

    - by Philip McDermott
    I'm sending post requests to a Pylons server (served by paster serve), and if I send them with any frequency many don't arrive at the server. One at a time is ok, but if I fire off a few (or more) within seconds, only a small number get dealt with. If I send with no post data, or with get, it works fine, but putting just one character of data in the post fields causes massive losses. For example, sending 200, 2 will come back. Sending 100 more slowly, 10 will come back. I'm making the requests form inside a Qt application. Tis will work ok (no data): QString postFields = "" QNetworkRequest request(QUrl("http://server.com/endpoint")); QNetworkReply *reply = networkAccessManager-post(request, postFields.toAscii()); And this will result in only a fraction of the requests being dealt with: QString postFields = "" QNetworkRequest request(QUrl("http://server.com/endpoint")); QNetworkReply *reply = networkAccessManager-post(request, postFields.toAscii()); I've played around with turning on use_threadpool, and other options (threadpool_workers, threadpool_max_requests = 300), of which some combinations can alter the results slightly (best case 10 responses in 200). If I send similar requests to other (non paster) servers, the replies come back ok, so I'm almost certain its'a paster serve config issue. Any help or advice greatly appreciated. Thanks Philip

    Read the article

  • Emulating a web browser

    - by Sean
    Hello, we are tasked with basically emulating a browser to fetch webpages, looking to automate tests on different web pages. This will be used for (ideally) console-ish applications that run in the background and generate reports. We tried going with .NET and the WatiN library, but it was built on a Marshalled IE, and so it lacked many features that we hacked in with calls to unmanaged native code, but at the end of the day IE is not thread safe nor process safe, and many of the needed features could only be implemented by changing registry values and it was just terribly unflexible. Proxy support JavaScript support- we have to be able to parse the actual DOM after any javascript has executed (and hopefully an event is raised to handle any ajax calls) Ability to save entire contents of page including images FROM THE loaded page's CACHE to a separate location ability to clear cookies/cache, get the cookies/cache, etc. Ability to set headers and alter post data for any browser call And for the love of drogs, an API that isn't completely cryptic Languages acceptable C++, C#, Python, anything that can be a simple little console application that doesn't have a retarded syntax like Ruby. From my own research, and believe me I am terrible at google searches, I have heard good things about WebKit... would the Qt module QtWebKit handle all these features?

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >