Search Results

Search found 10050 results on 402 pages for 'graphics card'.

Page 71/402 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • Qt - drag and drop with graphics view framework

    - by David Davidson
    I'm trying to make a simple draggable item using the graphics framework. Here's the code for what I did so far: Widget class: class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); }; Widget::Widget(QWidget *parent) : QWidget(parent) { DragScene *scene = new DragScene(); DragView *view = new DragView(); QHBoxLayout *layout = new QHBoxLayout(); DragItem *item = new DragItem(); view->setAcceptDrops(true); scene->addItem(item); view->setScene(scene); layout->addWidget(view); this->setLayout(layout); } Widget::~Widget() { } DragView class: class DragView : public QGraphicsView { public: DragView(QWidget *parent = 0); }; DragView::DragView(QWidget *parent) : QGraphicsView(parent) { setRenderHints(QPainter::Antialiasing); } DragScene class: class DragScene : public QGraphicsScene { public: DragScene(QObject* parent = 0); protected: void dragEnterEvent(QGraphicsSceneDragDropEvent *event); void dragMoveEvent(QGraphicsSceneDragDropEvent *event); void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); void dropEvent(QGraphicsSceneDragDropEvent *event); }; DragScene::DragScene(QObject* parent) : QGraphicsScene(parent) { } void DragScene::dragEnterEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dragMoveEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dragLeaveEvent(QGraphicsSceneDragDropEvent *event){ } void DragScene::dropEvent(QGraphicsSceneDragDropEvent *event){ qDebug() << event->pos(); event->acceptProposedAction(); DragItem *item = new DragItem(); this->addItem(item); item->setPos(event->pos()); } DragItem class: class DragItem : public QGraphicsItem { public: DragItem(QGraphicsItem *parent = 0); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); void mouseMoveEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); }; DragItem::DragItem(QGraphicsItem *parent) : QGraphicsItem(parent) { setFlag(QGraphicsItem::ItemIsMovable); } QRectF DragItem::boundingRect() const{ const QPointF *p0 = new QPointF(-10,-10); const QPointF *p1 = new QPointF(10,10); return QRectF(*p0,*p1); } void DragItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){ if(painter == 0) painter = new QPainter(); painter->drawEllipse(QPoint(0,0),10,10); } void DragItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event){ } void DragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){ } void DragItem::mousePressEvent(QGraphicsSceneMouseEvent *event){ QMimeData* mime = new QMimeData(); QDrag* drag = new QDrag(event->widget()); drag->setMimeData(mime); drag->exec(); } void DragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){ } main.cpp instantiates a Widget and shows it. When I try to drag the circle, the app just creates another circle over the original one, regardless of where I release the drag. qDebug() in DragScene's dropEvent() shows QPointF(0,0) everytime the drag ends. I'm having a hard time trying to understand exactly what I have to do, which classes I should subclass, which methods needs to be overriden, to make this work. The documentation on this isn't very detailed. I'd like to know how to make this work, and if there's some other, more comprehensive resource to learn about the graphics view framework, besides the official documentation (which is excellent btw, but it would be great if there was a more detailed treatise on the subject). EDIT: Following badgerr's advice, I replaced item-pos() in DragScene::dropEvent() with item-scenePos(), now the drop event creates a new circle in the drop site, which is more or less what I wanted. But the original circle is still in place, and while the drag is in progress, the item doesn't follow the mouse cursor. The QGraphicsSceneDragDropEvent documentation says that pos() should return the cursor position in relation to the view that sent the event, which, unless I got it wrong, shouldn't be (0,0) all the time. Weird. I've read in a forum post that you can use QDrag::setPixMap() to show something during the drag, and in examples I've seen pictures being set as pixmaps, but how do I make the pixmap just like the graphics item I'm supposed to be dragging?

    Read the article

  • How to use a separate class to validate credit card numbers in C#

    - by EvanRyan
    I have set up a class to validate credit card numbers. The credit card type and number are selected on a form in a separate class. I'm trying to figure out how to get the credit card type and number that are selected in the other class (frmPayment) in to my credit card class algorithm: public enum CardType { MasterCard, Visa, AmericanExpress } public sealed class CardValidator { public static string SelectedCardType { get; private set; } public static string CardNumber { get; private set; } private CardValidator(string selectedCardType, string cardNumber) { SelectedCardType = selectedCardType; CardNumber = cardNumber; } public static bool Validate(CardType cardType, string cardNumber) { byte[] number = new byte[16]; int length = 0; for (int i = 0; i < cardNumber.Length; i++) { if (char.IsDigit(cardNumber, i)) { if (length == 16) return false; number[length++] = byte.Parse(cardNumber[i]); //not working. find different way to parse } } switch(cardType) { case CardType.MasterCard: if(length != 16) return false; if(number[0] != 5 || number[1] == 0 || number[1] > 5) return false; break; case CardType.Visa: if(length != 16 & length != 13) return false; if(number[0] != 4) return false; break; case CardType.AmericanExpress: if(length != 15) return false; if(number[0] != 3 || (number[1] != 4 & number[1] != 7)) return false; break; } // Use Luhn Algorithm to validate int sum = 0; for(int i = length - 1; i >= 0; i--) { if(i % 2 == length % 2) { int n = number[i] * 2; sum += (n / 10) + (n % 10); } else sum += number[i]; } return (sum % 10 == 0); } }

    Read the article

  • Saving file to phone in stead of SD-card

    - by Galip
    Hi guys, In my app I save an XML file to the users SD-card by doing File newxmlfile = new File(Environment.getExternalStorageDirectory() + "/Message.xml"); But not all users have SD-cards in their phone and therefore my app is likely to crash. How must I change my File creating method in order to save the file to the phone's memory instead of the SD-card? Also, how must I change the loading of the file? (currently: new InputSource(new FileInputStream(Environment.getExternalStorageDirectory() + "/Message.xml")))

    Read the article

  • Site stopped working after adding NIC card

    - by Sachin Kainth
    My boss made a bit of blunder yesterday, he added a secondary NIC card to the a machine hosting a website so that it could be part of the local network. He also added it to the <blah>.local domain (which all our servers are being added too). The website failed following this. He thought this was because the machine was now called <blahblah>.<blah>.local, so he removed it from the domain and restarted. Same problem a asp.net error, something to do with a binding error. Sorry he didn’t make a note of it. He traced it back to the WCF services that are running on the site. Anyway, it looks like ASP.NET gets confused connecting to the database when there’s multiple network cards. The 173.x.x.x IP address (which is internal), doesn’t route to the internet.. Therefore it’s trying to connect via the wrong network. Any ideas about how to resolve it?

    Read the article

  • HD Video Capture Card w/ Good API?

    - by Sheep Slapper
    Does anyone here know of a good HD video capture card that has a good (comprehensive) API? I administer a few servers that do some video encoding right now, but when we make the switch to HD cameras, they won't be sufficient. In addition to this, the servers we have now are black boxes, closed to me except to start/stop the video capture device. I'd like to be able to roll my own, so we can better integrate it with our existing systems, but I know almost nothing about what kind of HD capture cards are out there, and if I can avoid spending money just to test their APIs that would rock. So does anyone have any experience with this? All our other software is in C#, and I'd like to set up the new servers with web interfaces to start/stop the capture (also in C#, using .NET 3.5 probably). I'm not sure how language specific these APIs would be, but that's what I'm working with just as a reference point. I appreciate any help the community can give!

    Read the article

  • Smart card authentication to a Cisco switch?

    - by murisonc
    We have our Cisco network devices configured to authenticate network administrators using their domain accounts via RADIUS running on a Windows 2008R2 server with the network protection role. This works great for logging into the switch via SSH when configuring the devices. We are now in the beginning stages of deploying smart cards for logins. Does anyone know of a way to login to a Cisco switch using a smart card instead of a domain username and password? The SSH client we are using is Putty. Workstations are Windows 7. RADIUS is running on Windows 2008R2. We are running our own certificate authority on Windows 2008; network is not connected to the Internet. We prefer to not have to purchase additional proprietary devices for this functionality.

    Read the article

  • Recommend a wireless PCI card for Windows 7

    - by Dan
    I have a crummy RT2500-based 11g card which does work in Win7 with the Vista driver (3.2.0.0) but it dies about every two hours or so. Googling around has led me to conclude that Ralink drivers are basically borked, and that I need something else for a stable connection. Can anyone recommend a suitable wireless adapter? It needs to be: 802.11g - draft-N nice but not at all essential. PCI - I already have far more USB devices than can possibly be good for me. Very reliable. Money isn't an object within reason. All input gratefully received!

    Read the article

  • Acer Aspire 3820TG video card driver issue for Windows 8 Pro

    - by supernx
    The model for Acer laptop is ATI mobility Radeon 5650. I am using Windows 8 Pro from MSDN. It was working fine until two days ago when Microsoft pushes an update. After the update, my video card stops working and I only see black screen after loading splash screen. I can go in Safe Mode. I tried to install driver from AMD website but it failed with error message "load detection driver failed". Anyone else have the same issue? Any idea how to solve this? I need to go in Win8 for my latest development.

    Read the article

  • Using a sky card in Media Center

    - by Jonathan
    I'm not 100% is this SU suitable but oh well. I'm wondering if it's possible to get a slot of some kind to put my Sky Card into a Media Center PC and then be able to have a triple or dual tuner, and connect to the satelitte dish, allowing me to record 3 and watch a previously recorded. Also it would mean access to Youtube and things easily, with only one box. Also would this be legal or is it similar to Apple where you can only use Mac OSX on boxes with the Apple Logo on?

    Read the article

  • Windows XP Home Edition SP3 cant recognise PCMIA SD Card

    - by Pozo
    System Specifications: Laptop : Dell Inspiron 6000 OS: Windows Home Edition SP3 SD Adapter: Hagiwara Smart Media Adapter I inserted the card into the slot, windows xp recognises the device, lists the pcmia controller on the device manager list, an entry appears under the IDE ATA/ATAPI category on the device manager as well. However, the device does not show under my computer and the driver does not get assigned a letter number. I checked the system logs from the device manager and there were no logged errors. Checking the Hagiwara support website, the manufacturer indicates that the adapter driver is the same as the windows xp pcmia controller. Checking Dell's website, no specific drivers were listed for that either. General Search on the web indicates that multiple people face similar problems with their SD cards, yet none actually spell out the route issue that causes this. Please let me know if you have any suggestions for further debugging. Thanks in advance

    Read the article

  • Reliable Linux RAID Card

    - by Chris S
    Can anyone recommend an appropriate RAID card for use under Linux (Ubuntu)? I have three Western Digital SATA drives, and would like to setup either RAID-1 or RAID-5. Software RAID has been very flakey and unreliable for me (e.g. it doesn't seem to mirror the boot partition). Unfortunately, most RAID cards I've seen online don't mention any Linux driver support. Would most cards work in Linux, or do I have to look at a select few that explicitly support Linux?

    Read the article

  • Is it possible to change the default scan folder on an Eye-Fi Wireless SD Card

    - by MichaelPh
    By default Eye-Fi cards scan the DCIM folder (and subfolders) used by most digital cameras for new images to upload. Is there a way of changing this to a different folder? In my particular case I'm using a Kodak photo scanner (P461) that uses a PHOTO(N) folder format to store the scanned images, as far as I know the device has no configuration interface to alter this setting so that doesn't seem to be an option. This topic on the Eye-Fi forums is the closest I've come to a solution, but a perfunctory investigation of Disk Probe doesn't make it obvious what needs to be modified on the card.

    Read the article

  • 3 Monitors 1 graphic card

    - by Michael
    I have a Nvidia GT 120 graphic card. It has a vga, dvi and hdmi output. Can I have 3 monitors with this? One for each port. Also if not, can I use dvi and hdmi and have 2 monitors. I know I can do 2 with the vga and dvi but I am wondering about dvi and hdmi. Also my last question is, if I can have 2 monitors with the dvi and hdmi, can I use a hdmi to dvi and still have the same success? Thanks

    Read the article

  • "Punch card" application

    - by icelava
    Our main-con manager is looking for a "punch card" type of attendance-logging application. We need to take attendance every day, and the most "automatic" method is simply to track when people unlock their Windows desktop screen (not logon, because many simply leave the computer on indefinitely), and report to a remote location/repository, where the administrator will be able to observe which users unlocked their screens each day. Has anybody come across such an application suite? It likely has to be a Windows service so that it operates regardless of who is logged into the system.

    Read the article

  • PNY ExpressCard SATA II 2-port card - drivers?

    - by stewartwb
    I bought a couple of PNY eSATA cards for notebook computers, model P-NSA2-EC-RF. I mistakenly thought that they would be a bit more plug-and-play, like cards that supply USB or Firewire ports. They did not ship with the Driver CD, and the drivers I found on the PNY web site didn't work. I've emailed their support group, but we all know how likely it is that they will respond before the end of the decade. Does anyone have a driver disc handy for this model card, or know where I might download a driver ISO? (Dell XPS M1330 laptop running Windows 7 x64 and sometimes Windows 7 x86)

    Read the article

  • Do I have a bad video card?

    - by zooropa
    I think this is the right spot to post this question. Please don't flame me if it isn't. My work computer is a Dell Prescision M6400 laptop. I use the VGA output to a second monitor. There is something wrong with my second monitor's output. Here is a screenshot of my desktop. You can see fragments of the right side of a Windows File Explorer window in the image. Is this a bad video card?

    Read the article

  • VMware Fusion on MacBook Pro running Vista, not working after installing a wireless card

    - by Shelley
    A tech friend installed VMware on my Mac so I could use my Windows programs as well. It worked great until I inserted my Sierra 881 USB wireless card while in VMware trying to get to the internet while on the road. It worked briefly, then the AT&T Communication manager won't respond when you click on the icon, I can't open Network and Sharing center, I can't sync my palm - shows it can't connect. Looks like it messed up several things, along with not being able to connect to the internet while in windows. This wireless cards works directly from the Mac - but I need internet while in Windows for some work I am doing. How do I uninstall this - when I try - it just gives me an endless reloading circle - not doing anything. I really need to sync my palm and get back to the way it was. I don't know much about VMware at all and I don't have access to my friend right now to get help.

    Read the article

  • Removing DVI connectors stuck in video card ports

    - by thecyclegeek
    I need some help removing a couple of DVI connectors which are stuck in my video card ports. I don't know why they were screwed in so tightly in the first place but they won't move. I need to replace hardware in the machine, but doing so with the cables connected and the box in its current position is nearly impossible. I've tried pliers with grips to loosen the screws holding the cable, and I've tried a screwdriver, the latter ended up breaking off the plastic. Neither worked. I'm at a loss as to what to do and I'm very frustrated. Can I get some suggestions?

    Read the article

  • Drawing an animation over an already drawn screen

    - by Chandan Pednekar
    I am working on a XNA WP7 card game whose basic prototype is complete. In game screen, 6 cards are displayed at a time (3 for each of the two players say 1,2 and 3). If player A attacks one of player B's card then I want to show an animation over player B's card i.e the victim card(say a claw scratch for e.g.) My question is how do I approach with the animation system so that I can draw an animation over a card upon certain events e.g. dead, fire, claw attack etc. I have an attack function which detects which type of card is attacking which type of card. Depending on the type of attacker card I want to display the animation on the victim card. Can I call animation classes function for different animations in the attack function itself without actually having to call separate draw and update functions. If so, how? Also how do I play sound at the same time when the animation is going on?

    Read the article

  • Why can't Android find android.graphics.OpenGLContext?

    - by lostInTransit
    I am trying to compile some OpenGL samples available on the net in SDK 1.5. But the import statement for android.graphics.OpenGLContext gives me an error saying the class cannot be found. Can someone please tell me where I can find this class. And if it is no longer supported by the android SDK then how do I port the samples to 1.5.

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >